In this project I created a Tic Tac Toe game using Ruby.
- Ruby.
- Rainbow gem
-
The game is played on a grid that's 3 squares by 3 squares.
-
One of the player is X and the second player is O. Players take turns putting their marks in the squares.
-
The player who succeeds in placing three of their marks in a diagonal, horizontal, or vertical row is the winner.
-
When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a draw.
These are the game instructions:
- The board contains 9 boxes each box has its nubmer from 1 to 9.
- The player one will have X sign.
- The player two will have O sign.
- Each player has to select a number on the board between 1 and 9. The number automatically will change to the sign of the player (X or O).
- If the player select a number outside the range or a position is already taken, the game will show that the player need to select another number.
- The player who succeeds in placing three of their marks in a diagonal, horizontal, or vertical row is the winner.
- When all 9 squares are full, the game is over. If no player has success condition, the game ends in a draw.
- To run this project locally, please ensure you have Ruby installed on your machine, then clone this repository by running.
git clone https://github.com/Wusinho/Tic-Tac-Toe
- After cloning open the file and go to bin directory then open the terminal and write in terminal :
ruby main.rb
-
Maximize your terminal window for a better experience.
-
Enjoy the game!
👤 Ahmed Amin
- Github: @AhmedAmin90
- Twitter: @AhmedAmin12383
- LinkedIn: AhmedAmin
Give a ⭐️ if you like this project!
- Microverse
This project is MIT licensed.