# lepetitdhomme/procedural_generation architecture

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

- Interactive diagram: https://gitdiagram.com/lepetitdhomme/procedural_generation
- Repository: https://github.com/lepetitdhomme/procedural_generation

## Overview

This small C/SDL2 program initializes a window, generates one randomly sized text room into a file, then immediately cleans up. The event/render loop is commented out, so no interactive display of the generated level is implemented. The map reflects only the shown source; the README is empty.

Main entry points: [`main.c`](https://github.com/lepetitdhomme/procedural_generation/blob/master/main.c) (SDL startup), [`generation.c`](https://github.com/lepetitdhomme/procedural_generation/blob/master/generation.c) (Text level generator), [`includes/common.h`](https://github.com/lepetitdhomme/procedural_generation/blob/master/includes/common.h) (Shared definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["SDL startup<br/>[main.c]"]
  node_common["Shared definitions<br/>[common.h]"]
end

subgraph group_generation["Level generation"]
  node_generate["Text level generator<br/>[generation.c]"]
  node_random["Random integer<br/>[main.c]"]
end

node_user(("Launcher"))
node_sdl["SDL2 runtime"]
node_level["Level output file"]

node_user -->|"launches"| node_main
node_main -->|"initializes window"| node_sdl
node_main -->|"calls"| node_generate
node_generate -->|"calls"| node_random
node_generate -->|"writes room"| node_level
node_main -->|"includes"| node_common
node_generate -->|"includes"| node_common

click node_main "https://github.com/lepetitdhomme/procedural_generation/blob/master/main.c"
click node_common "https://github.com/lepetitdhomme/procedural_generation/blob/master/includes/common.h"
click node_generate "https://github.com/lepetitdhomme/procedural_generation/blob/master/generation.c"
click node_random "https://github.com/lepetitdhomme/procedural_generation/blob/master/main.c"

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_common toneBlue
class node_generate,node_random toneAmber
class node_user,node_sdl,node_level toneIndigo
```

## Components

### Application

- [SDL startup](https://github.com/lepetitdhomme/procedural_generation/blob/master/main.c): `main.c`
- [Shared definitions](https://github.com/lepetitdhomme/procedural_generation/blob/master/includes/common.h): `includes/common.h`

### Level generation

- [Text level generator](https://github.com/lepetitdhomme/procedural_generation/blob/master/generation.c): `generation.c`
- [Random integer](https://github.com/lepetitdhomme/procedural_generation/blob/master/main.c): `main.c`

### Other components

- **Launcher**
- **SDL2 runtime**
- **Level output file**

## Connections

- Launcher → SDL startup: launches
- SDL startup → SDL2 runtime: initializes window (evidence: `main.c`)
- SDL startup → Text level generator: calls (evidence: `main.c`)
- Text level generator → Random integer: calls (evidence: `generation.c`)
- Text level generator → Level output file: writes room (evidence: `generation.c`)
- SDL startup → Shared definitions: includes (evidence: `main.c`)
- Text level generator → Shared definitions: includes (evidence: `generation.c`)
