TicTacToe Game.
- About The Project
- Built With
- Getting Started With The Game i. How To Play The Game
- Contributing
- License
- Contact/Contributors i. Link To Project On Github
- Acknowledgements
The TicTacToe game (American English) is all about learning the concept of the minimax algorithm that is widely and successfully used across the fields like Artificial Intelligence, Economics, Game Theory, Statistics or even Philosophy.
The game also known as noughts and cross (British English) or Xs and Os is a paper and pencil game for two players, X and O, who take turns making the spaces in a 3 X 3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row wins the game.
The TicTacToe game is also played by two humans. It's board is a 3 X 3 grid and players alternate turns until one player is victorious or the game ends in a draw. Players win by securing three consecutive positions on a row, column, or diagonal. The game ends in a tie if neither player has won and all position on the board are taken.
Clone the repo and run the app
$ git clone git@github.com:KingsleyMcSimon/TicTacToe-Project.git
$ cd Tic_Tac_Toe-Project
$ ruby bin/main.rb
To play the game, just enter both player's names and choose "O" or "X" for player 1
Type a name for Player 1 (default = Player1)
Erik
Player 1's name set as 'Erik'
Type a name for Player 2 (default = Player2)
Kingsley
Player 2's name set as 'Kingsley'
Please select 'O' or 'X' for Erik. (Default = 'O')
X
Erik will be 'X'
Kingsley will be 'O'
From this point on, just enter current player's selection for the place you want in the grid.
1 | 2 | 3
---+---+---
4 | 5 | 6
---+---+---
7 | 8 | 9
Erik, please select a position
1
After you enter it, it will be displayed on screen and ask next player to make his/her choice.
X | 2 | 3
---+---+---
4 | 5 | 6
---+---+---
7 | 8 | 9
Kingsley, please select a position
This will continue until there is a winner or there is no more space left to play, in which case the game will end in a tie.
This game was built using the Ruby Language.
i. How To Play The Game
-
Draw the board - first, you draw the board which is made up of a 3 X 3 grid squares.
-
Have the first player go first - although traditionally, the first player goes with X, the first player can be allowed to go with either X or O.
-
Have the second player go second with his or her own symbol either X or O.
-
Keep alternating moves until one of the players has drawn a row of three symbols or until no one can win.
-
Keep practicing to become good at playing the game.
In this project, your contributions towards helping in improving this game is most welcomed. With that, our game will get better rating and give other programmers at any level the ability learn, be inspired and create better content.
After your contributions, you can:
i. Fork The project. ii. Create your feature branch using git checkout -b feature/anyfeature(for example) iii. Commit your changes following git commit -m 'Name it as it pleases you', when you are done, iv. Push to the branch you have created using git push origin feature/anyfeature and finally v. Open a pull request.
Distributed under the MIT Licence. See Licence for more informaton
Kingsley McSimon Ogbonna @KingsleyMcSimon and Roberto Eric Nava Martinez @Oitur
Link To Project On Github: https://github.com/KingsleyMcSimon/TicTacToe-Project