Skip to content

SarvarKh/Tic-Tac-Toe-with_Ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe-with_Ruby

This is a Tic-Tac-Toe game built using OOP in Ruby.

screenshot

What is the Tic-Tac-Toe game

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.

Built With

  • Ruby
  • VS code
  • Linters (RuboCop)

Getting Started

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.

Gameplay Instructions

  1. Find someone to play with.
  2. As the file is executed the game will ask you to first input Player X name. The same will be repeated for player O.
  3. 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.
  4. Player O will be asked to repeat as above.
  5. The game will keep alternating players until a win or draw is achieved.
  6. To win the game, a player must fill out a line with his symbol vertically, horizontally, or diagonally.
  7. A draw is reached when neither player manages the above and the grid is filled.

How to run test?

  1. Follow Getting Started section to download the game
  2. Open/navigate to the project directory in your terminal
  3. 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.
  4. Open the link Introduction to RSpec if you want to learn more about RSpec.

Authors

👤 Sarvar Khalimov

👤 Oluwadare Juwon

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

  • Microverse

📝 License

This project is MIT licensed.

About

This is a Tic-Tac-Toe game built using OOP in Ruby.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages