Advanced Tic-Tac-Toe

Project Conducted in the OOP and Data Structure Class


C++ MFC

The goal of this project is to develop an Advanced Tic-Tac-Toe game. It is required to design appropriate classes and should use two or more data structures.

IntroIntroIntro
UI of the Application

I designed the classes as follows:

  • Card holds a shape and number.
  • Player holds one or more Cards.
  • Slot holds one or more Cards and can accept additional Cards based on certain conditions.
  • Board holds one or more Slots and can check if a bingo is made.
  • Dealer creates unique Cards.
  • Game initializes other classes and updates the state of the game.

To enable getting a random Card from Player, Card was managed as a Linked-List. As Board needs to search for a bingo in a topology composed of Slot, Slot were managed as a Graph Dealer holds randomly generated unique numbers in a Queue. Since the combination of the shape and number of Card should be unique and only one instance should exist in a single session of the game, Dealer is designed to be the only instance that can instantiate Card as a std::unique_ptr.

As an additional feature, I implemented the funtion to save and load the state of the game as JSON. The loading feature includes a logic to verify the validity of the state of the game.