# amna-amna/dicegame architecture

> Architecture diagram of the GitHub repository amna-amna/dicegame, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amna-amna/dicegame
- Repository: https://github.com/amna-amna/dicegame

## Overview

##### Project type and purpose
- This is a single‐page, client‐side web game (“pigGame”).
- All code lives in the browser: index.html (markup), style.css (presentation), script.js (game logic).

##### File structure
- Top‐level files:
- index.html – the entire UI shell
- style.css – all visual styles
- script.js – game rules, state management, and event handlers
- .prettierrc – code‐style config (irrelevant for runtime)
- No backend, no database, no external services. It’s purely front‐end.

##### README for additional insights
- Game loop: on each dice roll, JS updates an in‐memory score or resets on “1.”
- UI actions: “Roll dice,” “Hold,” and “New game.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Actors
    User["User"]:::user

    %% Browser environment subgraph
    subgraph "Browser Environment"
        direction TB
        HTML["HTML Layer<br/>(index.html)"]:::static
        CSS["CSS Layer<br/>(style.css)"]:::static
        JS["JavaScript Layer<br/>(script.js)<br/>(Model & Controller)"]:::dynamic
    end

    %% Tooling (non-runtime)
    Tool[".prettierrc"]:::tool

    %% Interactions
    User -->|"click (Roll/Hold/New Game)"| HTML
    HTML -->|"DOM event listener"| JS
    JS -->|"update game state"| JS
    JS -->|"DOM update (scores/UI)"| HTML
    CSS -->|"applies styles"| HTML

    %% Click events
    click HTML "https://github.com/amna-amna/dicegame/blob/main/index.html"
    click CSS "https://github.com/amna-amna/dicegame/blob/main/style.css"
    click JS "https://github.com/amna-amna/dicegame/blob/main/script.js"
    click Tool "https://github.com/amna-amna/dicegame/blob/main/.prettierrc"

    %% Styles
    classDef user fill:#ffcc80,stroke:#333,color:#000
    classDef static fill:#bbdefb,stroke:#333,color:#000
    classDef dynamic fill:#c8e6c9,stroke:#333,color:#000
    classDef tool fill:#eeeeee,stroke:#666,color:#000
```
