This project is part of the Microverse Ruby curriculum!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
This is the fifth project of the Microverse Ruby Section
This is also the first project of the Odin project (Ruby Project Programing: OOP)
If you want to install and play the game you need:
- ruby installed in your computer
- download or clone this repo
- Clone over HTTPS:
$ git clone https://github.com/SantiagoGuerra/tic-tac-toe.git
- Clone over SSH:
$ git clone ssh://git@github.com:SantiagoGuerra/tic-tac-toe.git
- and execute bin/main.rb file
- The game is played on a grid that's 3 squares by 3 squares.
1 | 2 | 3
- + - + -
4 | 5 | 6
- + - + -
7 | 8 | 9
- You can either be X or O, your friend would be the one you don't choose by default (if you choose X your friend will be O). Players take turns putting their marks in empty squares.
Your turn
X | 2 | 3
- + - + -
4 | 5 | 6
- + - + -
7 | 8 | 9
Your friends' turn
X | 2 | 3
- + - + -
4 | O | 6
- + - + -
7 | 8 | 9
- The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.
Winning combinations (W is equal to X or O)
W | W | W 1 | 2 | 3 1 | 2 | 3 W | 2 | 3 1 | W | 3 1 | 2 | W W | 2 | 3 1 | 2 | W
- + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + -
4 | 5 | 6 W | W | W 4 | 5 | 6 W | 5 | 6 4 | W | 6 4 | 5 | W 4 | W | 6 4 | W | 6
- + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + - - + - + -
7 | 8 | 9 7 | 8 | 9 W | W | W W | 8 | 9 7 | W | 9 7 | 8 | W 7 | 8 | W W | 8 | 9
- When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends and nobody wins
for example: nobody wins
X | X | O
- + - + -
O | O | X
- + - + -
X | O | O
This project was built using these technologies.
- Ruby
- Rubocop
- VsCode
- Notepad++
You can see it working here
Santiago Guerra - @santi_gueam - @SantiagoGuerra - guerrasantiago19@gmail.com
María Eugenia Quemé - @MaruKK - @euqueme - euqueme@gmail.com
Project Link: [https://github.com/SantiagoGuerra/tic-tac-toe)