Skip to content

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

Notifications You must be signed in to change notification settings

rna/tic-tac-toe-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Download repo or clone the repo to your computer https://github.com/rna/tic-tac-toe-game.git
  • Run the file in the terminal bin/main.rb
  • Enter each player name by its turn
  • Game starts once enter your names
  • As per the game rules, the first player will get X and other player will get O.
  • Players will take turns until the game concludes.- You can start the game again or you can exit by selecting the required option.
  • The player's marks (Xs and Os) will change once you restart the game.
  • Happy gaming!!

Built With

  • Ruby

Run tests

    rpsec --format documentation

Authors

Acknowledgments

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages