A Two-Player, Turn-Based Tetris Implementation in C++20
The source code for this project is private.
This project was developed as part of a curriculum requirement at the University of Waterloo. In accordance with Policy 71 (Student Discipline), the source code cannot be publicly shared to prevent plagiarism.
If you are a recruiter or interviewer interested in reviewing the code, please contact me directly, and I can provide a private walkthrough or demonstration.
Biquadris is a complex, two-player spin on the classic Tetris game. It features two independent boards where players compete simultaneously. Special effects and "attacks" are triggered when players clear multiple rows, adding a competitive layer to the traditional gameplay.
The project was built using modern C++ (C++20), utilizing experimental modules for code organization. It supports both a text-based interface and a graphical interface using X11.
- Modern C++20 Modules: Leveraged the latest C++ standards for modular architecture.
- Design Patterns: Heavily utilized OOP design patterns including:
- Observer Pattern: To decouple the game state (Subject) from the text and graphical displays (Observers).
- Decorator Pattern: To apply temporary special effects (Blind, Heavy, Force) to the game board dynamically.
- Factory/Strategy Pattern: To manage different difficulty levels and block generation algorithms.
- X11 Graphics: Implemented a custom windowing system for real-time game rendering.
- RAII: Strict resource management (memory, file handles, X11 displays) using RAII idioms and smart pointers.
- Dual-Board Multiplayer: Two players alternate moves on separate boards.
- Special Actions: Clearing 2+ rows triggers effects on the opponent:
blind: Hides a portion of the opponent's board.heavy: Increases the gravity/weight of the opponent's blocks.force: Forces a specific block type on the opponent.
- Level System: 5 difficulty levels (0-4) with increasing speeds and complex block generation rules.
- Command Interpreter: Supports command aliases, multipliers (e.g.,
3left), and macro sequences.
The system is designed with high cohesion and low coupling in mind. The core game logic is separated from the presentation layer, allowing for easy swapping of display mechanisms (Text vs. Graphics).
The UML diagram above illustrates the relationships between the central Game Controller, the Board entities, and the various Observers and Decorators.
Copyright © 2025. All rights reserved.

