Tic-Tac-Toe
Tic-Tac-Toe is one of the most famous games in the world. We have implemented it using only Ruby.
- Ruby
- Object Oriented Programming
- Ruby must be installed on your machine.
- Text Editor
- Open Terminal.
- Navigate to your desired location to download the contents of this repository.
- Copy and paste the following code into the Terminal:
git clone https://github.com/guillainbisimwa/tic-tac-toe-game.git
- Run
cd tic-tac-toe-game
- Run
ruby bin/main.rb
- The game is played on a grid that's 3 squares by 3 squares.
- You are
x
, your friend iso
. Players take turns putting their marks in empty squares. - The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
- 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.
(1) (2) (3) (4) (5)
+---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+
| 1 | 2 | 3 | | o | x | o | | 1 | o | o | | x | o | x | | x | o | o |
+---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+
| 4 | 5 | 6 | | 4 | o | x | | x | x | x | | x | o | 6 | | o | x | x |
+---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+
| 7 | 8 | 9 | | x | x | o | | o | o | x | | x | o | o | | x | o | o |
+---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+ +---+---+---+
- (1) Default Game Board
- (2) Diagonal win for o
- (3) Horizontal win for x
- (4) Vertical win for x
- (5) Draw
- You need to have the RSpec installed in you computer if you don't have it follow the steps.
Boot up your terminal and punch in gem install rspec to install RSpec. Once that’s done, you can verify your version of RSpec with rspec --version, which will output the current version of each of the packaged gems. Take a minute also to hit rspec --help and look through the various options available.
- cd into the project and open a terminal.
- In the teminal just write rspec to run the tests.
👤 Guillain Bisimwa
- Github: @guillainbisimwa
- Twitter: @gullain_bisimwa
- Linkedin: Guillain bisimwa
👤 Kingsley Ibeh
- Github: @githubhandle
- Twitter: @twitterhandle
- Linkedin: linkedin
👤 Brian Sammit Cruz Rodriguez
- Github: @BrianSammit
- Twitter: @CruzSammit
- Linkedin: Brian Sammit
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.