Tic Tac Toe

Status Github Issues GitHub2 Pull Requests License


πŸ“ Content

About   |    Installing   |    Built with   |    Authors

🧐 About

This project is meant for learning and implementing object oriented programming principles in Ruby.

Screenshot

πŸ”§ Built with

πŸ›  Installing

Clone and run this repository by running these commands on the terminal:

- git clone https://github.com/luciano-ilha/Tic-Tac-Toe;
- cd bin/
- Run ruby main

Game rules

  • There are only 2 players.
  • The board has 9 empty cells
  • There are 2 pieces of tokens β€” X and O
  • Players take turns playing by entering their token into empty cells.
  • The first player to get 3 of his/her tokens in a row (up, down, across, or diagonally) is the winner.
  • The game ends in a draw if all 9 cells are occupied and there is no winner.

How do we play Tic Tac Toe

  • Players take turns playing.
  • 1st turn β€” Player 1
  • Player 1 places their token (X) in only 1 square of their choice (it has to be between 1 and 9, can't be letters, negative numbers, or a position already taken by the other player).
  • 2nd turn β€” Player 2.
  • Player 2 places their token (O) in only 1 square of their choice, except they can’t touch the square that Player 1’s token already fills.
  • 3rd turn- Player 1 …. and the cycle continue until a player wins or there’s a tie game.
  • There are 8 winning combinations: Top row, Middle row, Bottom row, Left column, Middle column, Right column, Left diagonal, and Right diagonal.
  • There’s a draw/tie when the entire board is filled with X’s and O’s but no winning combinations can be found.

βœ’οΈ Authors

πŸ‘€ Luciano Ilha

πŸ‘€ Paul Ogolla

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

πŸ“ Acknowledgements

  • Microverse and The Odin Project

πŸ“ License

This project is free to use as learning purposes. For any external content (e.g. logo, images, ...), please contact the proper author and check their license of use.