Three-Trios

Three-Trios image 1
Three-Trios image 2
Three-Trios image 3

Problem

We were tasked with designing a strategic, turn-based board game that followed strict object-oriented design principles. The goal was to implement a game system that supported both human and AI players while making design decisions that prioritized scalability, modularity, and clean separation of concerns. This included designing extensible strategies, ensuring testability, and supporting future UI integration.

Solution

A partner and I built Three Trios, a turn-based board game in Java using the Model-View-Controller (MVC) architecture. The game supports both human and AI players, including multiple strategies such as maximizing flips and prioritizing board positioning. The game logic is modular and extensible, allowing additional strategies and game rules to be added easily. I implemented a graphical user interface for intuitive gameplay and created a suite of unit tests to ensure robust logic and state transitions. We later successfully adapted a classmate’s View code to work with our Model and Controller, reaffirming the modularity and decoupling of our design.

Skills Gained

  • Object-Oriented Design – Applied MVC architecture to cleanly separate logic, control flow, and presentation
  • Adapter Pattern – Bridged classmates GUI interactions with our controller/model
  • Data Modeling – Designed ICard, IModel, and board abstractions for scalable game state management
  • Strategy Pattern – Implemented modular AI strategies such as FlipTheMostStrategy and CornerStrategy
  • Interface Design – Created both mutable and read-only interfaces to enforce encapsulation and safe access
  • Test-Driven Development – Wrote unit tests to validate move logic, score calculation, and flip propagation
  • Recursive Algorithms – Built a directional flip calculation system that propagated effects across the board