# notffej/machine-problem architecture

> Architecture diagram of the GitHub repository notffej/machine-problem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/notffej/machine-problem
- Repository: https://github.com/notffej/machine-problem

## Overview

The Verdict is a detective mystery game. In the graphical version, the player starts a case, examines crime-scene clues, interviews suspects, unlocks laboratory analysis, reviews findings in a notebook, and makes an accusation that determines the ending. The runtime is centered on a frame loop and screen dispatcher, with case content and reusable drawing helpers separated into their own modules. A separate text-based game and an upgraded text variant are also present. Evidence is limited to the README and sampled excerpts; unsampled implementation details are not assumed.

Main entry points: [`The Verdicts/src/game.c`](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c) (Screen Dispatcher), [`The Verdicts/src/main.c`](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/main.c) (Window Loop), [`The Verdicts/include/game.h`](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/game.h) (Game State Model), [`The Verdicts/src/ui.c`](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/ui.c) (Drawing Helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_main["Window Loop<br/>[main.c]"]
  node_game["Screen Dispatcher<br/>[game.c]"]
  node_model["Game State Model<br/>[game.h]"]
end

subgraph group_investigation["Investigation"]
  node_crime["Crime Scene<br/>[game.c]"]
  node_interviews["Suspect Interviews<br/>[game.c]"]
  node_laboratory["Laboratory Analysis<br/>[game.c]"]
  node_notebook["Detective Notebook<br/>[game.c]"]
  node_accusation["Accusation Ending<br/>[game.c]"]
end

subgraph group_content["Case Content"]
  node_case_data["Case Story Data<br/>[case_data.c]"]
  node_legacy["Text Game"]
  node_story_variant["Story Variant"]
end

subgraph group_presentation["Presentation"]
  node_ui["Drawing Helpers<br/>[ui.c]"]
  node_ui_api["UI Helper Declarations<br/>[ui.h]"]
  node_raylib["Raylib API<br/>[raylib.h]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_main
node_main -->|"runs each frame"| node_game
node_main -->|"initializes state"| node_model
node_game -->|"dispatches screen"| node_crime
node_game -->|"dispatches screen"| node_interviews
node_game -->|"dispatches screen"| node_laboratory
node_game -->|"dispatches screen"| node_notebook
node_game -->|"dispatches screen"| node_accusation
node_game -->|"reads and updates"| node_model
node_game -->|"uses drawing helpers"| node_ui
node_ui -->|"draws with"| node_raylib
node_case_data -->|"fills case state"| node_model
node_legacy -.->|"offers text play"| node_player
node_story_variant -.->|"offers story play"| node_player

click node_main "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/main.c"
click node_game "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_model "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/game.h"
click node_crime "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_interviews "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_laboratory "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_notebook "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_accusation "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c"
click node_case_data "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/case_data.c"
click node_legacy "https://github.com/notffej/machine-problem/blob/main/The%20Verdict%20Game%20Code-%20Calix.c"
click node_story_variant "https://github.com/notffej/machine-problem/blob/main/Upgraded%20The%20Verdict%20Game%20(w%20Story).c"
click node_ui "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/ui.c"
click node_ui_api "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/ui.h"
click node_raylib "https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/raylib.h"

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_main,node_game,node_model toneBlue
class node_crime,node_interviews,node_laboratory,node_notebook,node_accusation toneAmber
class node_case_data,node_legacy,node_story_variant toneMint
class node_ui,node_ui_api,node_raylib toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Window Loop](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/main.c): `The Verdicts/src/main.c`
- [Screen Dispatcher](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`
- [Game State Model](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/game.h): `The Verdicts/include/game.h`

### Investigation

- [Crime Scene](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`
- [Suspect Interviews](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`
- [Laboratory Analysis](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`
- [Detective Notebook](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`
- [Accusation Ending](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/game.c): `The Verdicts/src/game.c`

### Case Content

- [Case Story Data](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/case_data.c): `The Verdicts/src/case_data.c`
- [Text Game](https://github.com/notffej/machine-problem/blob/main/The%20Verdict%20Game%20Code-%20Calix.c): `The Verdict Game Code- Calix.c`
- [Story Variant](https://github.com/notffej/machine-problem/blob/main/Upgraded%20The%20Verdict%20Game%20(w%20Story).c): `Upgraded The Verdict Game (w Story).c`

### Presentation

- [Drawing Helpers](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/src/ui.c): `The Verdicts/src/ui.c`
- [UI Helper Declarations](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/ui.h): `The Verdicts/include/ui.h`
- [Raylib API](https://github.com/notffej/machine-problem/blob/main/The%20Verdicts/include/raylib.h): `The Verdicts/include/raylib.h`

### Other components

- **Player**

## Connections

- Player → Window Loop: starts game (evidence: `The Verdicts/src/main.c`)
- Window Loop → Screen Dispatcher: runs each frame (evidence: `The Verdicts/src/main.c`)
- Window Loop → Game State Model: initializes state (evidence: `The Verdicts/src/main.c`)
- Screen Dispatcher → Crime Scene: dispatches screen (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Suspect Interviews: dispatches screen (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Laboratory Analysis: dispatches screen (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Detective Notebook: dispatches screen (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Accusation Ending: dispatches screen (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Game State Model: reads and updates (evidence: `The Verdicts/src/game.c`)
- Screen Dispatcher → Drawing Helpers: uses drawing helpers (evidence: `The Verdicts/src/game.c`)
- Drawing Helpers → Raylib API: draws with (evidence: `The Verdicts/src/ui.c`)
- Case Story Data → Game State Model: fills case state (evidence: `The Verdicts/src/case_data.c`)
- Text Game → Player: offers text play
- Story Variant → Player: offers story play
