# batuhancakmak4/nqueens-game architecture

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

- Interactive diagram: https://gitdiagram.com/batuhancakmak4/nqueens-game
- Repository: https://github.com/batuhancakmak4/nqueens-game

## Overview

This is a small interactive N-Queens desktop game: the player clicks squares, the application applies move rules, and the board and status panel reflect the resulting game state. Easy Mode highlights attacked squares; Hard Mode hides those hints. The GUI and game logic are implemented in the two core C++ files, while the original C console game remains a separate historical implementation. Relationships are based on the shown source and README; the original implementation is not shown as part of the GUI runtime.

Main entry points: [`game_logic.hpp`](https://github.com/batuhancakmak4/nqueens-game/blob/main/game_logic.hpp) (Game state and rules), [`main.cpp`](https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp) (Game controller), [`nQueen_original.c`](https://github.com/batuhancakmak4/nqueens-game/blob/main/nQueen_original.c) (Console implementation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Graphical interface"]
  node_app["Game controller<br/>[main.cpp]"]
  node_board["Board display<br/>[main.cpp]"]
  node_panel["Controls and status<br/>[main.cpp]"]
end

subgraph group_rules["Game rules"]
  node_state["Game state and rules<br/>[game_logic.hpp]"]
end

subgraph group_legacy["Original console game"]
  node_console["Console implementation<br/>[nQueen_original.c]"]
end

node_player(("Player"))

node_player -->|"clicks"| node_app
node_app -->|"updates and queries"| node_state
node_state -->|"provides board state"| node_board
node_state -->|"provides game status"| node_panel
node_console -.->|"logic adapted from"| node_state

click node_app "https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp"
click node_board "https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp"
click node_panel "https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp"
click node_state "https://github.com/batuhancakmak4/nqueens-game/blob/main/game_logic.hpp"
click node_console "https://github.com/batuhancakmak4/nqueens-game/blob/main/nQueen_original.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_app,node_board,node_panel toneBlue
class node_state toneAmber
class node_console toneMint
class node_player toneIndigo
```

## Components

### Graphical interface

- [Game controller](https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp): `main.cpp`
- [Board display](https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp): `main.cpp`
- [Controls and status](https://github.com/batuhancakmak4/nqueens-game/blob/main/main.cpp): `main.cpp`

### Game rules

- [Game state and rules](https://github.com/batuhancakmak4/nqueens-game/blob/main/game_logic.hpp): `game_logic.hpp`

### Original console game

- [Console implementation](https://github.com/batuhancakmak4/nqueens-game/blob/main/nQueen_original.c): `nQueen_original.c`

### Other components

- **Player**

## Connections

- Player → Game controller: clicks (evidence: `README.md`)
- Game controller → Game state and rules: updates and queries (evidence: `main.cpp`)
- Game state and rules → Board display: provides board state (evidence: `main.cpp`)
- Game state and rules → Controls and status: provides game status (evidence: `main.cpp`)
- Console implementation → Game state and rules: logic adapted from (evidence: `README.md`)
