Implementation of tic tack toe game as outlined here by the Odin Project.
How to open the tic-tac-toe game
Tic-tac-toe (American English), noughts and crosses (British English), or Xs and Os is a paper-and-pencil game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. Read more on wikipedia...
This project is the implementation of that tic-tac-toe, which is run on CLI (Command Line Interface), anyone can play it.
Game Board | Winning Board |
---|---|
- Ruby
This game can be played on two platforms:
B. Online
- You should have Ruby installed on your computer.
- Your computer should be able to run
terminal
orcommand prompt
orbash
orPowershell
commands.
- Click here and download the zip file of this game
- Unzip the downloaded file to the folder of your choice
- Open terminal inside the unzipped folder
- Run the following command to start the game:
bin/main.rb
- At that point you should see the game starting and follow the rules of the game.
- Run this command
git clone https://github.com/RNtaate/tic-tac-toe.git
to clone the repository to your local computer - Run
cd tic-tac-toe
to go inside the game's folder - Run the following command to start the game:
bin/main.rb
- At that point you should see the game starting and follow the rules of the game.
- click on one of the following links descholar's link or Roy's link
- When the link has been opened, click the
green run button
you will see at the top, and follow the game instructions to play.
Note: Whenever you terminate the game before you start it again, remember to clear your terminal by running this command
clear
- When the game is opened, it shows all of the instructions and asks you if you want to continue, you are supposed to enter
y
if you want to continue, otherwise enter any other key to terminate the game. - When you select to continue, the game will ask you names for
Player 1
andPlayer 2
. - After that it will start to show any player turn using the names you have just entered
- The very first player, will be assigned
X
as their mark which will be displayed on the board in accordance with the position they played / selected - The second player, will be assigned
O
as their mark which will be displayed on the board in accordance with the position they played / selected - The board is made of nine positions which are numbered, if you enter a number, the number of that position will be replaced with your mark, and it won't be available for being played until
game win
orgame draw
- When your mark is aligned horizontally, or vertically, or diagonally, that will be a
game win
- When all of the positions have been played, without a
game win
, that will be agame draw
- At the end of every
game win
orgame draw
, the game will ask if you want to play another round, you are supposed to entery
if you want to continue, otherwise enter any other key to terminate the game. - The valid numbers to play are between
1 - 9
, if you play something other than that such as word, or letter, or a number above of 9 or below 1 such as zero or negative, or an already played position, the game will show a warning message and it asks you to enter another one which is valid
There are two ways of contributing to this project:
-
If you see something wrong or not working, please check the issue tracker section, if that problem you met is not in already opened issues then open the issue by clicking on
new issue
button. -
If you have a solution to that, and you are willing to work on it, follow the below steps to contribute:
- Fork this repository
- Clone it on your local computer by running
git clone https://github.com/your-username/tic-tac-toe.git
Replace your username with the username you use on github - Open the cloned repository which appears as a folder on your local computer with your favorite code editor
- Create a separate branch off the master branch,
- Write your codes which fix the issue you found
- Commit and push the branch you created
- Raise a pull request, comparing your new created branch with our original master branch here
👤 Mugirase Emmanuel
- Github: @descholar-ceo
- Twitter: @descholar3
- Linkedin: MUGIRASE Emmanuel
👤 Roy Ntaate
- Github: @RNtaate
- Twitter: @RNtaate
- Linkedin: roy-ntaate
Give a ⭐️ if you like this project!
This project is MIT licensed.