# kotechamohit/stone-paper-scissor architecture

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

- Interactive diagram: https://gitdiagram.com/kotechamohit/stone-paper-scissor
- Repository: https://github.com/kotechamohit/stone-paper-scissor

## Overview

This is a small browser-based Rock Paper Scissors game. The player clicks a choice, the event handler passes it to the round logic, which generates a computer choice and determines a win, loss, or draw. Win/loss results update the corresponding score and message; draws update the message without changing scores. The README documents the HTML/CSS interface and color-coded feedback, but those files were not sampled, so their detailed wiring is not shown.

Main entry points: [`Stone Paper Scissor/app.js`](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js) (Play Round), [`Stone Paper Scissor/index.html`](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/index.html) (Choice Buttons), [`Stone Paper Scissor/style.css`](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/style.css) (Page Styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_round["Round Logic"]
  node_click_handler["Click Handler<br/>[app.js]"]
  node_play_round["Play Round<br/>[app.js]"]
  node_computer_choice["Computer Choice<br/>[app.js]"]
  node_resolve_round["Resolve Outcome<br/>[app.js]"]
end

subgraph group_interface["Game Interface"]
  node_choice_ui["Choice Buttons<br/>[index.html]"]
  node_score_feedback["Score and Feedback<br/>[app.js]"]
  node_page_styles["Page Styling<br/>[style.css]"]
end

node_player(("Player"))

node_player -->|"selects choice"| node_choice_ui
node_choice_ui -->|"click event"| node_click_handler
node_click_handler -->|"starts round"| node_play_round
node_play_round -->|"generates choice"| node_computer_choice
node_play_round -->|"compares choices"| node_resolve_round
node_resolve_round -->|"updates result"| node_score_feedback
node_page_styles -.->|"colors feedback"| node_score_feedback

click node_choice_ui "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/index.html"
click node_click_handler "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js"
click node_play_round "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js"
click node_computer_choice "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js"
click node_resolve_round "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js"
click node_score_feedback "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js"
click node_page_styles "https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/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_click_handler,node_play_round,node_computer_choice,node_resolve_round toneBlue
class node_choice_ui,node_score_feedback,node_page_styles toneAmber
class node_player toneIndigo
```

## Components

### Round Logic

- [Click Handler](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js): `Stone Paper Scissor/app.js`
- [Play Round](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js): `Stone Paper Scissor/app.js`
- [Computer Choice](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js): `Stone Paper Scissor/app.js`
- [Resolve Outcome](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js): `Stone Paper Scissor/app.js`

### Game Interface

- [Choice Buttons](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/index.html): `Stone Paper Scissor/index.html`
- [Score and Feedback](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/app.js): `Stone Paper Scissor/app.js`
- [Page Styling](https://github.com/kotechamohit/stone-paper-scissor/blob/main/Stone%20Paper%20Scissor/style.css): `Stone Paper Scissor/style.css`

### Other components

- **Player**

## Connections

- Player → Choice Buttons: selects choice (evidence: `README.md`)
- Choice Buttons → Click Handler: click event (evidence: `README.md`)
- Click Handler → Play Round: starts round (evidence: `Stone Paper Scissor/app.js`)
- Play Round → Computer Choice: generates choice (evidence: `Stone Paper Scissor/app.js`)
- Play Round → Resolve Outcome: compares choices (evidence: `Stone Paper Scissor/app.js`)
- Resolve Outcome → Score and Feedback: updates result (evidence: `Stone Paper Scissor/app.js`)
- Page Styling → Score and Feedback: colors feedback (evidence: `README.md`)
