We built a tic-tac-toe game on the command line where two human players can play against each other and the board is displayed in between turns. It was made as a collaborative project in Ruby using OOP concepts.
The game collects input from the users and replaces the board positions based on the user inputs with their individual characters. To win the game, a player has to have 3 of their characters in a row (vertically, horizontally or diagonally).
Ruby
To get a local copy up and running follow these simple example steps.
Clone the project unto your local machine cd to the folder and run bin/main.rb
on your terminal
-
The game is played on a grid that's 3 squares by 3 squares.
-
Input your name by pressing "P" or join as a guest by pressing "Enter"
-
Player1's character is "X" and Player2's character is "O"
-
Players take turns putting their characters in empty squares.
-
The first player to get 3 of their characters in a row (vertically, horizontally or diagonally) is the winner.
-
When all 9 squares are full, the game is over. If no player has 3 characters in a row, the game ends in a tie.
-
You can restart the game if you wish to!
- Get ruby latest version installed
- Install VSCode or any code editor you like
- Install Node JS and nmp(most recents versions)
๐ค Osong Agberndifor
- Github: @githubhandle
- Twitter: @twitterhandle
- Linkedin: linkedin
๐ค Grace Tamara Ekunola
- Github: @Temmarie
- Twitter: @TemmarieW
- Linkedin: Grace Tife Ekunola
Contributions, issues and feature requests are welcome! Feel free to check the Issues page.
- Hat tip to Microverse
Give a โญ๏ธ if you like this project!
Enjoy!