# jabb4man/42-rush01 architecture

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

- Interactive diagram: https://gitdiagram.com/jabb4man/42-rush01
- Repository: https://github.com/jabb4man/42-rush01

## Overview

Rush01 is a command-line Skyscrapers puzzle solver for dynamically sized grids. The user supplies clues as one argument; the program parses them, initializes candidate bitmasks, applies geometric pre-filtering, and searches for a solution using propagation, hidden singles, MRV, and visibility checks before printing the grid or an error. The README also describes support through 9×9. The graph follows calls visible in the excerpts; no external services or persistent storage are involved.

Main entry points: [`ex00/solve.c`](https://github.com/jabb4man/42-rush01/blob/main/ex00/solve.c) (MRV search), [`ex00/propagate.c`](https://github.com/jabb4man/42-rush01/blob/main/ex00/propagate.c) (Candidate propagation), [`ex00/main.c`](https://github.com/jabb4man/42-rush01/blob/main/ex00/main.c) (CLI and grid setup), [`ex00/filter.c`](https://github.com/jabb4man/42-rush01/blob/main/ex00/filter.c) (Clue pre-filter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Input and output"]
  node_main["CLI and grid setup<br/>[main.c]"]
  node_terminal(("Solution or error"))
end

subgraph group_constraints["Constraint reduction"]
  node_filter["Clue pre-filter<br/>[filter.c]"]
  node_propagate["Candidate propagation<br/>[propagate.c]"]
end

subgraph group_search["Search and validation"]
  node_solver["MRV search<br/>[solve.c]"]
  node_visibility["Visibility pruning<br/>[visibility.c]"]
end

node_user(("Puzzle user"))

node_user -->|"provides clues"| node_main
node_main -->|"pre-filters clues"| node_filter
node_main -->|"solves grid"| node_solver
node_main -->|"prints result"| node_terminal
node_filter -->|"propagates singles"| node_propagate
node_filter -->|"applies hidden singles"| node_propagate
node_propagate -->|"recurses on singles"| node_propagate
node_solver -->|"checks clues"| node_visibility
node_solver -->|"propagates guesses"| node_propagate
node_solver -->|"applies hidden singles"| node_propagate
node_solver -->|"tries candidates"| node_solver

click node_main "https://github.com/jabb4man/42-rush01/blob/main/ex00/main.c"
click node_filter "https://github.com/jabb4man/42-rush01/blob/main/ex00/filter.c"
click node_propagate "https://github.com/jabb4man/42-rush01/blob/main/ex00/propagate.c"
click node_solver "https://github.com/jabb4man/42-rush01/blob/main/ex00/solve.c"
click node_visibility "https://github.com/jabb4man/42-rush01/blob/main/ex00/visibility.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_terminal,node_user toneBlue
class node_filter,node_propagate toneAmber
class node_solver,node_visibility toneMint
```

## Components

### Input and output

- [CLI and grid setup](https://github.com/jabb4man/42-rush01/blob/main/ex00/main.c): `ex00/main.c`
- **Solution or error**

### Constraint reduction

- [Clue pre-filter](https://github.com/jabb4man/42-rush01/blob/main/ex00/filter.c): `ex00/filter.c`
- [Candidate propagation](https://github.com/jabb4man/42-rush01/blob/main/ex00/propagate.c): `ex00/propagate.c`

### Search and validation

- [MRV search](https://github.com/jabb4man/42-rush01/blob/main/ex00/solve.c): `ex00/solve.c`
- [Visibility pruning](https://github.com/jabb4man/42-rush01/blob/main/ex00/visibility.c): `ex00/visibility.c`

### Other components

- **Puzzle user**

## Connections

- Puzzle user → CLI and grid setup: provides clues (evidence: `ex00/main.c`)
- CLI and grid setup → Clue pre-filter: pre-filters clues (evidence: `ex00/main.c`)
- CLI and grid setup → MRV search: solves grid (evidence: `ex00/main.c`)
- CLI and grid setup → Solution or error: prints result (evidence: `ex00/main.c`)
- Clue pre-filter → Candidate propagation: propagates singles (evidence: `ex00/filter.c`)
- Clue pre-filter → Candidate propagation: applies hidden singles (evidence: `ex00/filter.c`)
- Candidate propagation → Candidate propagation: recurses on singles (evidence: `ex00/propagate.c`)
- MRV search → Visibility pruning: checks clues (evidence: `ex00/solve.c`)
- MRV search → Candidate propagation: propagates guesses (evidence: `ex00/solve.c`)
- MRV search → Candidate propagation: applies hidden singles (evidence: `ex00/solve.c`)
- MRV search → MRV search: tries candidates (evidence: `ex00/solve.c`)
