/ruby-milestone-setup

A game in which two players take turns putting circles and crosses on a 3x3 grid and try to get three of the same symbols following the game rules. Built with Ruby.

Primary LanguageRubyMIT LicenseMIT

OOP (Object Oriented Programming)

Tic Tac Toe Game

A game in which two players take turns putting circles and crosses on a 3x3 grid and try to get three of the same symbols following the game rules.

In order to organize the code it was used different files, one for the game logic, another one for the player information, and the main file to get the user's input and provide an output when a player wins or it has a draw game. All movements for both players are displayed inside a (3X3) grid.

screenshot

Built With

  • Ruby

Getting started

In order to run the project locally follow all steps below:

Install git following the instructions available at Git

Clone the repository typing the command below on your preferred terminal

git clone https://github.com/marcelomaidden/ruby-milestone-setup

After you have cloned the repository, enter the directory typing

cd ruby-milestone-setup

Install ruby following the instructions available at Ruby

Then run the command below

ruby bin/main.rb

Rules for TIC-TAC-TOE

  1. The game is played on a grid that's 3 squares by 3 squares.

  2. You are X, your friend is O. Players take turns putting their marks in empty (nil) squares.

  3. The first player to get 3 of her marks in a row (up, down, across, or diagonally) is the winner.

  4. When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a tie.

Live Demo

Live Demo Link

Author

Marcelo Araújo

Acknowledgements

  • Ruby creators

Contributing

Contributions, issues, and feature requests are welcome!

Show your support

Give a ⭐️ if you like this project!

License

This project is MIT licensed.