# mykedev-iw/totito architecture

> Architecture diagram of the GitHub repository mykedev-iw/totito, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mykedev-iw/totito
- Repository: https://github.com/mykedev-iw/totito

## Overview

Totito is a Java Swing tic-tac-toe game where a player competes against the computer. The single source file combines the interface, board and match state, computer strategy, and match history. The visible excerpts show minimax recursion, win detection, and saving history when a game ends. Because the README is empty and the source excerpts omit several interaction handlers, the graph keeps the implementation compact and avoids guessing at the full turn-dispatch flow.

Main entry points: [`src/main/java/com/miguel/totito/Totito.java`](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java) (Computer strategy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game logic"]
  node_board["Board and match state<br/>[Totito.java]"]
  node_computer["Computer strategy<br/>[Totito.java]"]
  node_wincheck["Win detection<br/>[Totito.java]"]
end

subgraph group_interface["Swing interface"]
  node_app["Totito app<br/>[Totito.java]"]
end

subgraph group_history["Match history"]
  node_historyui["History display<br/>[Totito.java]"]
  node_historyfile[("History file<br/>[Totito.java]")]
end

node_player(("Player"))

node_app -->|"starts on EDT"| node_app
node_computer -->|"recurses minimax"| node_computer
node_computer -->|"checks wins"| node_wincheck
node_board -->|"saves results"| node_historyfile

click node_app "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java"
click node_board "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java"
click node_computer "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java"
click node_wincheck "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java"
click node_historyui "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java"
click node_historyfile "https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.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_board,node_computer,node_wincheck toneBlue
class node_app toneAmber
class node_historyui,node_historyfile toneMint
class node_player toneIndigo
```

## Components

### Game logic

- [Board and match state](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`
- [Computer strategy](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`
- [Win detection](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`

### Swing interface

- [Totito app](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`

### Match history

- [History display](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`
- [History file](https://github.com/mykedev-iw/totito/blob/main/src/main/java/com/miguel/totito/Totito.java): `src/main/java/com/miguel/totito/Totito.java`

### Other components

- **Player**

## Connections

- Totito app → Totito app: starts on EDT (evidence: `src/main/java/com/miguel/totito/Totito.java`)
- Computer strategy → Computer strategy: recurses minimax (evidence: `src/main/java/com/miguel/totito/Totito.java`)
- Computer strategy → Win detection: checks wins (evidence: `src/main/java/com/miguel/totito/Totito.java`)
- Board and match state → History file: saves results (evidence: `src/main/java/com/miguel/totito/Totito.java`)
