TicTacToe
Screenshot
Built With
- Ruby
- Linters
- OOP
Getting Started
First, ensure that you have ruby installed on your local machine. To get a local copy up and running follow these simple example steps.
Prerequisites
Ruby installed on your local machine. Code editor (like VSCode) Terminal or similar to execute the program.
Install
Download a copy of the TicTacToe repository
- Direct to the main branch of the repository
- Click on "Code"
- Select the option to clone. HTTPS or SSH
- Copy the link
- Direct yourself to the main folder where you wish to clone the repository
- Open the terminal in this path.
- In the terminal, place: git clone [repository HTTPS or SSH link] (Don't close the terminal)
- Note: The repository should now be cloned and present in your folder
- In the terminal, direct yourself to the Ruby-TicTacToe folder. You can use: cd Ruby-TicTacToe
Usage
- To play the game, open the terminal and direct yourself to the main folder root of TicTacToe. (AS SHOWN ABOVE ON STEP 9)
- Once you are in the main root file, to run the program, enter in the terminal the command: ruby bin/main.rb
- Follow the game instructions
Instructions
Once the game has started
- The first player places their name
- The first player needs to select a symbol from X or O
- The second player needs to enter their name
- Symbol for the second player is assigned automatically
- Game starts - Makes player1 choose a section and place his symbol (1-9)
- If the number you entered is already taken, you will be forced to choose again.
- Player 2 will now select a space in the board to place the symbol (the same rules apply as step 6)
- Players need to obtain a winning combo using their symbol (CHECK BELOW FOR WINNING COMBOS)
- If none of the players can get a winning combo, the game will simply draw with no winners.
- The game will prompt you to play once again: press "ok". Or to end the game: press "no"
- Enjoy
Board:
|1| |2| |3|
|4| |5| |6|
|7| |8| |9|
Winning combos:
1
|X| |X| |X|
|4| |5| |6|
|7| |8| |9|
2
|1| |2| |3|
|X| |X| |X|
|7| |8| |9|
3
|1| |2| |3|
|4| |5| |6|
|X| |X| |X|
4
|X| |2| |3|
|X| |5| |6|
|X| |8| |9|
5
|1| |X| |3|
|4| |X| |6|
|7| |X| |9|
6
|1| |2| |X|
|4| |5| |X|
|7| |8| |X|
7
|1| |2| |X|
|4| |X| |6|
|X| |8| |9|
8
|X| |2| |3|
|4| |X| |6|
|7| |8| |X|
Authors
- GitHub: @sergiocortessat
- Twitter: @sergiocortessat
- GitHub: @arikarim
- Twitter: @Ari71549490
๐ค Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Show your support
Give a
Acknowledgments
- Hat tip to anyone whose code was used
- Inspiration
- etc
๐ License
This project is MIT licensed.