# armaanusmani/othello-game-simulator architecture

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

- Interactive diagram: https://gitdiagram.com/armaanusmani/othello-game-simulator
- Repository: https://github.com/armaanusmani/othello-game-simulator

## Overview

This is a single-file Othello simulator: it loads a board and turn from input.txt, simulates play using an AI move search and Othello rules, then prints the game and winner. The source excerpt shows input loading, game-turn handling, move application, and board printing; the README documents the rules, alpha–beta search, pass handling, configurable depth, and winner output. Several internal calls fall in omitted source sections, so the graph keeps those links at the documented level.

Main entry points: [`othello.cpp`](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp) (Game simulation), [`input.txt`](https://github.com/armaanusmani/othello-game-simulator/blob/main/input.txt) (Initial position)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_input["Initial position<br/>[input.txt]"]
  node_loader["Input loader<br/>[othello.cpp]"]
  node_orchestrator["Game simulation<br/>[othello.cpp]"]
end

subgraph group_gameplay["Othello gameplay"]
  node_rules["Othello rules<br/>[othello.cpp]"]
  node_movegen["Legal moves<br/>[othello.cpp]"]
  node_apply["Move and pass<br/>[othello.cpp]"]
  node_search["Minimax search<br/>[othello.cpp]"]
end

subgraph group_results["Game results"]
  node_scoring["Board evaluation<br/>[othello.cpp]"]
  node_display["Board and winner output<br/>[othello.cpp]"]
end

node_user(("Game runner"))

node_user -->|"runs"| node_orchestrator
node_input -->|"provides position"| node_loader
node_loader -->|"initializes game"| node_orchestrator
node_orchestrator -->|"requests move"| node_search
node_search -.->|"explores moves"| node_movegen
node_search -.->|"evaluates boards"| node_scoring
node_orchestrator -.->|"checks legal moves"| node_movegen
node_orchestrator -->|"applies move"| node_apply
node_apply -.->|"flips discs"| node_rules
node_orchestrator -->|"prints game"| node_display
node_orchestrator -->|"declares winner"| node_display

click node_input "https://github.com/armaanusmani/othello-game-simulator/blob/main/input.txt"
click node_loader "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_orchestrator "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_rules "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_movegen "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_apply "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_search "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_scoring "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp"
click node_display "https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.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_input,node_loader,node_orchestrator toneBlue
class node_rules,node_movegen,node_apply,node_search toneAmber
class node_scoring,node_display toneMint
class node_user toneIndigo
```

## Components

### Game runtime

- [Initial position](https://github.com/armaanusmani/othello-game-simulator/blob/main/input.txt): `input.txt`
- [Input loader](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`
- [Game simulation](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`

### Othello gameplay

- [Othello rules](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`
- [Legal moves](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`
- [Move and pass](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`
- [Minimax search](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`

### Game results

- [Board evaluation](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`
- [Board and winner output](https://github.com/armaanusmani/othello-game-simulator/blob/main/othello.cpp): `othello.cpp`

### Other components

- **Game runner**

## Connections

- Game runner → Game simulation: runs (evidence: `othello.cpp`)
- Initial position → Input loader: provides position (evidence: `README.md`)
- Input loader → Game simulation: initializes game (evidence: `othello.cpp`)
- Game simulation → Minimax search: requests move (evidence: `othello.cpp`)
- Minimax search → Legal moves: explores moves (evidence: `othello.cpp`)
- Minimax search → Board evaluation: evaluates boards (evidence: `othello.cpp`)
- Game simulation → Legal moves: checks legal moves (evidence: `othello.cpp`)
- Game simulation → Move and pass: applies move (evidence: `othello.cpp`)
- Move and pass → Othello rules: flips discs (evidence: `othello.cpp`)
- Game simulation → Board and winner output: prints game (evidence: `othello.cpp`)
- Game simulation → Board and winner output: declares winner (evidence: `README.md`)
