# z-manw/rocks architecture

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

- Interactive diagram: https://gitdiagram.com/z-manw/rocks
- Repository: https://github.com/z-manw/rocks

## Overview

Rocks is a terminal pet-rock game: the user chooses actions, the main loop invokes the rock’s behavior, and the rock returns messages and descriptions. The rock tracks mood, temperament, bonding, neglect, and hibernation. The README also describes weather- and mood-based color changes, but the sampled code does not show how weather or visuals are wired; those links are therefore unverified. Several listed modules were empty or unsampled.

Main entry points: [`pet_rock/main.py`](https://github.com/z-manw/rocks/blob/main/pet_rock/main.py) (Game loop), [`pet_rock/core/rock.py`](https://github.com/z-manw/rocks/blob/main/pet_rock/core/rock.py) (Pet rock state), [`pet_rock/ui/visuals.py`](https://github.com/z-manw/rocks/blob/main/pet_rock/ui/visuals.py) (Color visuals), [`pet_rock/core/mood.py`](https://github.com/z-manw/rocks/blob/main/pet_rock/core/mood.py) (Mood behavior)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Terminal interaction"]
  node_main["Game loop<br/>[main.py]"]
  node_terminal["Terminal interface<br/>[terminal.py]"]
end

subgraph group_rock["Rock behavior"]
  node_rock["Pet rock state<br/>[rock.py]"]
  node_mood["Mood behavior<br/>[mood.py]"]
  node_temperament["Temperament behavior<br/>[temperament.py]"]
  node_time["Time tracking<br/>[time.py]"]
  node_randomness["Randomness<br/>[randomness.py]"]
end

subgraph group_presentation["Ambient presentation"]
  node_weather["Weather effects<br/>[weather.py]"]
  node_visuals["Color visuals<br/>[visuals.py]"]
end

node_player(("Player"))

node_player -->|"chooses actions"| node_main
node_main -->|"calls actions"| node_rock
node_rock -->|"returns messages"| node_main
node_main -.->|"uses terminal"| node_terminal
node_mood -.->|"influences color"| node_visuals
node_weather -.->|"influences color"| node_visuals

click node_main "https://github.com/z-manw/rocks/blob/main/pet_rock/main.py"
click node_terminal "https://github.com/z-manw/rocks/blob/main/pet_rock/ui/terminal.py"
click node_rock "https://github.com/z-manw/rocks/blob/main/pet_rock/core/rock.py"
click node_mood "https://github.com/z-manw/rocks/blob/main/pet_rock/core/mood.py"
click node_temperament "https://github.com/z-manw/rocks/blob/main/pet_rock/core/temperament.py"
click node_time "https://github.com/z-manw/rocks/blob/main/pet_rock/core/time.py"
click node_randomness "https://github.com/z-manw/rocks/blob/main/pet_rock/systems/randomness.py"
click node_weather "https://github.com/z-manw/rocks/blob/main/pet_rock/systems/weather.py"
click node_visuals "https://github.com/z-manw/rocks/blob/main/pet_rock/ui/visuals.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_main,node_terminal toneBlue
class node_rock,node_mood,node_temperament,node_time,node_randomness toneAmber
class node_weather,node_visuals toneMint
class node_player toneIndigo
```

## Components

### Terminal interaction

- [Game loop](https://github.com/z-manw/rocks/blob/main/pet_rock/main.py): `pet_rock/main.py`
- [Terminal interface](https://github.com/z-manw/rocks/blob/main/pet_rock/ui/terminal.py): `pet_rock/ui/terminal.py`

### Rock behavior

- [Pet rock state](https://github.com/z-manw/rocks/blob/main/pet_rock/core/rock.py): `pet_rock/core/rock.py`
- [Mood behavior](https://github.com/z-manw/rocks/blob/main/pet_rock/core/mood.py): `pet_rock/core/mood.py`
- [Temperament behavior](https://github.com/z-manw/rocks/blob/main/pet_rock/core/temperament.py): `pet_rock/core/temperament.py`
- [Time tracking](https://github.com/z-manw/rocks/blob/main/pet_rock/core/time.py): `pet_rock/core/time.py`
- [Randomness](https://github.com/z-manw/rocks/blob/main/pet_rock/systems/randomness.py): `pet_rock/systems/randomness.py`

### Ambient presentation

- [Weather effects](https://github.com/z-manw/rocks/blob/main/pet_rock/systems/weather.py): `pet_rock/systems/weather.py`
- [Color visuals](https://github.com/z-manw/rocks/blob/main/pet_rock/ui/visuals.py): `pet_rock/ui/visuals.py`

### Other components

- **Player**

## Connections

- Player → Game loop: chooses actions (evidence: `pet_rock/main.py`)
- Game loop → Pet rock state: calls actions (evidence: `pet_rock/main.py`)
- Pet rock state → Game loop: returns messages (evidence: `pet_rock/main.py`)
- Game loop → Terminal interface: uses terminal
- Mood behavior → Color visuals: influences color (evidence: `README.md`)
- Weather effects → Color visuals: influences color (evidence: `README.md`)
