# mrzetyt/tic-tac-toe architecture

> Architecture diagram of the GitHub repository mrzetyt/tic-tac-toe, 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/mrzetyt/tic-tac-toe
- Repository: https://github.com/mrzetyt/tic-tac-toe

## Overview

This is a console Tic-Tac-Toe game: a user chooses whether to play, configures board size and symbols, enters alternating moves, and receives a win or draw result. Game owns the menu, input, rendering, and turn loop; Player applies a symbol to an empty cell, while Field stores the board and checks winning lines. The interfaces are a small internal contract layer. The README gives no further capabilities, and the graph reflects the sampled runtime source.

Main entry points: [`Lab1PPOIS/Game.cs`](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Game.cs) (Game flow), [`Lab1PPOIS/Field.cs`](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Field.cs) (Board state), [`Lab1PPOIS/Player.cs`](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Player.cs) (Player moves), [`Lab1PPOIS/IField.cs`](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/IField.cs) (Field contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console interaction"]
  node_game["Game flow<br/>[Game.cs]"]
end

subgraph group_gameplay["Game logic"]
  node_board[("Board state<br/>[Field.cs]")]
  node_player["Player moves<br/>[Player.cs]"]
end

subgraph group_contracts["Contracts"]
  node_field_contract["Field contract<br/>[IField.cs]"]
  node_player_contract["Player contract<br/>[IPlayer.cs]"]
end

node_user(("Player"))

node_user -->|"enters choices"| node_game
node_game -->|"creates and renders"| node_board
node_game -->|"assigns symbols; invokes moves"| node_player
node_game -->|"checks winner"| node_board
node_player -->|"checks and marks cell"| node_board
node_board -->|"implements"| node_field_contract
node_player -->|"implements"| node_player_contract

click node_game "https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Game.cs"
click node_board "https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Field.cs"
click node_player "https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Player.cs"
click node_field_contract "https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/IField.cs"
click node_player_contract "https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/IPlayer.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_game toneBlue
class node_board,node_player toneAmber
class node_field_contract,node_player_contract toneMint
class node_user toneIndigo
```

## Components

### Console interaction

- [Game flow](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Game.cs): `Lab1PPOIS/Game.cs`

### Game logic

- [Board state](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Field.cs): `Lab1PPOIS/Field.cs`
- [Player moves](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/Player.cs): `Lab1PPOIS/Player.cs`

### Contracts

- [Field contract](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/IField.cs): `Lab1PPOIS/IField.cs`
- [Player contract](https://github.com/mrzetyt/tic-tac-toe/blob/main/Lab1PPOIS/IPlayer.cs): `Lab1PPOIS/IPlayer.cs`

### Other components

- **Player**

## Connections

- Player → Game flow: enters choices (evidence: `Lab1PPOIS/Game.cs`)
- Game flow → Board state: creates and renders (evidence: `Lab1PPOIS/Game.cs`)
- Game flow → Player moves: assigns symbols; invokes moves (evidence: `Lab1PPOIS/Game.cs`)
- Game flow → Board state: checks winner (evidence: `Lab1PPOIS/Game.cs`)
- Player moves → Board state: checks and marks cell (evidence: `Lab1PPOIS/Player.cs`)
- Board state → Field contract: implements (evidence: `Lab1PPOIS/Field.cs`)
- Player moves → Player contract: implements (evidence: `Lab1PPOIS/Player.cs`)
