# kanedayo/modern-jankenman architecture

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

- Interactive diagram: https://gitdiagram.com/kanedayo/modern-jankenman
- Repository: https://github.com/kanedayo/modern-jankenman

## Overview

This is a browser-based rock-paper-scissors game with rhythm cues, tie rounds, escalating win rewards, and medal collection. The player starts a game and chooses a hand; the game resolves the result, repeats ties, and offers a double-up choice after wins until the player collects or loses. Medal totals persist in browser storage, and sound effects accompany play. The workflow is visible in script.js; index.html and the sound directory are identified by the tree, but their contents were not provided.

Main entry points: [`script.js`](https://github.com/kanedayo/modern-jankenman/blob/main/script.js) (Game controller), [`index.html`](https://github.com/kanedayo/modern-jankenman/blob/main/index.html) (Game interface), [`assets/sounds`](https://github.com/kanedayo/modern-jankenman/tree/main/assets/sounds) (Sound assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game flow"]
  node_game_flow["Game controller<br/>[script.js]"]
  node_hand_resolution["Hand resolution<br/>[script.js]"]
  node_reward_flow["Reward decisions<br/>[script.js]"]
end

subgraph group_interface["Player interface"]
  node_game_ui["Game interface<br/>[index.html]"]
end

subgraph group_resources["Persistence and audio"]
  node_medal_storage["Medal storage<br/>[script.js]"]
  node_browser_storage[("Browser storage")]
  node_sound_cues["Sound playback<br/>[script.js]"]
  node_sound_files["Sound assets"]
end

node_player(("Player"))

node_player -->|"plays through"| node_game_ui
node_game_ui -->|"sends choices"| node_game_flow
node_game_flow -->|"updates display"| node_game_ui
node_game_flow -->|"resolves hand"| node_hand_resolution
node_hand_resolution -->|"passes outcome"| node_reward_flow
node_game_flow -->|"starts round"| node_reward_flow
node_reward_flow -->|"shows decision"| node_game_ui
node_reward_flow -->|"collects medals"| node_medal_storage
node_medal_storage -->|"reads and writes"| node_browser_storage
node_game_flow -->|"plays cues"| node_sound_cues
node_reward_flow -->|"plays outcomes"| node_sound_cues
node_sound_cues -->|"loads audio"| node_sound_files

click node_game_ui "https://github.com/kanedayo/modern-jankenman/blob/main/index.html"
click node_game_flow "https://github.com/kanedayo/modern-jankenman/blob/main/script.js"
click node_hand_resolution "https://github.com/kanedayo/modern-jankenman/blob/main/script.js"
click node_reward_flow "https://github.com/kanedayo/modern-jankenman/blob/main/script.js"
click node_medal_storage "https://github.com/kanedayo/modern-jankenman/blob/main/script.js"
click node_sound_cues "https://github.com/kanedayo/modern-jankenman/blob/main/script.js"
click node_sound_files "https://github.com/kanedayo/modern-jankenman/tree/main/assets/sounds"

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_game_flow,node_hand_resolution,node_reward_flow toneBlue
class node_game_ui toneAmber
class node_medal_storage,node_browser_storage,node_sound_cues,node_sound_files toneMint
class node_player toneIndigo
```

## Components

### Game flow

- [Game controller](https://github.com/kanedayo/modern-jankenman/blob/main/script.js): `script.js`
- [Hand resolution](https://github.com/kanedayo/modern-jankenman/blob/main/script.js): `script.js`
- [Reward decisions](https://github.com/kanedayo/modern-jankenman/blob/main/script.js): `script.js`

### Player interface

- [Game interface](https://github.com/kanedayo/modern-jankenman/blob/main/index.html): `index.html`

### Persistence and audio

- [Medal storage](https://github.com/kanedayo/modern-jankenman/blob/main/script.js): `script.js`
- **Browser storage**
- [Sound playback](https://github.com/kanedayo/modern-jankenman/blob/main/script.js): `script.js`
- [Sound assets](https://github.com/kanedayo/modern-jankenman/tree/main/assets/sounds): `assets/sounds`

### Other components

- **Player**

## Connections

- Player → Game interface: plays through
- Game interface → Game controller: sends choices (evidence: `script.js`)
- Game controller → Game interface: updates display (evidence: `script.js`)
- Game controller → Hand resolution: resolves hand (evidence: `script.js`)
- Hand resolution → Reward decisions: passes outcome (evidence: `script.js`)
- Game controller → Reward decisions: starts round (evidence: `script.js`)
- Reward decisions → Game interface: shows decision (evidence: `script.js`)
- Reward decisions → Medal storage: collects medals (evidence: `script.js`)
- Medal storage → Browser storage: reads and writes (evidence: `script.js`)
- Game controller → Sound playback: plays cues (evidence: `script.js`)
- Reward decisions → Sound playback: plays outcomes (evidence: `script.js`)
- Sound playback → Sound assets: loads audio (evidence: `script.js`)
