# abzy2020/dotty-game architecture

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

- Interactive diagram: https://gitdiagram.com/abzy2020/dotty-game
- Repository: https://github.com/abzy2020/dotty-game

## Overview

##### Project type and purpose
- This is a small standalone Java console application implementing a two-player “Dotty” sum-guessing game.
- Purpose: Present a command-line UI, accept player inputs (two numbers and sum guesses), enforce game rules, and declare a winner or loser.

##### File structure
- Top level:
- LICENSE, README.md
- Usogui/
– bin/  (compiled .class files)
– src/
- App.java   – likely the entry point and CLI orchestration
- NumberGame.java – core game logic and rule enforcement
- No external configs, no database, no web layer.

##### README for additional insights
- Simple rule set: two players choose numbers in [1..10]; they alternate guessing the sum; invalid choices cause an instant loss.
- No mention of persistence, network, or GUI beyond console I/O.

a. Main components to show
- Presentation Layer
- Console Input/Output (in App.java)
- Application Layer
- Game Controller (App.java orchestrator)
- Domain Layer
- Game Engine (NumberGame.java)
- Utility/Infrastructure (optional)
- Validation logic (bounds check, sum logic)
- Error/Rule Violation Handler
b. Relationships and interactions
- User → Console I/O → App (reads numbers & guesses)
- App → NumberGame (pass inputs to game engine)
- NumberGame → Validation & Rule Engine → returns outcome (valid/invalid, win/lose, next turn)
- App ← outcome ← NumberGame → Console Output (display feedback, winner)
c. Architectural patterns or principles
- Separation of Concerns:
- Presentation (App.java I/O) vs. Business Logic (NumberGame.java)
- Single-Responsibility:
- App.java drives flow; NumberGame.java enforces rules
- Stateless core engine (no side-effects, all state passed in/out)
d. Key technologies
- Java (JDK 8+), standard IO (java.io or java.util.Scanner)
- No external dependencies or frameworks

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Presentation Layer"
        CI["Console I/O"]:::presentation
        CO["Console Output"]:::presentation
    end
    subgraph "Application Layer"
        GC["GameController (App.java)"]:::application
    end
    subgraph "Domain Layer"
        E["NumberGame Engine"]:::domain
        V["Validation & Rule Enforcement"]:::domain
    end

    CI -->|"playerNumbers, sumGuess"| GC
    GC -->|"calculateSum()/validateMove()"| E
    E -->|"validate numbers"| V
    V -->|"validationResult"| GC
    GC -->|"display result"| CO

    click CI "https://github.com/abzy2020/dotty-game/blob/main/Usogui/src/App.java"
    click GC "https://github.com/abzy2020/dotty-game/blob/main/Usogui/src/App.java"
    click E "https://github.com/abzy2020/dotty-game/blob/main/Usogui/src/NumberGame.java"
    click V "https://github.com/abzy2020/dotty-game/blob/main/Usogui/src/NumberGame.java"

    classDef presentation fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef application fill:#90EE90,stroke:#000,stroke-width:1px
    classDef domain fill:#FFA500,stroke:#000,stroke-width:1px
```
