# adithyakgowda10/sliding-puzzle-game architecture

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

- Interactive diagram: https://gitdiagram.com/adithyakgowda10/sliding-puzzle-game
- Repository: https://github.com/adithyakgowda10/sliding-puzzle-game

## Overview

This is a standalone Swing sliding-puzzle game. The main workflow is a player starting or selecting a puzzle, moving tiles through the board UI, and receiving gameplay tracking and a victory result. PuzzleLogic owns board state, solvable shuffling, and solution paths; GameBoard renders the state and captures input. The README documents additional image, daily-challenge, clue, and scoring features implemented within the main window. Several links for those features rely on README documentation because the relevant source sections were not sampled.

Main entry points: [`src/SlidingPuzzle.java`](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java) (Gameplay controls), [`src/GameBoard.java`](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameBoard.java) (Tile board), [`src/PuzzleLogic.java`](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java) (Puzzle rules), [`src/GameServices.java`](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameServices.java) (Sound effects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_window["Game window"]
  node_main["Game window<br/>[SlidingPuzzle.java]"]
  node_game_setup["Game setup<br/>[SlidingPuzzle.java]"]
  node_gameplay["Gameplay controls<br/>[SlidingPuzzle.java]"]
  node_image_gallery["Image gallery<br/>[SlidingPuzzle.java]"]
  node_daily["Daily challenge<br/>[SlidingPuzzle.java]"]
  node_scoring["Victory and records<br/>[SlidingPuzzle.java]"]
  node_progress[("Saved progress")]
end

subgraph group_engine["Puzzle engine"]
  node_logic["Puzzle rules<br/>[PuzzleLogic.java]"]
  node_shuffle["Solvable shuffle<br/>[PuzzleLogic.java]"]
  node_solver["Puzzle solver<br/>[PuzzleLogic.java]"]
end

subgraph group_board["Board interface"]
  node_board["Tile board<br/>[GameBoard.java]"]
  node_tile_view["Tile rendering<br/>[GameBoard.java]"]
end

subgraph group_services["Gameplay services"]
  node_timer["Game timer<br/>[GameServices.java]"]
  node_sound["Sound effects<br/>[GameServices.java]"]
end

node_player(("Player"))
node_java_sound["Java Sound"]

node_player -->|"uses"| node_main
node_main -->|"offers"| node_game_setup
node_game_setup -->|"starts puzzle"| node_shuffle
node_main -->|"displays"| node_board
node_board -->|"reads board state"| node_logic
node_board -->|"renders tiles"| node_tile_view
node_player -->|"moves tiles"| node_board
node_board -.->|"reports input"| node_gameplay
node_gameplay -->|"moves tiles"| node_logic
node_gameplay -->|"starts and pauses"| node_timer
node_gameplay -->|"plays effects"| node_sound
node_gameplay -->|"requests solution"| node_solver
node_solver -->|"returns moves"| node_gameplay
node_gameplay -->|"reports victory"| node_scoring
node_main -->|"manages images"| node_image_gallery
node_image_gallery -->|"sets puzzle image"| node_board
node_main -->|"offers challenge"| node_daily
node_daily -->|"seeds board"| node_shuffle
node_daily -->|"saves records"| node_progress
node_scoring -->|"saves best"| node_progress
node_logic -->|"generates board"| node_shuffle
node_sound -->|"synthesizes audio"| node_java_sound

click node_main "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_game_setup "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_gameplay "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_image_gallery "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_daily "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_scoring "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java"
click node_logic "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java"
click node_shuffle "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java"
click node_solver "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java"
click node_board "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameBoard.java"
click node_tile_view "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameBoard.java"
click node_timer "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameServices.java"
click node_sound "https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameServices.java"

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_game_setup,node_gameplay,node_image_gallery,node_daily,node_scoring,node_progress toneBlue
class node_logic,node_shuffle,node_solver toneAmber
class node_board,node_tile_view toneMint
class node_timer,node_sound toneRose
class node_player,node_java_sound toneIndigo
```

## Components

### Game window

- [Game window](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- [Game setup](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- [Gameplay controls](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- [Image gallery](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- [Daily challenge](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- [Victory and records](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/SlidingPuzzle.java): `src/SlidingPuzzle.java`
- **Saved progress**

### Puzzle engine

- [Puzzle rules](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java): `src/PuzzleLogic.java`
- [Solvable shuffle](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java): `src/PuzzleLogic.java`
- [Puzzle solver](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/PuzzleLogic.java): `src/PuzzleLogic.java`

### Board interface

- [Tile board](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameBoard.java): `src/GameBoard.java`
- [Tile rendering](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameBoard.java): `src/GameBoard.java`

### Gameplay services

- [Game timer](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameServices.java): `src/GameServices.java`
- [Sound effects](https://github.com/adithyakgowda10/sliding-puzzle-game/blob/main/src/GameServices.java): `src/GameServices.java`

### Other components

- **Player**
- **Java Sound**

## Connections

- Player → Game window: uses (evidence: `README.md`)
- Game window → Game setup: offers (evidence: `README.md`)
- Game setup → Solvable shuffle: starts puzzle (evidence: `README.md`)
- Game window → Tile board: displays (evidence: `README.md`)
- Tile board → Puzzle rules: reads board state (evidence: `src/GameBoard.java`)
- Tile board → Tile rendering: renders tiles (evidence: `src/GameBoard.java`)
- Player → Tile board: moves tiles (evidence: `README.md`)
- Tile board → Gameplay controls: reports input (evidence: `src/SlidingPuzzle.java`)
- Gameplay controls → Puzzle rules: moves tiles (evidence: `README.md`)
- Gameplay controls → Game timer: starts and pauses (evidence: `README.md`)
- Gameplay controls → Sound effects: plays effects (evidence: `README.md`)
- Gameplay controls → Puzzle solver: requests solution (evidence: `README.md`)
- Puzzle solver → Gameplay controls: returns moves (evidence: `README.md`)
- Gameplay controls → Victory and records: reports victory (evidence: `README.md`)
- Game window → Image gallery: manages images (evidence: `README.md`)
- Image gallery → Tile board: sets puzzle image (evidence: `README.md`)
- Game window → Daily challenge: offers challenge (evidence: `README.md`)
- Daily challenge → Solvable shuffle: seeds board (evidence: `README.md`)
- Daily challenge → Saved progress: saves records (evidence: `README.md`)
- Victory and records → Saved progress: saves best (evidence: `README.md`)
- Puzzle rules → Solvable shuffle: generates board (evidence: `src/PuzzleLogic.java`)
- Sound effects → Java Sound: synthesizes audio (evidence: `src/GameServices.java`)
