Skip to content

In this work we intend to develop a program that allow to play this game.

Notifications You must be signed in to change notification settings

luigi043/Tic-Tac-Toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe

In this work we intend to develop a program that allow to play this game.

The game, which is known in Portugal as the Jogo do Galo, also known in English as Tic Tac Toe or in Brazil by tic-tac-toe, it's a well-known game and quite simple. In this work we intend to develop a program that allow to play this game. The game must have the following characteristics:

• It should start by presenting a simple menu which presents two options: 1 – NEW GAME the 2 - EXIT • When choosing the NEW GAME option, a message should appear on the screen. representation of the game board, with the game positions numbered from 1 to 9. • The first player must be asked to select a position and then switched the player. The player must alternate automatically until one of the players wins. or the game ends in a draw. • It should be clear on the screen which player is playing. • Each time the player chooses a position, the game board must be changed to reflect the play. • The game must ensure that the player cannot choose a position already chosen, either by itself, as by the opponent. • At each move, the game must analyze whether any of the players has won or if there are no more moves and the game ended in a draw. • When the game is over, you must return to the initial menu. • IMPORTANT: The program must be developed using only the concepts acquired so far in the discipline. • The following images show an example of the Game presentation. These images are merely illustrative and the game may be visually different, as long as they comply with the defined requirements.

To reduce the number of ties, it is intended to create a new game action that allows players to players cannot play every round. In this way, add a step in the game where, before choosing the position, the player has to choose between 0 and 1. This value is compared with a value generated by the Math.random function between 0 and 1. If the player gets the value right, he can play, if he doesn't get it right, the turn passes to the other player.

Create a new game mode where the player plays against the computer. For this, a function must be developed that analyzes the game board and chooses the move depending on your status. Functions that manage to win a game are valued, or that, at least, manage to draw.

About

In this work we intend to develop a program that allow to play this game.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages