# anirbansahaargho/hangman-game architecture

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

- Interactive diagram: https://gitdiagram.com/anirbansahaargho/hangman-game
- Repository: https://github.com/anirbansahaargho/hangman-game

## Overview

This is a small, single-file interactive Hangman game. The main workflow collects a player name and difficulty, accepts a custom set of words, hints, and revealed positions, then runs letter-by-letter rounds until all words are solved or six wrong guesses are reached. The README documents three difficulty levels and Windows console feedback; all sampled implementation is in hangman.c.

Main entry points: [`hangman.c`](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c) (Word Round)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Game Setup"]
  node_main["Game Coordinator<br/>[hangman.c]"]
  node_difficulty["Difficulty Selection<br/>[hangman.c]"]
  node_word_setup["Custom Word Setup<br/>[hangman.c]"]
  node_word_data[("Words and Hints<br/>[hangman.c]")]
end

subgraph group_play["Gameplay"]
  node_round["Word Round<br/>[hangman.c]"]
  node_reveal["Initial Reveals<br/>[hangman.c]"]
  node_guess["Guess Evaluation<br/>[hangman.c]"]
  node_progress["Word Progress<br/>[hangman.c]"]
  node_hangman["Hangman Display<br/>[hangman.c]"]
  node_feedback["Console Feedback<br/>[hangman.c]"]
end

node_player(("Player"))
node_windows["Windows Console APIs"]

node_player -->|"starts game"| node_main
node_main -->|"requests name"| node_player
node_main -->|"selects mode"| node_difficulty
node_player -->|"chooses mode"| node_difficulty
node_difficulty -->|"sets word count"| node_main
node_main -->|"requests entries"| node_word_setup
node_player -->|"enters words"| node_word_setup
node_word_setup -->|"stores entries"| node_word_data
node_main -->|"runs rounds"| node_round
node_round -->|"reads word and hint"| node_word_data
node_round -->|"initializes display"| node_reveal
node_reveal -->|"sets revealed letters"| node_progress
node_round -->|"draws current state"| node_hangman
node_round -->|"displays word"| node_progress
node_round -->|"requests guess"| node_player
node_player -->|"enters letter"| node_guess
node_round -->|"checks guess"| node_guess
node_guess -->|"updates letters"| node_progress
node_guess -->|"reports outcome"| node_feedback
node_round -->|"reports round result"| node_feedback
node_feedback -.->|"beeps and pauses"| node_windows
node_main -.->|"clears screen"| node_windows

click node_main "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_difficulty "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_word_setup "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_word_data "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_round "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_reveal "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_guess "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_progress "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_hangman "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c"
click node_feedback "https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.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_difficulty,node_word_setup,node_word_data toneBlue
class node_round,node_reveal,node_guess,node_progress,node_hangman,node_feedback toneAmber
class node_player toneIndigo
class node_windows toneMint
```

## Components

### Game Setup

- [Game Coordinator](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Difficulty Selection](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Custom Word Setup](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Words and Hints](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`

### Gameplay

- [Word Round](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Initial Reveals](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Guess Evaluation](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Word Progress](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Hangman Display](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`
- [Console Feedback](https://github.com/anirbansahaargho/hangman-game/blob/main/hangman.c): `hangman.c`

### Other components

- **Player**
- **Windows Console APIs**

## Connections

- Player → Game Coordinator: starts game
- Game Coordinator → Player: requests name
- Game Coordinator → Difficulty Selection: selects mode
- Player → Difficulty Selection: chooses mode
- Difficulty Selection → Game Coordinator: sets word count
- Game Coordinator → Custom Word Setup: requests entries
- Player → Custom Word Setup: enters words
- Custom Word Setup → Words and Hints: stores entries
- Game Coordinator → Word Round: runs rounds
- Word Round → Words and Hints: reads word and hint
- Word Round → Initial Reveals: initializes display
- Initial Reveals → Word Progress: sets revealed letters
- Word Round → Hangman Display: draws current state
- Word Round → Word Progress: displays word
- Word Round → Player: requests guess
- Player → Guess Evaluation: enters letter
- Word Round → Guess Evaluation: checks guess
- Guess Evaluation → Word Progress: updates letters
- Guess Evaluation → Console Feedback: reports outcome
- Word Round → Console Feedback: reports round result
- Console Feedback → Windows Console APIs: beeps and pauses
- Game Coordinator → Windows Console APIs: clears screen
