# lazydukk/rtrg architecture

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

- Interactive diagram: https://gitdiagram.com/lazydukk/rtrg
- Repository: https://github.com/lazydukk/rtrg

## Overview

##### Main Components

a. User Interface Layer
- HTML Structure (index.html)
- Styling Components (style.css)
- Interactive Elements (script.js)

b. Core Game Logic
- Tile Distribution System
- Random Tile Generator
- Rack Management System

c. Future Components (shown differently to indicate planned features)
- Move Evaluation System
- Equity Calculator
- Team Gaming Features

- [User Interface Layer]
- ↓
- [Game Logic Layer]
- ↓
- [Data Layer]

##### Detailed Component Breakdown

User Interface Layer:
- Tile Rack Display, Controls, Score Display
- Use rounded rectangles for UI components

Game Logic Layer:
- Random tile generator component
- Rack balance evaluation logic

Data Layer:
- At the bottom
- Tile distribution data storage

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef logic fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef future fill:#95a5a6,stroke:#7f8c8d,color:white

    %% User Interface Layer
    subgraph UI["User Interface Layer"]
        HTML["HTML Structure"]
        CSS["Styling Components"]
        TileRack["Tile Rack Display"]
        Controls["Game Controls"]
        ScoreDisplay["Score Display"]
    end

    %% Game Logic Layer
    subgraph Logic["Game Logic Layer"]
        TileGen["Random Tile Generator"]
        RackMgmt["Rack Management System"]
        TileDist["Tile Distribution System"]
    end

    %% Data Layer
    subgraph Data["Data Layer"]
        TileData[("Tile Distribution Data")]
    end

    %% Future Features
    subgraph Future["Planned Features"]
        MoveEval["Move Evaluation System"]:::future
        Equity["Equity Calculator"]:::future
        TeamGaming["Team Gaming Features"]:::future
    end

    %% Connections
    HTML --> TileRack
    HTML --> Controls
    HTML --> ScoreDisplay
    CSS --> HTML
    Controls --> TileGen
    TileGen --> RackMgmt
    RackMgmt --> TileRack
    TileDist --> TileGen
    TileData --> TileDist
    RackMgmt -.-> MoveEval
    MoveEval -.-> Equity
    TeamGaming -.-> RackMgmt

    %% Component Styling
    class HTML,CSS,TileRack,Controls,ScoreDisplay ui
    class TileGen,RackMgmt,TileDist logic
    class TileData data
    class MoveEval,Equity,TeamGaming future

    %% Click Events
    click HTML "https://github.com/lazydukk/RTRG/blob/main/index.html"
    click CSS "https://github.com/lazydukk/RTRG/blob/main/style.css"
    click TileGen "https://github.com/lazydukk/RTRG/blob/main/script.js"

    %% Legend
    subgraph Legend["Legend"]
        L1["UI Component"]:::ui
        L2["Logic Component"]:::logic
        L3["Data Storage"]:::data
        L4["Future Feature"]:::future
    end
```
