# loganoberk/8tilesolver architecture

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

- Interactive diagram: https://gitdiagram.com/loganoberk/8tilesolver
- Repository: https://github.com/loganoberk/8tilesolver

## Overview

This is a console 8-tile puzzle solver: a user enters initial and goal boards, an A* agent searches for a least-cost path using wind-weighted moves, and the solution is printed. The code separates input/output, search management, and board-state representation. Main.cpp is present in the tree but was not sampled, so its orchestration links are omitted; the README provides no additional capability details.

Main entry points: [`8tilesolver/ui/UI.cpp`](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/ui/UI.cpp) (Input and output), [`8tilesolver/model/AStarAgent.cpp`](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/AStarAgent.cpp) (A* search), [`8tilesolver/model/Agent.cpp`](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/Agent.cpp) (Search management), [`8tilesolver/model/State.cpp`](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/State.cpp) (Puzzle state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Console interface"]
  node_ui_funcs["Input and output<br/>[UI.cpp]"]
end

subgraph group_search["Search"]
  node_astar["A* search<br/>[AStarAgent.cpp]"]
  node_agent["Search management<br/>[Agent.cpp]"]
end

subgraph group_state["Board state"]
  node_state["Puzzle state<br/>[State.cpp]"]
end

node_user(("User"))
node_main["Application entry<br/>[Main.cpp]"]

node_ui_funcs -->|"prompts and prints"| node_user
node_astar -->|"moves and updates"| node_state
node_astar -->|"populates solution"| node_agent
node_ui_funcs -->|"prints solution"| node_agent

click node_main "https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/main/Main.cpp"
click node_ui_funcs "https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/ui/UI.cpp"
click node_astar "https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/AStarAgent.cpp"
click node_agent "https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/Agent.cpp"
click node_state "https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/State.cpp"

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_ui_funcs,node_user toneBlue
class node_astar,node_agent toneAmber
class node_state toneMint
class node_main toneTeal
```

## Components

### Console interface

- [Input and output](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/ui/UI.cpp): `8tilesolver/ui/UI.cpp`

### Search

- [A* search](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/AStarAgent.cpp): `8tilesolver/model/AStarAgent.cpp`
- [Search management](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/Agent.cpp): `8tilesolver/model/Agent.cpp`

### Board state

- [Puzzle state](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/model/State.cpp): `8tilesolver/model/State.cpp`

### Other components

- **User**
- [Application entry](https://github.com/loganoberk/8tilesolver/blob/main/8tilesolver/main/Main.cpp): `8tilesolver/main/Main.cpp`

## Connections

- Input and output → User: prompts and prints
- A* search → Puzzle state: moves and updates
- A* search → Search management: populates solution
- Input and output → Search management: prints solution
