The TicTacToe game is a popular game, commonly know as notts and crosses where players take turn to mark 'Xs' and 'Os' on a 3 * 3 grid.
This whole TicTacToe game is built in Ruby. The main intent for building it was to demonstrate an understanding of Object Oriented Programming(OOP) in Ruby. It consists of the following:
- A
Player
class that's reponsible for the creation of player objects that will be utilized within the program. - A
GameBoard
class that has various methods such as one to check if the move made is a valid move, another to check if the board is filled and another to check for the winner. - It also has a
main.rb
file that's responsible for user interaction.
-Ruby
To play the game, you need the following installed:
- Ruby
- Git
To get a local copy up and running follow these simple example steps:e reposito
- Clone/Download the repository using
git clone https://github.com/KelynPNjeri/TicTacToe.git
- Navigate to the folder to which you cloned the game and change directory into the
TicTacToe
directory. - Run
bundle install
to get all the gems required for the project.
If you have followed the instructions above then to run do the following to have a pleasant gaming experience:
-
To run the game, open your command line and type,
ruby bin/main.rb
to start the game. You will be met by an interactive shell requesting you and your fellow gamer for your names, kindly enter them. -
Once you've entered your names, you would then be prompted to enter your moves. The number you enter should be similar to the unmarked spaces on your board. NB: The move has to be an Integer.
Rules
- The move entered should be an integer.
- Do not attempt to enter a move that is already marked by either an " X " or an " O " since it is an invalid move.
- We are currently working on the tests. However if you'd like to run tests:
- Run
bundle install
to get all the gems required for the project. - From within the project directory, run
rspec
. This run all the testcases.
👤 Kelyn Paul Njeri
- Github: @KelynPNjeri
- Twitter: @KelynNjeri
- Linkedin: Kelyn Njeri
👤 Juan Jacobo Hincapie Montes
- Gmail: @gmail
- Github: @githubhandle
- Twitter: @twitterhandle
- Linkedin: linkedin
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
- Microverse
- Team Ocicats
This project is unlicensed.