This is the development in Ruby language of the classical game (aka noughts and crosses) in which two players take turns to place their marks ( 0 or X ) in the available positions of a 3 x 3 board. The first player who achieves to place three of their marks in a horizontal, vertical, or diagonal row is the winner.
This is the development in Ruby language of the classical game (aka noughts and crosses)
in which two players take turns to place their marks ( 0 or X ) in the available positions
of a 3 x 3 board. The first player who achieves to place three of their marks in a horizontal,
vertical, or diagonal line is the winner.
Play it online here
To get a local copy of this repository up and running, follow these steps:
You must have Ruby installed on your computer
This is a two-player game in which every participant has a mark, either X or 0.
The final goal is to place three his/her marks on a 3 x 3 board in a vertical,
horizontal, or diagonal line.
After typing the player’s names, the first turn will be for the player with the X’s
and then, the game will prompt alternating between the two players asking for the
position in the board in which the player wants to place his/her mark.
Each player can choose only one position on the board per movement, so he/she must
pick the more convenient position in order to achieve the goal to position three of
his/her marks in line.
Sometimes, the player must use his/her turn for placing a mark that blocks the opponent’s
path to win. In such a case, the board is likely to be full without any of the participants
winning. If that situation arises, the game will end in a draw.
For running the automated tests type rspec spec/tictactoe_spec.rb in the root
directory of the project
👤 Carlos Santamaría
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a 🌟 if you like this project!
This work is released under the CC0 license