imran5644 / Tic-Tac-Toe

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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic Tac Toe

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.

A command line game built in ruby

screenshot

Built With

  • Ruby
  • Rubocop
  • RSpec

Getting Started

  • Should have ruby installed

Prerequisites

  • Ruby v2.7
  • bundler gem installed

Setup

  • Clone the git repo
  • run bundle install in root directory.

Usage

  • Open the terminal
  • cd into the program folder
  • run ./bin/main.rb
  • Players should enter their names
  • A grid box will be displayed so the first player can pick a cell to start the game
  • Players will select one cell on each turn until the game is over
  • Players cannot select an ocupied cell

Rules

  • It is a two players Game
  • The game is played on a grid box that's 3 squares by 3 squares
  • Each player has a "X" or "O" Token
  • once a player get 3 marks on a row he/she is the winner
  • If all 9 cells are occupied but none of the players got 3 marks in a row is a draft

Run tests

To run tests you need to have RSpec installed

gem install rspec

Go into the project's root directory and execute RSpec to run the tests

rspec

Authors

👤 Imran Yousaf

🤝 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

📝 License

This project is MIT licensed.

About

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.

License:MIT License


Languages

Language:Ruby 100.0%