# rexoul/knuckle_bones architecture

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

- Interactive diagram: https://gitdiagram.com/rexoul/knuckle_bones
- Repository: https://github.com/rexoul/knuckle_bones

## Overview

Knuckle_bones is a browser-based two-player dice game. Players place dice in columns, where matching values are removed from the opponent’s corresponding column; play ends when a board fills, and column totals determine the result. The script also provides an edit mode for changing cell and die values. The sampled source shows gameplay, scoring, event handling, and rendering in one file; the README adds no further capabilities. The HTML and CSS roles are suggested by the file tree, but their implementation details were not sampled.

Main entry points: [`script.js`](https://github.com/rexoul/knuckle_bones/blob/main/script.js) (Game Input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game Play"]
  node_input["Game Input<br/>[script.js]"]
  node_rules["Turn Rules<br/>[script.js]"]
  node_score["Scoring<br/>[script.js]"]
end

subgraph group_edit["Board Editing"]
  node_editor["Edit Controls<br/>[script.js]"]
end

subgraph group_view["Game Display"]
  node_renderer["Game Renderer<br/>[script.js]"]
  node_page["Game Page<br/>[index.html]"]
  node_styles["Game Styles<br/>[style.css]"]
end

node_player(("Player"))

node_player -->|"clicks"| node_input
node_player -->|"edits"| node_editor
node_input -->|"dispatches"| node_rules
node_rules -->|"scores"| node_score
node_input -->|"renders"| node_renderer
node_editor -->|"renders"| node_renderer
node_score -->|"displays totals"| node_renderer

click node_input "https://github.com/rexoul/knuckle_bones/blob/main/script.js"
click node_rules "https://github.com/rexoul/knuckle_bones/blob/main/script.js"
click node_score "https://github.com/rexoul/knuckle_bones/blob/main/script.js"
click node_editor "https://github.com/rexoul/knuckle_bones/blob/main/script.js"
click node_renderer "https://github.com/rexoul/knuckle_bones/blob/main/script.js"
click node_page "https://github.com/rexoul/knuckle_bones/blob/main/index.html"
click node_styles "https://github.com/rexoul/knuckle_bones/blob/main/style.css"

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_input,node_rules,node_score toneBlue
class node_editor toneAmber
class node_renderer,node_page,node_styles toneMint
class node_player toneIndigo
```

## Components

### Game Play

- [Game Input](https://github.com/rexoul/knuckle_bones/blob/main/script.js): `script.js`
- [Turn Rules](https://github.com/rexoul/knuckle_bones/blob/main/script.js): `script.js`
- [Scoring](https://github.com/rexoul/knuckle_bones/blob/main/script.js): `script.js`

### Board Editing

- [Edit Controls](https://github.com/rexoul/knuckle_bones/blob/main/script.js): `script.js`

### Game Display

- [Game Renderer](https://github.com/rexoul/knuckle_bones/blob/main/script.js): `script.js`
- [Game Page](https://github.com/rexoul/knuckle_bones/blob/main/index.html): `index.html`
- [Game Styles](https://github.com/rexoul/knuckle_bones/blob/main/style.css): `style.css`

### Other components

- **Player**

## Connections

- Player → Game Input: clicks (evidence: `script.js`)
- Player → Edit Controls: edits (evidence: `script.js`)
- Game Input → Turn Rules: dispatches (evidence: `script.js`)
- Turn Rules → Scoring: scores (evidence: `script.js`)
- Game Input → Game Renderer: renders (evidence: `script.js`)
- Edit Controls → Game Renderer: renders (evidence: `script.js`)
- Scoring → Game Renderer: displays totals (evidence: `script.js`)
