/ruby-tic-tac-toe

This is the ruby implementation of the game tic tac toe

Primary LanguageRuby

Tic Tac Toe OOP build with Ruby (Object Oriented Programming)

*image

This project has four milestones

  • Project setup
  • User interface
  • Game logic
  • Instruction for players

Game Rule:

Tic Tac Toe is Cool Math Games: Xs and Os is a paper-and-pencil game for two players, X, O:

  • Players take turns filing the spaces in 3X3 grid.
  • The player who succeeds in placing three of their marks in the horizontal, vertical, or diagonal or wins the game.

the following example game is won by the first player, X: example

Instructions

Run bundle within this lab's directory before getting started.

Project Structure

├── Gemfile
├── Gemfile.lock
├── README.md
├── bin
│   └── main.rb
├── lib
│   └── player.rb
└── spec
    ├── 01_tic_tac_toe_spec.rb
    ├── 02_play_spec.rb
    ├── 03_cli_spec.rb
    └── spec_helper.rb

How to Run the Game

  • clone the repository from here : (https://github.com/sinework/ruby-tic-tac-toe.git)

  • Open your git bash and clone the repo.

  • go to the diroctory of the file and run ruby "main.rb" or "main"

  • Good job you are now playing Tic-Tac-Toe game. 👌🙌

How to play the game

  • Player one enters the name (Names should not be the same and not a number)
  • Player two does the same.
  • Choose a position from 1-9 from the game board. (Already taken positions cannot be selected.)
  • The player who filled first the consecutive row, column or diagonal will be a winner.
  • If all the positions are filled equally, the game will be declared a draw.
  • To cancel the game in the middle of it, hit CTRL + C on the keyboard.

Authors:

👤 Amine

👤 Sinework

Contributions, issues and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Microverse
  • GitHub
  • Theodinproject.com