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)
This project was built using these technologies.
- Ruby
- Rspec
- Rubocop
- VsCode
- Notepad++
You can see it working here
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/euqueme/tic-tac-toe.git
- Clone over SSH:
$ git clone ssh://git@github.com:euqueme/tic-tac-toe.git
- and execute bin/main.rb file
To run the test you need to cd into the tic-tac-toe diretory and run:
rspec spec/
- 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 will take the opposing sign by default (in other words, if you choose X, your friend will be O). Players take turns placing 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
👤 María Eugenia Quemé
- Twitter: @MaruKK
- Github: @euqueme
- Gmail: euqueme@gmail.com
👤 Santiago Guerra
- Twitter: @santi_gueam
- Github: @SantiagoGuerra
- Gmail: guerrasantiago19@gmail.com
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!