In this project, we collaboratively build a Tic Tac Toe game using the main concepts of Object-Oriented Programming. Particularly, classes and access to their attributes. In more details, there are 4 milestones in this project.
- The first Milestone: In this session, we setup the executable file running it through a directory path i.e ruby bin/main.rb. Also, we setup the linting files.
- The second Milestone: In this session, we mapped out the user-interface of the whole project. It describes briefly how the project will be played, the game loop and the implementation was done in one file (bin/main.rb) without classes.
- The third Milestone: This session contains the game-logic, the object-oriented programming paradigm was implemented in this milestone. We divided different methods into classes with the same attributes. There are 2 main files which contains the logic implemented i.e the bin and the lib file. The bin file contains the main.rb file where #puts and #gets methods are called and the other classes implemented in the lib file are required. The algorithm behind this game, is similar to how the game is played in real life
- There two players i.e X or O
- Run a loop where if either player X or O wins it displays the player that won
- Inside the same loop, if it's a draw it displays the result as well.
- Execute main.rb file from bin directory.
- Enter your names and symbols.
- Enter number from 1-9 according to game rules.
-
The game is played on a grid that's 3 squares by 3 squares.
-
You can choose from two symbols either 'X' or 'O', your friend will be automatically allocated to the remaining symbol. Players take turns putting their marks in empty squares.
-
The first player to get 3 of their marks in a row (up, down, across, or diagonally) is the winner.
-
When all 9 squares are full, the game is over. If no player has 3 marks in a row, the game ends in a draw.
- Ruby, VSCODE
To get a local copy up and running follow these simple example steps.
- Install ruby on linux
- Web browser
- Code editor
- Git and Github
- Clone the project to your local machine
- Execute main.rb file
- Okikiola Apelehin
- Mupa M'mbetsa Nzaphila
👤 Author1
- Github: @okikiola11
- Twitter: @Kikiolla3
- Linkedin: @okikiola-apelehin
👤 Author2
- Github: @mupa1
- Twitter: @mupa_mmbetsa
- Linkedin: mupa-mmbetsa
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.