About • Prerequisites • Rules • Getting Started • Gameplay Instructions • Contributing • Authors • License
This project contains a Tic-Tac-Toe game. Tic-tac-toe, noughts and crosses, or Xs and Os, is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. It is a solved game with a forced draw assuming best play from both players.
In order to play the game user should have ruby installed on the local machine
- The game is played on a grid that's 3 squares by 3 squares.
- You are X, your friend is O. Players take turns putting their marks in the labelled cells.
- The first player to get 3 of the marks in a row (up, down, across, or diagonally) is the winner.
- When all 9 cells are full, the game is over. If no player has 3 marks in a row, the game ends in a tie.
To get started you have to clone the repo on your local machine. To clone the repo run the following command in a terminal emulator:
git clone https://github.com/Lameck1/Tic-Tac-Toe
Alternatively, you can click on the Tic-Tac-Toe logo in the readme file and it will download the repo as a zip file
Now navigate to the bin directory using the following command
cd bin
Run the game by executing the main.rb file using the following command:
./main.rb
- After running the game, press any key to continue or 'q' to quit the game
- Enter the name of two players
- You will be presented the 3x3 tic-tac-toe grid in which each cell will be labelled with a number
- You can enter the cell number to make a move in the corresponding cell
👤 Anas Siddiqui
- GitHub: Anas Siddiqui
👤 Lameck Otieno
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
To add colors in the user-interface, we have used the ruby gem called colorize.
This project is MIT licensed.