This project is to build a Tic Tac Toe game which can be played on the command line. Two human players can play against each other and the board is displayed in between turns. We built this project following some requirements:
- The main.rb file should be responsible for user interaction, and this is the only place where puts/print and get.chomp can be used
- Comply with DRY rule
- Set the permission for reading and writing with attr_accessor, attr_reader properly to Classes
- Include the validation for user's inputs to correspond to unpredictable behavior from players
- About the Project
- Built With
- Live Demo
- Getting Started
- About Tic Tac Toe
- How to Play
- Contributing
- Authors
- Acknowlegments
- Show your support
- License
- Rspec
Live demo
To get a local copy up and running follow these simple example steps.
- On the project GitHub page, navigate to the main page of the repository.
- Under the repository name, locate and click on a green button named
Code
. - Copy the project URL as displayed.
- If you're running the Windows Operating System, open your command prompt. On Linux, Open your terminal.
- Change the current working directory to the location where you want the cloned directory to be made. Leave as it is if the current location is where you want the project to be.
- Type git clone, and then paste the URL you copied in Step 3.
e.g. $ git clone https://github.com/yourUsername/yourProjectName - Press Enter. Your local copy will be created.
- Go into the folder you cloned in this step 7 on your terminal e.g. $ cd Desktop/Tic-Tac-Toe-Game
- Type
bin/main.rb
to run the code, and then the game starts!
Tic Tac Toe is a simple game for 2 players, ● and ■. It is played on a 3x3 grid. Players take turns placing their Mark, ● or ■, on an open square in the grid. The first player to take 3 grids vertically, horizontallyor diagonally will be the winner. If all 9 squares are filled and neither player can take 3 grids, the game will be draw.
- To start the game, input any key
- Enter the player's names
- Take a look at the board
- Input the number from 1 to 9 to get the position where you want to take
- Taking turns to play the game with step 3 and 4
- If either player take 3 grids vertically, horizontally or diagonally first, the player is the winner
- If neither player can take 3 grids until the board is filled with players' symbols, the game is in tie
- If you want to play again, enter any key, otherwise, enter 'q' to quit the game
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
👤 Delice Lydia
- Github: @DeliceLydia
- Twitter: @IngabireLydia3
- Linkedin: Delice Lydia
👤 Yoko Saka
Special Thanks to the Odin Project
Give a ⭐️ if you like this project!
This project is MIT licensed.