# rainboow1908/random-wheel architecture

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

- Interactive diagram: https://gitdiagram.com/rainboow1908/random-wheel
- Repository: https://github.com/rainboow1908/random-wheel

## Overview

A browser-based configurable roulette wheel. The user opens the page and spins; the wheel lands uniformly at a pseudo-random sector, then may reverse to the final (jackpot) sector according to the landed sector’s configured backtrack probability. The README documents this workflow and configuration, but the roulette implementation itself was not sampled, so runtime links are cited to the README.

Main entry points: [`roulette.html`](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html) (Uniform stop), [`weights.js`](https://github.com/rainboow1908/random-wheel/blob/main/weights.js) (Wheel config)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_roulette["Roulette page<br/>[roulette.html]"]
node_config["Wheel config<br/>[weights.js]"]
node_wheel["Equal-sector wheel<br/>[roulette.html]"]
node_initial_stop["Uniform stop<br/>[roulette.html]"]
node_backtrack["Probabilistic reversal<br/>[roulette.html]"]
node_result["Final sector<br/>[roulette.html]"]

node_user -->|"opens"| node_roulette
node_config -->|"configures"| node_roulette
node_roulette -->|"renders"| node_wheel
node_wheel -->|"spins to"| node_initial_stop
node_initial_stop -->|"may trigger"| node_backtrack
node_backtrack -->|"reverses to"| node_result
node_initial_stop -->|"keeps stop"| node_result

click node_roulette "https://github.com/rainboow1908/random-wheel/blob/main/roulette.html"
click node_config "https://github.com/rainboow1908/random-wheel/blob/main/weights.js"
click node_wheel "https://github.com/rainboow1908/random-wheel/blob/main/roulette.html"
click node_initial_stop "https://github.com/rainboow1908/random-wheel/blob/main/roulette.html"
click node_backtrack "https://github.com/rainboow1908/random-wheel/blob/main/roulette.html"
click node_result "https://github.com/rainboow1908/random-wheel/blob/main/roulette.html"

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_user toneBlue
class node_roulette,node_config,node_wheel,node_initial_stop,node_backtrack,node_result toneTeal
```

## Components

### Other components

- **User**
- [Roulette page](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html): `roulette.html`
- [Wheel config](https://github.com/rainboow1908/random-wheel/blob/main/weights.js): `weights.js`
- [Equal-sector wheel](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html): `roulette.html`
- [Uniform stop](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html): `roulette.html`
- [Probabilistic reversal](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html): `roulette.html`
- [Final sector](https://github.com/rainboow1908/random-wheel/blob/main/roulette.html): `roulette.html`

## Connections

- User → Roulette page: opens (evidence: `README.md`)
- Wheel config → Roulette page: configures (evidence: `README.md`)
- Roulette page → Equal-sector wheel: renders (evidence: `README.md`)
- Equal-sector wheel → Uniform stop: spins to (evidence: `README.md`)
- Uniform stop → Probabilistic reversal: may trigger (evidence: `README.md`)
- Probabilistic reversal → Final sector: reverses to (evidence: `README.md`)
- Uniform stop → Final sector: keeps stop (evidence: `README.md`)
