This is the third project of the Microverse ruby course and we have to develop a simple tic-tac-toe game using OOP concept.
.
- Open the git from the directory in which you want to install the game.
- Download all the related files using command 'git clone https://github.com/sumancrest0001/tic-tac-toe.git'
- After that, Navigate to the ruby-tic-tac-toe folder.
- Run a command 'bin/main.rb'
- You can enjoy the game.
If you are familiar with the game then you can just enjoy the game. But if you have not played the game before then you can follow the instructions below and can play immediately.
- At most, only two players can play the game at a time.
- The board is of 3x3 grid and contains nine cells.
- Each player mark one cell at a time.
- Both the players mark their cell alternatively until the game ends.
- No one is allowed to mark the cell which is already marked.
- There are two possible ways to end the game.
- One is when one player wins the game or when the game is a draw.
- If one player is able to mark all the cells of a single row, column or diagonal
- Then that player wins the game.
- The game will be draw if no one wins the game and all the cells are marked out.
- First of all, one player chooses a mark (X or O). It will automatically assign remaining mark to another player.
- Player1, always starts the game and choose a mark.
- Next, Player2 chooses a mark from the remaining cells.
- If players try to choose already marked cells then it will show warning to the player and have to choose again.
- This process will continue till the game is end.
- You can play the game again by pressing "Y" and end the game with "N".
- It won't accept other than "Y" and "N".
sumancrest0001 (https://github.com/sumancrest0001)
MIT licensed.