# zreal1/ng architecture

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

- Interactive diagram: https://gitdiagram.com/zreal1/ng
- Repository: https://github.com/zreal1/ng

## Overview

This is a small command-line number-guessing game. The user enters guesses across five increasingly large levels; each level checks guesses, gives directional and proximity hints, and returns its attempt count. The main routine totals attempts and prints completion results. The single source file shows the calls and console interactions directly.

Main entry points: [`num_gues.py`](https://github.com/zreal1/ng/blob/main/num_gues.py) (Level guessing)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_player(("Player"))
node_game["Game flow<br/>[num_gues.py]"]
node_welcome["Welcome screen<br/>[num_gues.py]"]
node_level["Level guessing<br/>[num_gues.py]"]
node_hints["Guess hints<br/>[num_gues.py]"]
node_rng["Random generator"]
node_console["Console I/O"]

node_game -->|"calls"| node_welcome
node_game -->|"runs levels"| node_level
node_level -->|"draws secret"| node_rng
node_level -->|"requests hint"| node_hints
node_welcome -->|"prints welcome"| node_console
node_level -->|"reads and prints"| node_console
node_hints -->|"prints guidance"| node_console
node_game -->|"prints results"| node_console
node_player -->|"enters guesses"| node_console
node_console -->|"shows prompts"| node_player
node_level -->|"returns attempts"| node_game

click node_game "https://github.com/zreal1/ng/blob/main/num_gues.py"
click node_welcome "https://github.com/zreal1/ng/blob/main/num_gues.py"
click node_level "https://github.com/zreal1/ng/blob/main/num_gues.py"
click node_hints "https://github.com/zreal1/ng/blob/main/num_gues.py"

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_player,node_rng,node_console toneIndigo
class node_game,node_level,node_hints toneTeal
class node_welcome toneBlue
```

## Components

### Other components

- **Player**
- [Game flow](https://github.com/zreal1/ng/blob/main/num_gues.py): `num_gues.py`
- [Welcome screen](https://github.com/zreal1/ng/blob/main/num_gues.py): `num_gues.py`
- [Level guessing](https://github.com/zreal1/ng/blob/main/num_gues.py): `num_gues.py`
- [Guess hints](https://github.com/zreal1/ng/blob/main/num_gues.py): `num_gues.py`
- **Random generator**
- **Console I/O**

## Connections

- Game flow → Welcome screen: calls (evidence: `num_gues.py`)
- Game flow → Level guessing: runs levels (evidence: `num_gues.py`)
- Level guessing → Random generator: draws secret (evidence: `num_gues.py`)
- Level guessing → Guess hints: requests hint (evidence: `num_gues.py`)
- Welcome screen → Console I/O: prints welcome (evidence: `num_gues.py`)
- Level guessing → Console I/O: reads and prints (evidence: `num_gues.py`)
- Guess hints → Console I/O: prints guidance (evidence: `num_gues.py`)
- Game flow → Console I/O: prints results (evidence: `num_gues.py`)
- Player → Console I/O: enters guesses
- Console I/O → Player: shows prompts
- Level guessing → Game flow: returns attempts (evidence: `num_gues.py`)
