# dwatkin-dev/set08801 architecture

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

- Interactive diagram: https://gitdiagram.com/dwatkin-dev/set08801
- Repository: https://github.com/dwatkin-dev/set08801

## Overview

CodeQuest is a browser-based interactive debugging game. The player explores room pages, manages health and inventory, obtains a patch, defeats Wumpus.exe, and reaches the Web Core ending. The sampled JavaScript supports the game-state and encounter relationships shown; HTML page wiring and room-by-room mechanics were not sampled, so those links are left unspecified.

Main entry points: [`JS/core.js`](https://github.com/dwatkin-dev/set08801/blob/main/JS/core.js) (Game state logic), [`JS/patch.js`](https://github.com/dwatkin-dev/set08801/blob/main/JS/patch.js) (Patch pickup), [`JS/zap.js`](https://github.com/dwatkin-dev/set08801/blob/main/JS/zap.js) (Damage event), [`JS/loop.js`](https://github.com/dwatkin-dev/set08801/blob/main/JS/loop.js) (Health loss event)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Game pages"]
  node_entry["Game entry<br/>[index.htm]"]
  node_rooms["Labyrinth rooms"]
  node_roomui["Room interface<br/>[room_template.htm]"]
end

subgraph group_gameplay["Gameplay events"]
  node_patch["Patch pickup<br/>[patch.js]"]
  node_damage["Damage event<br/>[zap.js]"]
  node_healthloss["Health loss event<br/>[loop.js]"]
  node_healthrestore["Health restore event<br/>[cache.js]"]
  node_wumpus["Wumpus encounter<br/>[wumpus.js]"]
end

subgraph group_state["Game state"]
  node_corejs["Game state logic<br/>[core.js]"]
  node_storage[("Session state")]
end

subgraph group_ending["Game ending"]
  node_webcore["Web Core ending<br/>[webCore.js]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_entry
node_player -->|"explores"| node_rooms
node_patch -->|"reads and updates inventory"| node_corejs
node_damage -->|"reads and updates health"| node_corejs
node_healthloss -->|"sets health"| node_corejs
node_healthrestore -->|"sets health"| node_corejs
node_wumpus -->|"reads inventory; updates health and defeat state"| node_corejs
node_webcore -->|"reads defeat state"| node_corejs
node_corejs -->|"reads and writes"| node_storage
node_corejs -->|"updates status and game-over display"| node_roomui

click node_entry "https://github.com/dwatkin-dev/set08801/blob/main/index.htm"
click node_rooms "https://github.com/dwatkin-dev/set08801/tree/main/rooms"
click node_corejs "https://github.com/dwatkin-dev/set08801/blob/main/JS/core.js"
click node_roomui "https://github.com/dwatkin-dev/set08801/blob/main/rooms/room_template.htm"
click node_patch "https://github.com/dwatkin-dev/set08801/blob/main/JS/patch.js"
click node_damage "https://github.com/dwatkin-dev/set08801/blob/main/JS/zap.js"
click node_healthloss "https://github.com/dwatkin-dev/set08801/blob/main/JS/loop.js"
click node_healthrestore "https://github.com/dwatkin-dev/set08801/blob/main/JS/cache.js"
click node_wumpus "https://github.com/dwatkin-dev/set08801/blob/main/JS/wumpus.js"
click node_webcore "https://github.com/dwatkin-dev/set08801/blob/main/JS/webCore.js"

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_rooms,node_roomui toneBlue
class node_patch,node_damage,node_healthloss,node_healthrestore,node_wumpus toneAmber
class node_corejs,node_storage toneMint
class node_webcore toneRose
class node_player toneIndigo
```

## Components

### Game pages

- [Game entry](https://github.com/dwatkin-dev/set08801/blob/main/index.htm): `index.htm`
- [Labyrinth rooms](https://github.com/dwatkin-dev/set08801/tree/main/rooms): `rooms`
- [Room interface](https://github.com/dwatkin-dev/set08801/blob/main/rooms/room_template.htm): `rooms/room_template.htm`

### Gameplay events

- [Patch pickup](https://github.com/dwatkin-dev/set08801/blob/main/JS/patch.js): `JS/patch.js`
- [Damage event](https://github.com/dwatkin-dev/set08801/blob/main/JS/zap.js): `JS/zap.js`
- [Health loss event](https://github.com/dwatkin-dev/set08801/blob/main/JS/loop.js): `JS/loop.js`
- [Health restore event](https://github.com/dwatkin-dev/set08801/blob/main/JS/cache.js): `JS/cache.js`
- [Wumpus encounter](https://github.com/dwatkin-dev/set08801/blob/main/JS/wumpus.js): `JS/wumpus.js`

### Game state

- [Game state logic](https://github.com/dwatkin-dev/set08801/blob/main/JS/core.js): `JS/core.js`
- **Session state**

### Game ending

- [Web Core ending](https://github.com/dwatkin-dev/set08801/blob/main/JS/webCore.js): `JS/webCore.js`

### Other components

- **Player**

## Connections

- Player → Game entry: starts game
- Player → Labyrinth rooms: explores
- Patch pickup → Game state logic: reads and updates inventory
- Damage event → Game state logic: reads and updates health
- Health loss event → Game state logic: sets health
- Health restore event → Game state logic: sets health
- Wumpus encounter → Game state logic: reads inventory; updates health and defeat state
- Web Core ending → Game state logic: reads defeat state
- Game state logic → Session state: reads and writes
- Game state logic → Room interface: updates status and game-over display
