This game is build with Ruby to be played in the command terminal
In order to win the game, a player must place three of their marks in a horizontal, vertical, or diagonal row.
The following example game is played by player Fred [X] and player Mih [O]: The game is won by Fred [X].
Read more about Tic-Tac-Toe game at Wikipedia
To run this game, you need ruby installed in your environment. Run the following command:
$ ruby -v
You should have a result similar to this:
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
If you don't get that result, follow this link and install Ruby in your local environment.
To get a local copy up and running follow these simple example steps in your terminal.
git clone https://github.com/FrederickMih/tic-tac-toe-game
cd tic-tac-toe-game
bin/main.rb
- To start the game, type
bin/main.rb
- Enter the player's names
- Input the number from 1 to 9 to get the position where you want to take
- Taking turns to play the game with step 3 and 4
- If either player take 3 grids vertically, horizontally or diagonally first, the player is the winner
- If neither player can take 3 grids until the board is filled with players' symbols, the game is a draw
- If you want to play again, type
yes
, otherwise, typeno
to quit the game
- Install ruby gem rspec
- Go to terminal and run 'rspec'
- If you don't find all the test cases go to spec file by 'cd spec'
- Now run rspec
- Find the examples
- Tests executed sucessfully
👤 Mih Frederick Mih
- GitHub: @FrederickMih
- Twitter: @MihFrederick
- LinkedIn: LinkedIn
👤 PRABHAKAR PANDEY
- Github: @Prabhakarzx
- Twitter: @Prabhakarzx
- Linkedin: @Prabhakarzx
Contributions, issues, and feature requests are welcome!
Give a ⭐️ if you like this project!
Copyright 2020 Mih Frederick Ngum
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.