Free Essay

Tic Tac Toe

In: Computers and Technology

Submitted By hudgins84
Words 687
Pages 3
Charles Hudgins
Jaun Hernandez
Let's Start:
Create a New project and select windows application. Give it name and then press enter.(All of us know this step).
After that you see a blank form like that:

Now add 9 buttons on your form using tools.

Select button then delete the text from properties (i.e. button1, button2).Actually we want no text on buttons.

Now, Put a label on your form set back color according to your wish (here I choose sky-blue color from properties), set text align to middle center and set text to "Turn”. Actually we are creating a box for showing the player's Turn.

Add Another Label below above label. Remove text from it, leave it blank. Give it name="display turn”. Now our Application looks something like that.

Now doing the same above method, I have created a Scorecard for player1 and player2.I give name playerscore1 and playerscore2 for the labels as shown in figure.

I am creating this game for 2 person so, I supposed here Player1 symbol="X" and Player2 Symbol="O".Now I want when player1 click it gives "X" symbol on button. After his turn when Player2 click on button then it show "O" on another button. Double click on button1 and add the code given below.

Collapse | Copy Code void Button1Click(object sender, EventArgs e) { if(click1==0) { if(turn%2!=0) { button1.Text="X"; } else { button1.Text="O"; } turn++; click1++; } else { button1.Text=button1.Text; } display(); checkit(); } I have created int turn=1(help us in finding turn),int click1=0(for checking if button is pressed more than one times).

When Player click on button, it checks if condition i.e. click1=0 is true then it checks another condition for finding player turn.Starting value of turn is equal to1, so it checks (1%2!=0) that is True.So, It display "X" on the Button and increase 1 in int turn(turn++) and click1(click++).If condition become False it display "O" on button.If Player again presses the key then condition become false(because click1 become equal to 1) and text on button remain same.

After that I am Calling display() and checkit() method.

display() use for displaying the Player's turn and checkit() checks for winner of game.

Same coding is done for the other buttons instead of button1 write button2 and for click1 write click2;

display() method:

Collapse | Copy Code public void display() { if(turn%2!=0) { displayturn.Text="Player 1"; } else { displayturn.Text="Player 2"; } } It is use for showing the Turn of Player.For example:If turn=2 it shows "Player2" turn in our application.

checkit() method:

Collapse | Copy Code public void checkit()
if(button1.Text!="" && button2.Text!="" && button3.Text!="") { if(button1.Text==button2.Text && button1.Text==button3.Text) { button1.BackColor=Color.Green; button1.ForeColor=Color.White; button2.BackColor=Color.Green; button2.ForeColor=Color.White; button3.BackColor=Color.Green; button3.ForeColor=Color.White; if(button1.Text=="X") { MessageBox.Show("Player 1 Wins!"); player1++; player1score.Text=player1.ToString(); } else { MessageBox.Show("Player 2 Wins!"); player2++; player2score.Text=player2.ToString(); }
` cleargame(); } }
Firstly checkit() ckecks that button must contain text.After that if It found that Three Buttons have same text than changes the Back and ForeColor. After That it checks the Button Text.If text =="X" then give message that "Player1 Wins!" or If text=="O" then it gives message that ""player 2 Wins!.add +1 to player1 or player2(these are int variables) and display them in labels(player1score,player2score).

cleargame() method clears the data(i.e. BackColor,ForeColor,Buttons text,displayturn,variables value back to starting value)but does not clear the player1score and player2score.

Create two buttons one for reset and other is Play Again(Used in case of Tie Up).In Play Again Button(use if Tie Up Occurs) I pass the cleargame() method.

Game Preview: License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)…...

Similar Documents

Free Essay

The Anga-Toe

...This story is about the Anga-Toe. It is big, has claws, sharp teeth, will eat you, monobrow, sex unknown. Well we will tell you a small story of The Anga-Toe. In there year 2010 there were two little guys named Trinton and Dakota and they were walking in the woods beating up frogs and then they saw it, it was HUGE!!!! It looked very angry, and then it saw the two and started to chase them, luckily they were fast and got away. But when they got to town (location classified) no one believed them. So now every time they are at a campout they tell this story. There once was a cute little goat and her name was Ronda. One day Ronda was really thirsty and needed to find something to drink quickly with out knowing started to drink the atomic radiated pee from The Anga-Toe. One day Ronda met this nice little guy named Dillon and then they had a nice little baby but they realized that there baby had a disorder there was a small leg growing out of his ear, and that’s why there are birth defects. Its was created by a future scientist from the year 2277 sent back to 1500 B.C. He was sent back because there was a nucular war in the year 2077. The scientist sent It back to make sure that the war never happened. To there mistake it only made it worse. In 2015, the U.S. discovered The Anga-Toe as well his atomic radiated pee. So for 62 years they kept it a secret. That is until the U.S. got into a war with China. The Anga-Toe was a great help in the war. He went and peed on everyone......

Words: 337 - Pages: 2

Premium Essay

Tic Tac Toe Java Code

...OBJECT ORIENTED PROGRAMMING TIC TAC TOE Contents: Page 1. Specifications 3 2. Background 4 3. UML Design i. Use Case Diagram 5 ii. Class Diagram 6 4. Implementation i. How code is working? 7 ii. Conclusion 9 iii. Future Work 10 5. Appendix 10 6. References 15 7. Bibliography 15 1. Specifications: A requirements specification for a software system - is a complete description of the behavior of a system to be developed. It includes a set of use cases that describe all the interactions the users will have with the software. Use cases are also known as......

Words: 1071 - Pages: 5

Free Essay

Tic Gestion Comercial

...FUNDAMENTOS DE LAS TECNOLOGÍAS DE LA INFORMACIÓN Y LAS COMUNICACIONES (TIC) Y LOS SISTEMAS DE INFORMACIÓN (SI) Tecnologías Básicas 1.1 Hardware 1.2 Software 1.3 Bases de datos 1.4 Redes de Telecomunicación en la Empresa y sus Elementos 1.5 Internet Sistema de Información 2.1 Concepto 2.2 Funciones de los SI 2.3 Seguridad en los SI 2.4 Tipología de Sistemas de Información en la Empresa Comercial 2.5 Sistemas de Procesamiento de Transacciones (TPS) y Sistemas de Información para la Dirección (MIS) 2.6 Sistemas de Soporte para la Decisión (DSS) y Sistemas de Información para Ejecutivos (IS) Herramientas de Informática para la gestión comercial Contenido PARTE II APLICACIONES DE LAS TIC AL ÁMBITO COMERCIAL E-Marketing 3.1 Conceptos de mercadeo 3.2 Estrategia de e-marketing 3.3 Servicios versus productos 3.4 Investigación de mercados Aplicaciones Informáticas en la Gestión Comercial 4.1 Intercambio Electrónico de Datos (EDI) 4.2 Planificación de Recursos Empresariales (ERP) y Planificación extendida de Recursos (XRP) 4.3 Gestión de las Relaciones con los Clientes (CRM) y Gestión de la Cadena de Suministro (SCM) 4.4 Bases de Datos inteligentes (Datawarehouse y Datamining) Otras Aplicaciones en el Área Comercial 5.1 Comercio Electrónico 5.2 Teletrabajo 5.3 Herramientas para la Gestión del Conocimiento Implicaciones Estratégicas de las TICs en el Ámbito Comercial 6.1 Impacto en el atractivo de la Industria 6.2 Las TICs en la Gestión Comercial como Fuente de Ventaja......

Words: 6336 - Pages: 26

Free Essay

Tic Tac Toe

...EBizPort: Collecting and Analyzing Business Intelligence Information Byron Marshall, Daniel McDonald, Hsinchun Chen, and Wingyan Chung Artificial Intelligence Lab, Management Information Systems Department, University of Arizona, Tucson, AZ 85721. E-mail: {byronm, dmm, hchen, wchung} To make good decisions, businesses try to gather good intelligence information. Yet managing and processing a large amount of unstructured information and data stand in the way of greater business knowledge. An effective business intelligence tool must be able to access quality information from a variety of sources in a variety of forms, and it must support people as they search for and analyze that information. The EBizPort system was designed to address information needs for the business/IT community. EBizPort’s collection-building process is designed to acquire credible, timely, and relevant information. The user interface provides access to collected and metasearched resources using innovative tools for summarization, categorization, and visualization. The effectiveness, efficiency, usability, and information quality of the EBizPort system were measured. EBizPort significantly outperformed Brint, a business search portal, in search effectiveness, information quality, user satisfaction, and usability. Users particularly liked EBizPort’s clean and user-friendly interface. Results from our evaluation study suggest that the visualization function added value to the search and...

Words: 14368 - Pages: 58

Free Essay

Tic Tac Case

... When first thinking about changing the packaging of Tic-Tac breath mints one must ask why? The Tic-Tac package is an icon, recognizable by pretty much everyone across not only the United States but North America, South America, and Europe. Think of the classic Seinfeld episode where Elaine gives her co-worker a package of Tic-Tacs so she can hear when he is sneaking up on her. As a brand you know that you have a top position when one of the most successful television shows of all-time bases an entire episode around your product and packaging. With such strong brand recognition and being so well known across the globe it might seem foolish to change the packaging for Tic-Tac Chill mints. However, it is necessary that certain changes be made to the new package design in order to successfully compete and keep up with today’s breath mint market. Since 1969, when Tic-Tac first came out, the breath mint market has changed drastically. Mints are now typically larger and have much stronger flavors than breath mints from twenty and thirty years ago. Packaging now is also much more flashy and eye-catching than the classic Tic-Tac packaging that has been used since first being started. Since the Chill mints are going to be a more modern breath mint with a larger size than the original Tic-Tac and have a more intense flavor they are going to be competing against breath mints like Ice Breakers and Altoids who both have very distinct and noticeable packaging. To keep up with......

Words: 985 - Pages: 4

Free Essay

Entreprise Tic Tac

...Président de Tic Tac Inc. Expéditeur : Cabinet Équipe 4 Object : Recommandation face à l’amélioration du système comptable Rapport à la direction Introduction Suite à l’analyse de la situation actuelle de l’entreprise Tic Tac inc., il semble évident qu’elle présente différentes lacunes quant à la présentation de ses coûts fixes. Le système comptable actuel attribut ces coûts de façon arbitraire entre les différents produits de l’entreprise. Cette situation fait en sorte que l’information présentée dans les états financiers ne représente pas une image fidèle de l’entreprise ce qui a un impact considérable sur les décisions prises par les gestionnaires. Le système comptable étant déficient et afin d’assurer la compétitivité de l’entreprise, il serait pertinent de procéder à une analyse des coûts fixes en les imputant par gammes de produit et cela en fonction des ressources nécessaires à chacun. Il serait aussi essentiel de procédé à une réévaluation du système de fixation des prix afin de permettre à la société Tic Tac inc. de rester concurrentiel dans son secteur. Pour remédier à cette situation, vous trouverez dans ce présent rapport une analyse de la situation actuelle accompagnée de la détermination des différents enjeux et de l’analyse des différentes options majeures. Finalement, une recommandation suivant vos objectifs stratégiques vous sera proposée. 1. Analyse de la situation actuelle 1.1 Mission et vision de l’entreprise L’entreprise Tic Tac......

Words: 3445 - Pages: 14

Free Essay

Tic Tac Oe

...Computer Programming Computer Programming TIC TAC TOE PROJECT TIC TAC TOE PROJECT Flor Garcia FINAL EXAM Flor Garcia FINAL EXAM 2015 2015 DEFINE THE PROBLEM: Write a Tic Tac Toe program that inputs the player’s names and then asks if you want to play again. It displays a score board at the end of the game. OUTLINE THE SOLUTION: INPUT | PROCESSING | OUTPUT | Name of Player 1 | Names of Both players is inputted | Score board of who won, lost or any draws | Name of Player 2 | Player 1 makes the first move by choosing a number in the box then [X] will replace the chosen number | | Numbers on each box | Player 2 makes the second move by choosing a number in the box then [O] will replace the chosen number | | | If either of the players win, they receive a point in the score board | | | If it is a draw, the score board will display it | | DEVELOP AN ALGORITHM: 1. Insert name of player 1 [X] 2. Insert name of player 2 [O] 3. Players choose the number of the box they want to input their letter in. 4. Once then choose the number they inputted their designated letter will replaced the number in the box 5. These steps are repeated as it is each player’s turn 6. The game will end until someone wins or it becomes a draw 7. The Score board will be displayed at the end TEST THE ALGORITHM: 1. Name of Player 1: Flor 2. Name of Player 2: Karla 3. Flor chooses number 3 and is replaced by [X] 4. Karla......

Words: 1048 - Pages: 5

Premium Essay

Tic Tac Toe Programming

...Introduction Tic-Tac-Toe is a popular simple game for two players all over the world. Traditionally one person plays for “X” while another plays for “O”. The game is played on the square board of 3x3 or even more size. The aim of this game for player is to win by filling with “X” or “O” any row, column or diagonal of the main game board. The game sets players thinking because players should reflect a little bit on strategy and predict some moves of the opponent. So it teaches people to make decisions quickly. MATLAB is computer software for technical computing from the MathWorks. Used for a wide variety of scientific and engineering calculations. The functions of the MATLAB are solving equations, plotting 2D, 3D graphs, calculating statistics, etc. The aim of the report is to describe how Tic-Tac-Toe game simulation was made with the help of MATLAB. The report describes how program reads the code and computer strategy for winning/not losing in the game. Theory. The aim the individual coursework was to program 4x4 Tic-Tac-Toe game for player and computer using MATLAB with condition that computer should always win or just not loose. Programming the game basic loops such as “while”, “for”, “if” were used, where “while” means to repeat smth until some particular conditions are holding, “for” means to do smth for particular conditions, and “if” means to do smth if some conditions are true. There also were used “sum” function which helps to count “X”-s or “O”-s in rows,......

Words: 3911 - Pages: 16

Free Essay

A Plague of Tics

...David Sedaris, the author of the essay " A Plague of Tics." His essay described his life as a long term sufferer of obsessive-compulsive disorder or OCD for short. He not only allows the audiences to take a look at his life, but also leads the readers to relate his struggles. Furthermore, because this is a true story about the author, it makes you feel more connected with the character being described. He is writing about himself so it is easy for him to develop the character.  In the essay, Sedaris mainly use irony, stereotypes and hyperbole to reel in his audience to make his life time full of tics and interesting. The first literary term is hyperbole. The sentences' Miss Chestnut said, " You're up and down like a flea. I turn my back...we don't leave our seats and lick things whenever we please" This is a use of hyperbole because it is exaggerated and undermined. Hyperbole was used throughout the essay when adults such as Miss Chestrut, Sedaris' mother and father.  Sedaris also uses many examples of irony throughout his essay. For example, the paragraph 12 in the essay that is considered the irony because all the author wanted to do was to be at peace in this house, but he couldn't have peace until he made his route absolutely perfect. All he wants is to be free, but he is not letting himself.  Stereotypes are littered throughout the essay. For example, the first use of a serotype is located in paragraph 11, Miss Chestnut is being stereotypical because she infers why Se......

Words: 293 - Pages: 2

Premium Essay

Tic Tac Memo

...steadily increased. According to, in 2003 sixty two percent of households used breath mints. In 2003, Tic Tac was the preferred choice of breath mints, but since then other mints have increased competition. Lifesavers were on Amazon's top list of best selling breath mints in 2014. One possible solution to become the best selling brand of breath mints is to redesign our packaging. This comes with obvious benefits and risks. First, in our consumer base's decision-making process, recognition is the most important thing. American society cultivates a world obsessed on looking and feeling good, and many people feel the need for fresh breath to feel good. Consumers also go through an information search when making any purchasing decision. Because breath mints are a convenience good, consumers of breath mints do very little information search. They grab what is affordable, recognizable and nearby. Once the consumer evaluates the alternatives, it is our goal to be in the consumer's evoked set. The major risk of changing the packaging is eliminating Tic Tac's from loyal consumers' evoked sets. Although Tic Tac's may be part of a consumer's evoked set, changing the packaging makes these mints harder to find in the in a quick shopping run because they are less recognizable. Beneficial Change On the other hand, there could be benefits if we commit to change Tic Tac's current packaging. By conducting exploratory research methods, such as focus groups and detailed......

Words: 464 - Pages: 2

Free Essay


...Tourette's syndrome is a neurological disorder, which involves involuntary body movements or Tics. There are two types of Tics, motor/physical and vocal. This paper will cover many aspects of Tourette's syndrome; including the history of the disease, the discovered of the disease, the genetics involved with the disorder, the diagnosis of the disease, and the effects of the disease on families. George Gils de la Tourette's a French doctor and biologist discovered Tourette's syndrome in 1885 (Landau 21). He was observing patients with unexplained repetitive movements and could not find any preexisting condition that would cause these symptoms. After extensive research he concluded that this disorder had not been documented before, so he named it Tourette's syndrome, after himself. Tourette’s syndrome is a neurological disorder; it is inherited from a parent’s dominant gene, causing different symptoms among different family members. It is not known on which chromosome the disease is located. There is a 50% chance that one will pass this trait on to his/her offspring with each pregnancy (Shimberg 64). There is no prenatal testing that can be done before a child is born to determine if the child has the disease. Unlike other genetic disorders or disease Tourette's is not in the blood. Therefore testing will not give any indication of whether or not a child will develop Tourette's. Cases of the disease show males are burden with the disease three to four times more often......

Words: 1057 - Pages: 5

Free Essay

Head to Toe Assessment

...Head to Toe Assessment DO IT! SAY IT! Gather Equipment Enter Room, wash hands 1. Good morning, my name is “Student” & I’m am going to be your student nurse today. How are you doing? 2. Pull Curtain closed * Can you tell me your name and date of birth (match it to the wrist band) * I have reviewed your health history and I see you have already changed to a gown, have you been able to provide a urine specimen? * I am going to do a head to toe assessment on you, this will assess your body systems and their functions During this assessment I am going to ask you some questions, inspect, touch, and listen with my stethoscope to different areas of your body. If you have any questions now or throughout the assessment, please feel free to ask questions and if at any time I make you feel uncomfortable, please let me know. Do you have any questions before we begin? Level of consciousness * Can you tell me where you are and why you are here? * Can you tell me what day it is? **Patient is alert & oriented x 4 to self, place, time, & situation Observe posture, body movements NV and V speech and expressions, mood, expressions **Body posture, speech, NV and verbal communication is appropriate for the situation. Based on conversation mood, feelings and expressions/perceptions are appropriate for this patient. Patient understands current situation at hand...

Words: 635 - Pages: 3

Premium Essay

Tic Toe

...|Projects|Programs|Portfolio| Definition|(ISO) A project is a unique process consisting of a set of co-ordinated and controlled activities with start and finish dates, undertaken to achieve an objective conforming to specific requirements including the constraints of time, cost and resources. (PMI) A temporary endeavor undertaken to create a unique product, service or result.|(PMI) A group of related projects managed in a coordinated way to obtain benefits and control not available from managing them individually. Programs may include elements of related work outside of the scope of discrete projects in the program.|(PMI) A collection of projects or programs and other work that are grouped together to facilitate effective management of that work to meet strategic business objectives. The projects or programs of the portfolio may not necessarily be interdependent or directly related. | Example|Integration of HR system with Oracle apps|IT Transformation program|NASA’s space program| Scope|Have defined objectives and scope is progressively elaborated during the project life cycle.|Wider scope compared to projects and more focused on the benefits|The scope is driven by the strategic business objective that the portfolio is created to address.| Success criteria|Success is measured by the product and project quality, timeliness, budget compliance, and degree of customer satisfaction.|Success is measured by the degree to which the program satisfies the needs and benefits...

Words: 400 - Pages: 2

Free Essay

Tics in Ele

...paraphrasing, they only copy and paste the information found without appropriate references, an act that can be called plagiarism. and limited accompaniment from the teachers can Technology allows teachers to establish a meaningful context for communicative activities and to engage students in authentic and realistic experiences that add excitement to the learning process Al respecto, hay quienes afirman que el uso de las TIC ayuda tanto a estudiantes como a profesores a estar en contacto con contextos reales de la lengua que se desea aprender, que aumenta el interés de los estudiantes para aprender, y que al usarla de forma adecuada se convierte en una gran y completa fuente de información. No obstante, también existen ciertas dusdas respecto al tema, como su costo, el tiempo que requiere aprender a hacer un buen uso de esta y si puede ésta convertirse en una herramienta que fomente la pereza y evite el ánimo investigativo de los estudiantes. Por lo tanto, es necesario conocer las dos posiciones, ventajas y desventajas del uso de las TICs en la enseñanza de la lengua extranjera. Technology allows teachers to establish a meaningful context for communicative activities and to engage students in authentic and realistic experiences that add excitement to the learning process Combination of different sound and pictures can improve receptive language skills or inspire classroom discussion, elicit target language from individual students. In summary, then, the......

Words: 1242 - Pages: 5

Free Essay

Comparación Tics Ecuador

...Comparación TICs Ecuador y otros países Las TICs son las Tecnologías de la Información y la Comunicación. Estas son herramientas básicas para el desarrollo de la información en un país y su velocidad, este concepto es un concepto dinámico, no paran de crecer ni desarrollarse. Durante los años los países ricos o desarrollados han invertido mucho en estas tecnologías, incrementando su velocidad de desarrollo y la brecha digital y social entre diferentes generaciones, las TIC no solo son una poderosa herramienta de desarrollo sino que a su vez miden el nivel de desarrollo, ocupando un lugar muy importante en la vida de las personas y el funcionamiento de las sociedades. La Unión Internacional de Telecomunicaciones (UIT) es una organización de las naciones unidas que maneja el tema de las TIC de la forma más completa; Esta organización publica informes sobre el desarrollo de las tecnologías de la información y la comunicación, para poder comparar entre países y llegar a un análisis que sea coherente con la realidad de cada uno, la UIT combinó 11 indicadores entre los que están: el acceso, la utilización y las aptitudes en este ámbito, gracias a esto se logró desarrollar el IDI como el índice de desarrollo de las TIC De todos los países analizados por la UIT sobre la base de las TIC, los diez que encabezan el ranking son: Suecia, República de Corea, Dinamarca, Países Bajos, Islandia, Noruega, Luxemburgo, Suiza, Finlandia y Reino Unido. Por otro lado, los países con menor......

Words: 845 - Pages: 4