# silent-watcher/cli-word-guessing-game architecture

> Architecture diagram of the GitHub repository silent-watcher/cli-word-guessing-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/silent-watcher/cli-word-guessing-game
- Repository: https://github.com/silent-watcher/cli-word-guessing-game

## Overview

This Node.js CLI runs a letter-by-letter word guessing game. A player launches the entry point, sees the introduction, chooses whether to start, and then guesses letters against a randomly selected configured word. The game updates the displayed word and ends with a win or exhausted-attempts message. Runtime behavior is concentrated in index.js, with the word list and attempt limit in config.js; the graph separates those stages for clarity.

Main entry points: [`index.js`](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js) (Game entry point), [`config.js`](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/config.js) (Word settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_game["Game entry point<br/>[index.js]"]
  node_intro["Welcome display<br/>[index.js]"]
  node_start["Start prompt<br/>[index.js]"]
  node_settings["Word settings<br/>[config.js]"]
  node_selection["Word selection<br/>[index.js]"]
  node_guess["Guess handling<br/>[index.js]"]
  node_board["Word display<br/>[index.js]"]
  node_outcome["Game outcome<br/>[index.js]"]
end

node_player(("Player"))

node_player -->|"launches"| node_game
node_game -->|"displays"| node_intro
node_game -->|"prompts"| node_start
node_game -->|"imports"| node_settings
node_game -->|"chooses"| node_selection
node_selection -->|"initializes"| node_board
node_game -->|"requests"| node_guess
node_guess -->|"updates"| node_board
node_game -->|"checks"| node_outcome

click node_game "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_intro "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_start "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_settings "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/config.js"
click node_selection "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_guess "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_board "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"
click node_outcome "https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js"

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_game,node_intro,node_start,node_settings,node_selection,node_guess,node_board,node_outcome toneBlue
class node_player toneIndigo
```

## Components

### Game runtime

- [Game entry point](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Welcome display](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Start prompt](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Word settings](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/config.js): `config.js`
- [Word selection](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Guess handling](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Word display](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`
- [Game outcome](https://github.com/silent-watcher/cli-word-guessing-game/blob/master/index.js): `index.js`

### Other components

- **Player**

## Connections

- Player → Game entry point: launches (evidence: `README.md`)
- Game entry point → Welcome display: displays (evidence: `index.js`)
- Game entry point → Start prompt: prompts (evidence: `index.js`)
- Game entry point → Word settings: imports (evidence: `index.js`)
- Game entry point → Word selection: chooses (evidence: `index.js`)
- Word selection → Word display: initializes (evidence: `index.js`)
- Game entry point → Guess handling: requests (evidence: `index.js`)
- Guess handling → Word display: updates (evidence: `index.js`)
- Game entry point → Game outcome: checks (evidence: `index.js`)
