ivanid22 / tic-tac-toe-temp

A command-line implementation of the game Tic-Tac-Toe. Built on Ruby.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic-Tac-Toe

This a ruby implementation of the game Tic-Tac-Toe.

Rules

This is a two-player game. Each player takes turns making placing a token on the board until there's a winner or a draw match. Each player is going to place their token on the selected cell, and if they manage to get their token three times in a continuous line, they win the match. Each cell can only be selected once per match, you can't overwrite a previously taken cell. If the board is full before there's a winner, the match is considered a draw.

How to play

When you start the game, it's going to ask the names of the players, and immediately after, a match will start. You can play as many matches as you want in a single game, and the game is going to keep track of the score.

Making a move

Each cell in the board is represented by a number, as shown in the figure below. To make a move, you just enter the number of the cell you want to place your token on.

|1|2|3|
|4|5|6|
|7|8|9|

You can't choose a cell that's not displayed in the figure, that will result in the game displaying a warning and asking you for a proper move.

Ending the game

If you want to stop playing, just enter 'n' when asked if you want to keep playing at the end of the match.

How to run the game

First of all, you need to have the game files in your computer. You can get them by cloning this repository. On the command line, navigate to the game directory. Once there, there's two ways to run the game

  • Run the game directly from the executable file, using the command ./bin/main.rb
  • Pass the main.rb file to the ruby interpreter, using the command ruby bin/main.rb

Requirements

  • Ruby > 2.5

Built With

  • Ruby

Author

👤 Ivan Diaz

👤 Diego Antonio Reyes Coronado

🤝 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!

About

A command-line implementation of the game Tic-Tac-Toe. Built on Ruby.


Languages

Language:Ruby 100.0%