tic-tac-toe
tic-tac-toe copied to clipboard
A two-player, text-based game where the players take turns marking the spaces in a 3×3 grid with the letters 'X' or 'O'.
tic-tac-toe
Ruby implementation of tic tac toe
This project was developed as a learning project part of the Microverse curriculum.
A Ruby implementation of Tic Tac Toe. In three steps we added the basic setup, the user interface and finally the logic behind the game. We used OOP to implement the game logic.
Built With
- Ruby
Getting Started
To get a local copy up and running follow these simple example steps.
Prerequisites
Ruby installed locally
Install
- [Download](Clone the repository to your machine)
$ git clone https://github.com/meronokbay/tic-tac-toe
-
Navigate to the project folder and execute the "bin/main.rb" file.
-
Type in bin/main.rb in the terminal.
Usage
- Find a friend to play with and run the program.
- Input both of your names and the program will select one of you to start.
- The selected player will be asked to input a number from 1 to 9 - each representing one field in the tic tac toe 3x3 grid.
- Afterwards the other player will select the next field which will be marked by another symbol.
- Selecting a field previously selected by anyone or inputting something besides an integer from 1 to 9 will not be accepted.
- You will keep alternating until a winner is declared or the game ends in a draw.
- First one to fill out a line with his three of his own symbols horizontally, vertically or diagonally wins!
Testing
To test this code download RSpec, access the repository using the terminal, write rspec and execute.
Authors
👤 Marco Erhardt
- Github: @marcode95
👤 Meron Ogbai
- Github: @meronokbay
- Twitter: @MeronDev
- Linkedin: Meron Ogbai
🤝 Contributing
Contributions, issues and feature requests are welcome!
Show your support
Give a ⭐️ if you like this project!
Acknowledgments
- Microverse for showing the way for this project to happen