# adrian-utz/gameoflife architecture

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

- Interactive diagram: https://gitdiagram.com/adrian-utz/gameoflife
- Repository: https://github.com/adrian-utz/gameoflife

## Overview

This is a Java Swing implementation of Conway’s Game of Life. The workflow loads the glider pattern, initializes a grid, repeatedly applies the Life rules, and redraws the grid in a window. The sampled sources show the simulation, cell, and rendering relationships; the pattern file’s contents and any behavior of the omitted Automaton methods were not inspected.

Main entry points: [`Conway.java`](https://github.com/adrian-utz/gameoflife/blob/main/Conway.java) (Game Controller), [`GridCanvas.java`](https://github.com/adrian-utz/gameoflife/blob/main/GridCanvas.java) (Cell Grid), [`gliders.cells.txt`](https://github.com/adrian-utz/gameoflife/blob/main/gliders.cells.txt) (Glider Pattern), [`Cell.java`](https://github.com/adrian-utz/gameoflife/blob/main/Cell.java) (Cell State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulation"]
  node_conway["Game Controller<br/>[Conway.java]"]
  node_pattern["Glider Pattern<br/>[gliders.cells.txt]"]
  node_rules["Life Rules<br/>[Conway.java]"]
end

subgraph group_grid["Grid State"]
  node_gridcanvas["Cell Grid<br/>[GridCanvas.java]"]
  node_cell["Cell State<br/>[Cell.java]"]
end

subgraph group_display["Display"]
  node_window["Swing Window"]
end

node_user(("User"))

node_user -->|"starts"| node_conway
node_conway -->|"reads"| node_pattern
node_conway -->|"initializes and updates"| node_gridcanvas
node_conway -->|"applies"| node_rules
node_gridcanvas -->|"stores and draws"| node_cell
node_conway -->|"displays in"| node_window

click node_conway "https://github.com/adrian-utz/gameoflife/blob/main/Conway.java"
click node_pattern "https://github.com/adrian-utz/gameoflife/blob/main/gliders.cells.txt"
click node_rules "https://github.com/adrian-utz/gameoflife/blob/main/Conway.java"
click node_gridcanvas "https://github.com/adrian-utz/gameoflife/blob/main/GridCanvas.java"
click node_cell "https://github.com/adrian-utz/gameoflife/blob/main/Cell.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_conway,node_pattern,node_rules,node_user toneBlue
class node_gridcanvas,node_cell toneAmber
class node_window toneMint
```

## Components

### Simulation

- [Game Controller](https://github.com/adrian-utz/gameoflife/blob/main/Conway.java): `Conway.java`
- [Glider Pattern](https://github.com/adrian-utz/gameoflife/blob/main/gliders.cells.txt): `gliders.cells.txt`
- [Life Rules](https://github.com/adrian-utz/gameoflife/blob/main/Conway.java): `Conway.java`

### Grid State

- [Cell Grid](https://github.com/adrian-utz/gameoflife/blob/main/GridCanvas.java): `GridCanvas.java`
- [Cell State](https://github.com/adrian-utz/gameoflife/blob/main/Cell.java): `Cell.java`

### Display

- **Swing Window**

### Other components

- **User**

## Connections

- User → Game Controller: starts (evidence: `Conway.java`)
- Game Controller → Glider Pattern: reads (evidence: `Conway.java`)
- Game Controller → Cell Grid: initializes and updates (evidence: `Conway.java`)
- Game Controller → Life Rules: applies (evidence: `Conway.java`)
- Cell Grid → Cell State: stores and draws (evidence: `GridCanvas.java`)
- Game Controller → Swing Window: displays in (evidence: `Conway.java`)
