# pacutacatete100/connect5botvbot architecture

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

- Interactive diagram: https://gitdiagram.com/pacutacatete100/connect5botvbot
- Repository: https://github.com/pacutacatete100/connect5botvbot

## Overview

This is a Connect Five game with reusable board rules, human-facing command-line and Tkinter interfaces, heuristic bots, and a separate Pygame bot-versus-bot/simulation environment. In the main play flow, a player supplies a move through a controller or GUI, the game validates it and checks for a result, and an optional bot selects moves and receives move updates. Game states can be serialized, with GameIO providing line-based file persistence. The README is empty; connections for the simulation and training-oriented environment reflect their source implementations.

Main entry points: [`GameBot.py`](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameBot.py) (Heuristic Bot), [`GameController.py`](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameController.py) (CLI Controller), [`Game.py`](https://github.com/pacutacatete100/connect5botvbot/blob/master/Game.py) (Board And Rules), [`GameGUI.py`](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameGUI.py) (Tkinter GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Play Interfaces"]
  node_cli["CLI Controller<br/>[GameController.py]"]
  node_gui["Tkinter GUI<br/>[GameGUI.py]"]
  node_main["Examples And Imports<br/>[main.py]"]
end

subgraph group_rules["Game Rules"]
  node_game["Board And Rules<br/>[Game.py]"]
end

subgraph group_ai["Bots And Simulation"]
  node_bot["Heuristic Bot<br/>[GameBot.py]"]
  node_botvbot["Bot Simulation<br/>[BotvBot.py]"]
  node_agent["Training Environment<br/>[agent.py]"]
end

subgraph group_storage["Saved Games"]
  node_gameio["Game File I/O<br/>[GameIO.py]"]
  node_gamedata[("Saved Game Records<br/>[GameData.txt]")]
end

node_player(("Player"))

node_player -->|"enters moves"| node_cli
node_cli -->|"places moves"| node_game
node_cli -->|"requests moves"| node_bot
node_player -->|"clicks board"| node_gui
node_gui -->|"places moves"| node_game
node_gui -->|"requests moves"| node_bot
node_bot -->|"reads board"| node_game
node_botvbot -->|"requests moves"| node_bot
node_botvbot -->|"updates moves"| node_bot
node_agent -->|"implements rules"| node_game
node_gameio -->|"reads and writes"| node_gamedata
node_main -->|"imports controller"| node_cli
node_main -->|"imports I/O"| node_gameio

click node_cli "https://github.com/pacutacatete100/connect5botvbot/blob/master/GameController.py"
click node_gui "https://github.com/pacutacatete100/connect5botvbot/blob/master/GameGUI.py"
click node_main "https://github.com/pacutacatete100/connect5botvbot/blob/master/main.py"
click node_game "https://github.com/pacutacatete100/connect5botvbot/blob/master/Game.py"
click node_bot "https://github.com/pacutacatete100/connect5botvbot/blob/master/GameBot.py"
click node_botvbot "https://github.com/pacutacatete100/connect5botvbot/blob/master/BotvBot.py"
click node_agent "https://github.com/pacutacatete100/connect5botvbot/blob/master/agent.py"
click node_gameio "https://github.com/pacutacatete100/connect5botvbot/blob/master/GameIO.py"
click node_gamedata "https://github.com/pacutacatete100/connect5botvbot/blob/master/GameData.txt"

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_cli,node_gui,node_main toneBlue
class node_game toneAmber
class node_bot,node_botvbot,node_agent toneMint
class node_gameio,node_gamedata toneRose
class node_player toneIndigo
```

## Components

### Play Interfaces

- [CLI Controller](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameController.py): `GameController.py`
- [Tkinter GUI](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameGUI.py): `GameGUI.py`
- [Examples And Imports](https://github.com/pacutacatete100/connect5botvbot/blob/master/main.py): `main.py`

### Game Rules

- [Board And Rules](https://github.com/pacutacatete100/connect5botvbot/blob/master/Game.py): `Game.py`

### Bots And Simulation

- [Heuristic Bot](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameBot.py): `GameBot.py`
- [Bot Simulation](https://github.com/pacutacatete100/connect5botvbot/blob/master/BotvBot.py): `BotvBot.py`
- [Training Environment](https://github.com/pacutacatete100/connect5botvbot/blob/master/agent.py): `agent.py`

### Saved Games

- [Game File I/O](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameIO.py): `GameIO.py`
- [Saved Game Records](https://github.com/pacutacatete100/connect5botvbot/blob/master/GameData.txt): `GameData.txt`

### Other components

- **Player**

## Connections

- Player → CLI Controller: enters moves (evidence: `GameController.py`)
- CLI Controller → Board And Rules: places moves (evidence: `GameController.py`)
- CLI Controller → Heuristic Bot: requests moves (evidence: `GameController.py`)
- Player → Tkinter GUI: clicks board (evidence: `GameGUI.py`)
- Tkinter GUI → Board And Rules: places moves (evidence: `GameGUI.py`)
- Tkinter GUI → Heuristic Bot: requests moves (evidence: `GameGUI.py`)
- Heuristic Bot → Board And Rules: reads board (evidence: `GameBot.py`)
- Bot Simulation → Heuristic Bot: requests moves (evidence: `BotvBot.py`)
- Bot Simulation → Heuristic Bot: updates moves (evidence: `BotvBot.py`)
- Training Environment → Board And Rules: implements rules (evidence: `agent.py`)
- Game File I/O → Saved Game Records: reads and writes (evidence: `GameIO.py`)
- Examples And Imports → CLI Controller: imports controller (evidence: `main.py`)
- Examples And Imports → Game File I/O: imports I/O (evidence: `main.py`)
