This is a Tic-Tac-Toe game built using OOP in Ruby.
- Tic-tac-toe - Wikipedia
Tic-tac-toe (American English), noughts and crosses (Commonwealth English), or Xs and Os/“X’y O’sies” (Ireland), 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. It is a solved game with a forced draw assuming best play from both players.
- Ruby
- VS code
- Linters (RuboCop)
To get a local copy up and running follow these simple example steps.
- On the project GitHub page, navigate to the main page of the repository this page.
- Under the repository name, locate and click on a green button named
Code
. - Copy the project URL as displayed.
- If you're running Windows Operating System, open your command prompt. On Linux, Open your terminal.
- Change the current working directory to the location where you want the cloned directory to be made. Leave as it is if the current location is where you want the project to be.
- Type
git clone
, and then paste the URL you copied in Step 3.
$ git clone https://github.com/SarvarKh/Tic-Tac-Toe-with_Ruby
Press Enter key - Press Enter. Your local copy will be created.
Please Note that you must have Git installed on your PC, this can be done here.
- Find someone to play with.
- As the file is executed the game will ask you to first input Player X name. The same will be repeated for player O.
- Player X will be prompted to enter a number from 1-9 representing a field in the tic-tac-toe grid(3x3), once the player obliges, his symbol will be marked in his selected spot.
- Player O will be asked to repeat as above.
- The game will keep alternating players until a win or draw is achieved.
- To win the game, a player must fill out a line with his symbol vertically, horizontally, or diagonally.
- A draw is reached when neither player manages the above and the grid is filled.
- Follow Getting Started section to download the game
- Open/navigate to the project directory in your terminal
- Run rspec in your terminal to see if the test cases passes your RSpec test You shall see number of test cases and number of failures.
- Open the link Introduction to RSpec if you want to learn more about RSpec.
👤 Sarvar Khalimov
- GitHub: @githubhandle
- Twitter: @twitterhandle
- LinkedIn: LinkedIn
👤 Oluwadare Juwon
- 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
This project is MIT licensed.