Project 1: Tic Tac Toe;
A tic-tac-toe game on the command line where two human players can play against each other and the board is displayed in between turns.
- An Odin Project required to program in OOP (Object-Oriented Programming).
Tic-tac-toe (American English), noughts and crosses (British English), 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 wins the game.
The following example game is won by the first player, X:
git clone
the repository andcd tic-tac-toe\
folder, typeruby ./bin/main.rb
to start.
- Start entering the name of player one and player two.
- Player one will start the first move as the command line prompt. (Enter number from (1 ~ 9)).
- A game board will be printed to show where the move has been made.
- Player two will be prompted to input his next move (Enter number from (1 ~ 9)).
- A game board will be printed to show where the move has been made.
- Game will continue until one of the players win or there is a draw.
- When the game is over, players will be asked if they want to play again.