# janosfalke/yahtzee-in-c-sharp architecture

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

- Interactive diagram: https://gitdiagram.com/janosfalke/yahtzee-in-c-sharp
- Repository: https://github.com/janosfalke/yahtzee-in-c-sharp

## Overview

This is a Windows Forms Yahtzee game for playing one to four games at once. The player starts a game, rolls and keeps dice over up to three attempts, chooses an available scoring category and game card (or crosses out a category), and views end-of-game totals and scoreboard statistics. The sampled code shows UI orchestration, game-card scoring, and category value objects; dice handling and several UI details are only partially sampled, so those flows are included only where documented. There is no external persistence or service shown.

Main entry points: [`Yahtzee_UI/UI.cs`](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/UI.cs) (Game controller), [`Yahtzee_UI/GameCard.cs`](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/GameCard.cs) (Game card), [`Yahtzee_UI/Program.cs`](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Program.cs) (App startup), [`Yahtzee_UI/Item.cs`](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Item.cs) (Choice items)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Game UI"]
  node_startup["App startup<br/>[Program.cs]"]
  node_gameui["Game controller<br/>[UI.cs]"]
  node_choices["Choice items<br/>[Item.cs]"]
end

subgraph group_rules["Scoring"]
  node_gamecard["Game card<br/>[GameCard.cs]"]
  node_fullhouse["Full house<br/>[FullHouse.cs]"]
  node_smallstreet["Small straight<br/>[SmallStreet.cs]"]
  node_largestreet["Large straight<br/>[LargeStreet.cs]"]
  node_yahtzee["Yahtzee category<br/>[Yahtzee.cs]"]
end

subgraph group_results["Results"]
  node_scoreform["Scoreboard window<br/>[ScoreForm.cs]"]
  node_scorerecord["Game statistics<br/>[Score.cs]"]
end

node_player(("Player"))

node_player -->|"plays"| node_gameui
node_startup -->|"launches"| node_gameui
node_gameui -->|"creates and scores"| node_gamecard
node_gameui -->|"uses selections"| node_choices
node_gamecard -->|"initializes"| node_fullhouse
node_gamecard -->|"initializes"| node_smallstreet
node_gamecard -->|"initializes"| node_largestreet
node_gamecard -->|"initializes"| node_yahtzee
node_gameui -->|"opens"| node_scoreform
node_gameui -->|"creates records"| node_scorerecord

click node_startup "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Program.cs"
click node_gameui "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/UI.cs"
click node_choices "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Item.cs"
click node_gamecard "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/GameCard.cs"
click node_fullhouse "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/FullHouse.cs"
click node_smallstreet "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/SmallStreet.cs"
click node_largestreet "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/LargeStreet.cs"
click node_yahtzee "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Yahtzee.cs"
click node_scoreform "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/ScoreForm.cs"
click node_scorerecord "https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Score.cs"

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_startup,node_gameui,node_choices toneBlue
class node_gamecard,node_fullhouse,node_smallstreet,node_largestreet,node_yahtzee toneAmber
class node_scoreform,node_scorerecord toneMint
class node_player toneIndigo
```

## Components

### Game UI

- [App startup](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Program.cs): `Yahtzee_UI/Program.cs`
- [Game controller](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/UI.cs): `Yahtzee_UI/UI.cs`
- [Choice items](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Item.cs): `Yahtzee_UI/Item.cs`

### Scoring

- [Game card](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/GameCard.cs): `Yahtzee_UI/GameCard.cs`
- [Full house](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/FullHouse.cs): `Yahtzee_UI/FullHouse.cs`
- [Small straight](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/SmallStreet.cs): `Yahtzee_UI/SmallStreet.cs`
- [Large straight](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/LargeStreet.cs): `Yahtzee_UI/LargeStreet.cs`
- [Yahtzee category](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Yahtzee.cs): `Yahtzee_UI/Yahtzee.cs`

### Results

- [Scoreboard window](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/ScoreForm.cs): `Yahtzee_UI/ScoreForm.cs`
- [Game statistics](https://github.com/janosfalke/yahtzee-in-c-sharp/blob/master/Yahtzee_UI/Score.cs): `Yahtzee_UI/Score.cs`

### Other components

- **Player**

## Connections

- Player → Game controller: plays (evidence: `README.md`)
- App startup → Game controller: launches (evidence: `Yahtzee_UI/Program.cs`)
- Game controller → Game card: creates and scores (evidence: `Yahtzee_UI/UI.cs`)
- Game controller → Choice items: uses selections (evidence: `Yahtzee_UI/UI.cs`)
- Game card → Full house: initializes (evidence: `Yahtzee_UI/GameCard.cs`)
- Game card → Small straight: initializes (evidence: `Yahtzee_UI/GameCard.cs`)
- Game card → Large straight: initializes (evidence: `Yahtzee_UI/GameCard.cs`)
- Game card → Yahtzee category: initializes (evidence: `Yahtzee_UI/GameCard.cs`)
- Game controller → Scoreboard window: opens (evidence: `Yahtzee_UI/UI.cs`)
- Game controller → Game statistics: creates records (evidence: `Yahtzee_UI/UI.cs`)
