# nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter architecture

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

- Interactive diagram: https://gitdiagram.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter
- Repository: https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter

## Overview

This repository is a Streamlit number-guessing game and debugging exercise. The player chooses a difficulty, submits guesses, receives higher/lower or win feedback, and can start a new game; the app tracks the secret, attempts, score, status, and history in Streamlit session state. It also exposes developer debug information. The shared game helpers in `logic_utils.py` duplicate functions in `app.py`, but the sampled source shows no import or runtime connection between them. Tests and setup files are omitted.

Main entry points: [`app.py`](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py) (Game control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game flow"]
  node_settings["Difficulty settings<br/>[app.py]"]
  node_guess_ui["Guess interface<br/>[app.py]"]
  node_game_control["Game control<br/>[app.py]"]
  node_feedback["Game feedback<br/>[app.py]"]
  node_debug_view["Debug info<br/>[app.py]"]
end

subgraph group_state["Game state"]
  node_session_state[("Session state<br/>[app.py]")]
end

subgraph group_logic["Game logic"]
  node_secret_generation["Secret generation<br/>[app.py]"]
  node_guess_parsing["Guess parsing<br/>[app.py]"]
  node_guess_evaluation["Guess evaluation<br/>[app.py]"]
  node_score_update["Score update<br/>[app.py]"]
  node_shared_helpers["Shared game helpers<br/>[logic_utils.py]"]
end

node_player(("Player"))

node_player -->|"chooses difficulty"| node_settings
node_player -->|"submits guess"| node_guess_ui
node_player -->|"starts new game"| node_game_control
node_settings -->|"sets range and limit"| node_game_control
node_game_control -->|"reads and updates"| node_session_state
node_game_control -->|"generates secret"| node_secret_generation
node_guess_ui -->|"submits input"| node_game_control
node_game_control -->|"parses input"| node_guess_parsing
node_game_control -->|"checks valid guess"| node_guess_evaluation
node_game_control -->|"updates score"| node_score_update
node_game_control -->|"displays outcome"| node_feedback
node_game_control -->|"displays state"| node_debug_view
node_debug_view -->|"reads game values"| node_session_state

click node_settings "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_guess_ui "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_game_control "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_feedback "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_debug_view "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_session_state "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_secret_generation "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_guess_parsing "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_guess_evaluation "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_score_update "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py"
click node_shared_helpers "https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/logic_utils.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_settings,node_guess_ui,node_game_control,node_feedback,node_debug_view toneBlue
class node_session_state toneAmber
class node_secret_generation,node_guess_parsing,node_guess_evaluation,node_score_update,node_shared_helpers toneMint
class node_player toneIndigo
```

## Components

### Game flow

- [Difficulty settings](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Guess interface](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Game control](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Game feedback](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Debug info](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`

### Game state

- [Session state](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`

### Game logic

- [Secret generation](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Guess parsing](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Guess evaluation](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Score update](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/app.py): `app.py`
- [Shared game helpers](https://github.com/nahomtesfay212025-cmyk/ai110-module1show-gameglitchinvestigator-starter/blob/main/logic_utils.py): `logic_utils.py`

### Other components

- **Player**

## Connections

- Player → Difficulty settings: chooses difficulty (evidence: `app.py`)
- Player → Guess interface: submits guess (evidence: `app.py`)
- Player → Game control: starts new game (evidence: `app.py`)
- Difficulty settings → Game control: sets range and limit (evidence: `app.py`)
- Game control → Session state: reads and updates (evidence: `app.py`)
- Game control → Secret generation: generates secret (evidence: `app.py`)
- Guess interface → Game control: submits input (evidence: `app.py`)
- Game control → Guess parsing: parses input (evidence: `app.py`)
- Game control → Guess evaluation: checks valid guess (evidence: `app.py`)
- Game control → Score update: updates score (evidence: `app.py`)
- Game control → Game feedback: displays outcome (evidence: `app.py`)
- Game control → Debug info: displays state (evidence: `app.py`)
- Debug info → Session state: reads game values (evidence: `app.py`)
