# leonardozhang67-cloud/minesweeper-sigma-2026-2027 architecture

> Architecture diagram of the GitHub repository leonardozhang67-cloud/minesweeper-sigma-2026-2027, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027
- Repository: https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027

## Overview

This repository is a Tkinter two-player Minesweeper game. Players enter names and choose preset or custom board settings, then take alternating turns revealing or flagging cells on one shared board. The game ensures the first reveal is safe, updates scores, and displays the winner or a tie when all safe cells are open. The graph follows the documented workflow and relationships visible in the supplied excerpts; the separate `minesweeper.py` implementation is not part of the README-described application flow.

Main entry points: [`game_flow.py`](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_flow.py) (Game Flow), [`menu_screen.py`](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/menu_screen.py) (Main Menu), [`board.py`](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/board.py) (Shared Board), [`input_validator.py`](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/input_validator.py) (Input Validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Game Setup"]
  node_menu["Main Menu<br/>[menu_screen.py]"]
  node_settings_form["Settings Form<br/>[settings_form.py]"]
  node_difficulty["Difficulty Presets<br/>[difficulty.py]"]
  node_input_validator["Input Validation<br/>[input_validator.py]"]
  node_board_limits["Board Limits<br/>[board_limits.py]"]
  node_game_settings["Game Settings<br/>[game_settings.py]"]
end

subgraph group_gameplay["Game Rules"]
  node_game_flow["Game Flow<br/>[game_flow.py]"]
  node_board["Shared Board<br/>[board.py]"]
  node_cell["Cell Logic<br/>[cell.py]"]
  node_player["Player Scores<br/>[Player.py]"]
end

subgraph group_presentation["Game UI"]
  node_app_entry["App Entry<br/>[main.py]"]
  node_status_panel["Turn Status<br/>[Player.py]"]
  node_result_screen["Results Screen<br/>[game_flow.py]"]
end

node_player_user(("Players"))

node_player_user -->|"enters settings"| node_menu
node_app_entry -->|"starts"| node_game_flow
node_game_flow -->|"shows"| node_menu
node_menu -->|"validates names"| node_input_validator
node_menu -->|"collects settings"| node_settings_form
node_settings_form -->|"loads presets"| node_difficulty
node_settings_form -->|"validates custom"| node_input_validator
node_difficulty -->|"creates presets"| node_game_settings
node_input_validator -->|"checks limits"| node_board_limits
node_input_validator -->|"creates custom"| node_game_settings
node_menu -->|"starts game"| node_game_flow
node_game_flow -->|"builds board"| node_board
node_board -->|"creates cells"| node_cell
node_player_user -->|"reveals or flags"| node_board
node_cell -->|"reports reveal"| node_board
node_board -->|"forwards result"| node_game_flow
node_game_flow -->|"updates score"| node_player
node_game_flow -->|"updates turn"| node_status_panel
node_status_panel -->|"displays scores"| node_player
node_game_flow -->|"shows outcome"| node_result_screen
node_result_screen -->|"reads scores"| node_player

click node_app_entry "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/main.py"
click node_game_flow "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_flow.py"
click node_menu "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/menu_screen.py"
click node_settings_form "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/settings_form.py"
click node_difficulty "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/difficulty.py"
click node_input_validator "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/input_validator.py"
click node_board_limits "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/board_limits.py"
click node_game_settings "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_settings.py"
click node_board "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/board.py"
click node_cell "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/cell.py"
click node_player "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/Player.py"
click node_status_panel "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/Player.py"
click node_result_screen "https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_flow.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu,node_settings_form,node_difficulty,node_input_validator,node_board_limits,node_game_settings toneBlue
class node_game_flow,node_board,node_cell,node_player toneAmber
class node_app_entry,node_status_panel,node_result_screen toneMint
class node_player_user toneIndigo
```

## Components

### Game Setup

- [Main Menu](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/menu_screen.py): `menu_screen.py`
- [Settings Form](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/settings_form.py): `settings_form.py`
- [Difficulty Presets](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/difficulty.py): `difficulty.py`
- [Input Validation](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/input_validator.py): `input_validator.py`
- [Board Limits](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/board_limits.py): `board_limits.py`
- [Game Settings](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_settings.py): `game_settings.py`

### Game Rules

- [Game Flow](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_flow.py): `game_flow.py`
- [Shared Board](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/board.py): `board.py`
- [Cell Logic](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/cell.py): `cell.py`
- [Player Scores](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/Player.py): `Player.py`

### Game UI

- [App Entry](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/main.py): `main.py`
- [Turn Status](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/Player.py): `Player.py`
- [Results Screen](https://github.com/leonardozhang67-cloud/minesweeper-sigma-2026-2027/blob/main/game_flow.py): `game_flow.py`

### Other components

- **Players**

## Connections

- Players → Main Menu: enters settings (evidence: `README.md`)
- App Entry → Game Flow: starts (evidence: `main.py`)
- Game Flow → Main Menu: shows (evidence: `game_flow.py`)
- Main Menu → Input Validation: validates names (evidence: `menu_screen.py`)
- Main Menu → Settings Form: collects settings (evidence: `menu_screen.py`)
- Settings Form → Difficulty Presets: loads presets (evidence: `settings_form.py`)
- Settings Form → Input Validation: validates custom (evidence: `settings_form.py`)
- Difficulty Presets → Game Settings: creates presets (evidence: `difficulty.py`)
- Input Validation → Board Limits: checks limits (evidence: `input_validator.py`)
- Input Validation → Game Settings: creates custom (evidence: `input_validator.py`)
- Main Menu → Game Flow: starts game (evidence: `menu_screen.py`)
- Game Flow → Shared Board: builds board (evidence: `game_flow.py`)
- Shared Board → Cell Logic: creates cells (evidence: `board.py`)
- Players → Shared Board: reveals or flags (evidence: `README.md`)
- Cell Logic → Shared Board: reports reveal (evidence: `cell.py`)
- Shared Board → Game Flow: forwards result (evidence: `board.py`)
- Game Flow → Player Scores: updates score (evidence: `game_flow.py`)
- Game Flow → Turn Status: updates turn (evidence: `game_flow.py`)
- Turn Status → Player Scores: displays scores (evidence: `Player.py`)
- Game Flow → Results Screen: shows outcome (evidence: `game_flow.py`)
- Results Screen → Player Scores: reads scores (evidence: `game_flow.py`)
