/tic-tac-toe-game

Build 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

Primary LanguageRuby

Tic-tac-toe-game

Built 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.

Table of Contents

About Game

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 is the winner.

Game rules

  1. The game is played on a grid that's 3 squares by 3 squares.

initial_board

  1. You are X, your opponent is O. Players take turns putting their marks in numbered squares.

  2. The first player to get 3 of their marks in a row (up, down, across, or diagonally) is the winner.

winning_board

  1. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a tie.

Getting Started

  1. Download repo or clone the repo to your computer https://github.com/rna/tic-tac-toe-game.git

2. Run the file in the terminal ```bin/main.rb``` 3. Enter each player name by its turn 4. Game starts once enter your names 5. As per the game rules, the first player will get `X ` and other player will get `O`. 6. Players will take turns until the game concludes. 7. You can start the game again or you can exit by selecting the required option. 8. The player's marks (Xs and Os) will change once you restart the game. 9. Happy gaming!!

Built With

  • Ruby

Authors

Acknowledgments