RamiSJ12 / tic-tac-toe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run on Repl.it

Tic-Tac-Toe

The famous game: Tic-Tac-Toe

Tic-Tac-Toe is one of the most famous games in the world. We have implemented it using only Ruby. You can choose your names and play against each other. We tried to make it easy to follow the table by colorizing the numbers, "x" and "o". Don't let him/her beat you πŸ˜‰

Built With

  • Ruby
  • Object Oriented Programming

Live Demo

Live Demo Link

Getting Started

You need 2 players to play the game!

To get a local copy:

  • Run this command in your teminal git clone https://github.com/edxco/tic-tac-toe/.
  • Then run this one cd tic-tac-toe
  • Then to start playing run this bin/main.rb

Prerequisites

  • Ruby installed on your machine

Setup

Clone or download the source code, and run it in your teminal.

Game instructions

Start the game by running this code in your teminal bin/main.rb.

You start the game by entering your names, then the computer will randomly choose one of you to choose his sign. You can only choose "x" or "o". After choosing your signs, the first player will choose from 1-9 to put his sign in that index as shown in below image:

screenshot

Once the first player choose an index, that index will be changed to his sign as shown below:

screenshot

Then it's other player turn. The second player now should choose his sign in order not to allow the first player to win.

Win cases

  • Diagonally: When you have your signs aligned diagonally

screenshot

  • Column: When you have your signs in just one column

screenshot

  • Row: When you have your signs in a single row.

screenshot

Run tests

You can use Rubocop to test the code. In case Rubocop is not installed on your machine, enter this command to install it gem install rubocop. You may be required to run the terminal as an administrator. Once Rubocop is installed, you simply run rubocop in the terminal to test the code.

Authors

πŸ‘€ Martin Najjar

πŸ‘€ Eduardo Baeza

🀝 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
  • The Odin Project
  • Tic-Tac-Toe logic

πŸ“ License

This project is MIT licensed.

About

License:MIT License


Languages

Language:Ruby 100.0%