STAGE 2-2
PROTOTYPE

Minesweeper

Role Gameplay & UI Programmer
Timeline 2025
Platform Unity 2D (URP) · PC
Team Size 1 (Solo)
UnityC#Algorithms (BFS)Unity UIMVC PatternTextMeshPro
STAGE 2-2 // GAMEPLAY MINESWEEPER Unity C# Algorithms (BFS) Unity UI MVC Pattern TextMeshPro SYSTEM_INIT: OK | MEMORY: ALLOCATED | RENDERING: ONLINE

Mission Brief

Build a clean, from-scratch Minesweeper implementation in Unity that scales from 9x9 Easy grids to 24x30 Expert grids on any screen resolution without per-level layout hardcoding or recursive stack-overflow risk.

Key Systems Engineered

Strict Model/View Split (Cell.cs vs. Tile.cs)

Cell is a pure C# class (not a MonoBehaviour) holding Row, Column, IsMine, AdjacentMines, IsFlagged, and IsRevealed, exposing an Action OnStateChanged event. The Unity Tile view component subscribes in Initialize() and updates visuals strictly on state-change events without frame polling.

Iterative BFS Flood-Fill & O(1) HashSet Mine Placement (TileManager.cs)

Generates unique mine indices using a HashSet<int> for O(1) duplicate avoidance, and reveals connected zero-adjacency regions via an iterative Breadth-First Search (Queue<Tuple<int,int>> + explicit visited matrix) rather than recursion.

Live Canvas Resolution Grid Auto-Scaler

Computes optimal square tile dimensions at runtime from actual canvas pixel width/height minus fixed padding (10px/side), border (8px/side), and inter-tile spacing (5px) across all 4 tiers: Easy (9x9, 10 mines), Medium (16x16, 40 mines), Hard (16x30, 99 mines), and Expert (24x30, 180 mines).

Implementation Details

Architecture & Deep Dive

Minesweeper uses a strict MVC separation where Cell (model) is a pure C# class and Tile (view) is a Unity MonoBehaviour that subscribes to state change events. This eliminates frame-polling and keeps game logic testable independently of Unity.

The flood-fill algorithm uses an iterative BFS with an explicit queue and visited matrix, avoiding recursive stack overflow on large boards. Mine placement uses a HashSet for O(1) duplicate detection.

Select Player Class

Your class determines which skills and projects are highlighted throughout the site.

Achievements (0/11)

Press Start
Skipped or clicked through the boot sequence.
Class Act
Selected a Player Class to customize project ordering.
Efficient
Opened the 60-second Recruiter Mode summary.
Level Up
Opened your first engineering project Case File.
Completionist
Cleared all 12 project Case Files.
Coin Collector
Found and collected all 7 hidden coins across the site.
Old School
Entered the Konami Code or activated Arcade Mode.
Snake Charmer
Scored 10 or more points in the 404 Game Over Snake mini-game.
Hello, World
Copied the contact email address to your clipboard.
Curious
Opened the Keyboard Controls (?) overlay.
Bonus Round
Entered the hidden Bonus Stage development lab.

System Settings

Theme
Motion
Audio
Sound Effects
Advanced
Keyboard Shortcuts
Show Hidden Coins
Arcade Mode (CRT)

Keyboard Shortcuts

Navigate Sections
1 2 3 4
Open Achievements
A
Open Settings
S
Toggle Audio
M
Close Modal
Esc
Konami Code
↑ ↑ ↓ ↓ ← → ← → B A