# prototype9111/wargames-joshua architecture

> Architecture diagram of the GitHub repository prototype9111/wargames-joshua, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prototype9111/wargames-joshua
- Repository: https://github.com/prototype9111/wargames-joshua

## Overview

Joshua is a desktop recreation of the WOPR strategy terminal. A user enters commands in the SFML terminal; the application submits them to the SFML-independent JoshuaCore, which returns dialogue or game/simulation output for animated display. The principal domain paths are command/dialogue, tic-tac-toe with minimax, and timed offline war simulation. The interface also provides command history, status indicators, screenshots, and CRT post-processing. Some implementation excerpts are partial; optional wiring beyond documented calls is omitted.

Main entry points: [`src/Application.cpp`](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp) (Window and Input), [`src/JoshuaCore.cpp`](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp) (JoshuaCore Dispatcher), [`src/main.cpp`](https://github.com/prototype9111/wargames-joshua/blob/main/src/main.cpp) (Application Entry), [`assets/shaders/crt.frag`](https://github.com/prototype9111/wargames-joshua/blob/main/assets/shaders/crt.frag) (CRT Post-Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal Interface"]
  node_entry["Application Entry<br/>[main.cpp]"]
  node_ui["Window and Input<br/>[Application.cpp]"]
  node_history["Command History<br/>[Application.cpp]"]
  node_output["Animated Output<br/>[Application.cpp]"]
  node_terminal["Terminal Renderer<br/>[Application.cpp]"]
  node_indicators["Status Indicators<br/>[Application.cpp]"]
  node_screenshot["Screenshot Capture<br/>[Application.cpp]"]
end

subgraph group_core["Joshua Simulation Core"]
  node_core["JoshuaCore Dispatcher<br/>[JoshuaCore.cpp]"]
  node_commands["Dialogue and Commands<br/>[JoshuaCore.cpp]"]
  node_ttt["Tic-Tac-Toe<br/>[JoshuaCore.cpp]"]
  node_minimax["Minimax Opponent<br/>[JoshuaCore.cpp]"]
  node_war["War Simulation<br/>[JoshuaCore.cpp]"]
end

subgraph group_assets["Display Assets"]
  node_crt["CRT Post-Processing<br/>[crt.frag]"]
  node_font["VT323 Font"]
end

node_user(("Terminal User"))

node_user -->|"enters commands"| node_ui
node_entry -->|"starts"| node_ui
node_ui -->|"records input"| node_history
node_ui -->|"submits commands"| node_core
node_ui -->|"updates simulation"| node_core
node_core -->|"dispatches terminal mode"| node_commands
node_core -->|"dispatches game mode"| node_ttt
node_core -->|"dispatches simulation mode"| node_war
node_ttt -->|"chooses AI move"| node_minimax
node_core -->|"returns results"| node_ui
node_ui -->|"queues responses"| node_output
node_output -->|"draws text"| node_terminal
node_terminal -->|"renders status"| node_indicators
node_terminal -.->|"applies shader"| node_crt
node_terminal -->|"renders text"| node_font
node_ui -->|"captures display"| node_screenshot

click node_entry "https://github.com/prototype9111/wargames-joshua/blob/main/src/main.cpp"
click node_ui "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_history "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_output "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_terminal "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_indicators "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_screenshot "https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp"
click node_core "https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp"
click node_commands "https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp"
click node_ttt "https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp"
click node_minimax "https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp"
click node_war "https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp"
click node_crt "https://github.com/prototype9111/wargames-joshua/blob/main/assets/shaders/crt.frag"
click node_font "https://github.com/prototype9111/wargames-joshua/tree/main/assets/fonts"

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_entry,node_ui,node_history,node_output,node_terminal,node_indicators,node_screenshot,node_user toneBlue
class node_core,node_commands,node_ttt,node_minimax,node_war toneAmber
class node_crt,node_font toneMint
```

## Components

### Terminal Interface

- [Application Entry](https://github.com/prototype9111/wargames-joshua/blob/main/src/main.cpp): `src/main.cpp`
- [Window and Input](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`
- [Command History](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`
- [Animated Output](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`
- [Terminal Renderer](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`
- [Status Indicators](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`
- [Screenshot Capture](https://github.com/prototype9111/wargames-joshua/blob/main/src/Application.cpp): `src/Application.cpp`

### Joshua Simulation Core

- [JoshuaCore Dispatcher](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp): `src/JoshuaCore.cpp`
- [Dialogue and Commands](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp): `src/JoshuaCore.cpp`
- [Tic-Tac-Toe](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp): `src/JoshuaCore.cpp`
- [Minimax Opponent](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp): `src/JoshuaCore.cpp`
- [War Simulation](https://github.com/prototype9111/wargames-joshua/blob/main/src/JoshuaCore.cpp): `src/JoshuaCore.cpp`

### Display Assets

- [CRT Post-Processing](https://github.com/prototype9111/wargames-joshua/blob/main/assets/shaders/crt.frag): `assets/shaders/crt.frag`
- [VT323 Font](https://github.com/prototype9111/wargames-joshua/tree/main/assets/fonts): `assets/fonts`

### Other components

- **Terminal User**

## Connections

- Terminal User → Window and Input: enters commands
- Application Entry → Window and Input: starts
- Window and Input → Command History: records input
- Window and Input → JoshuaCore Dispatcher: submits commands
- Window and Input → JoshuaCore Dispatcher: updates simulation
- JoshuaCore Dispatcher → Dialogue and Commands: dispatches terminal mode
- JoshuaCore Dispatcher → Tic-Tac-Toe: dispatches game mode
- JoshuaCore Dispatcher → War Simulation: dispatches simulation mode
- Tic-Tac-Toe → Minimax Opponent: chooses AI move
- JoshuaCore Dispatcher → Window and Input: returns results
- Window and Input → Animated Output: queues responses
- Animated Output → Terminal Renderer: draws text
- Terminal Renderer → Status Indicators: renders status
- Terminal Renderer → CRT Post-Processing: applies shader
- Terminal Renderer → VT323 Font: renders text
- Window and Input → Screenshot Capture: captures display
