Skip to content

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.

Notifications You must be signed in to change notification settings

okikiola11/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

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.

screenshot

Game Instructions

  • Execute main.rb file from bin directory.
  • Enter your names and symbols.
  • Enter number from 1-9 according to game rules.

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.

Built With

  • Ruby, VSCODE

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • Install ruby on linux
  • Web browser
  • Code editor
  • Git and Github

Usage

  • Clone the project to your local machine
  • Execute main.rb file

Authors

  • Okikiola Apelehin
  • Mupa M'mbetsa Nzaphila

👤 Author1

👤 Author2

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

Acknowledgments

  • Google

📝 License

This project is MIT licensed.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages