# Tic Tac Toe Winner Algorithm
## Description
This project checks the winner in a 3x3 Tic Tac Toe board using a **2D Array**.
The algorithm checks:
- Rows
- Columns
- Main Diagonal
- Secondary Diagonal
- Draw condition
---
## Board Structure
| | Col 0 | Col 1 | Col 2 |
|-----|-------|-------|-------|
| Row 0 | (0,0) | (0,1) | (0,2) |
| Row 1 | (1,0) | (1,1) | (1,2) |
| Row 2 | (2,0) | (2,1) | (2,2) |
---
## Checking Algorithm
| Part | Formula | Rule |
|------|---------|------|
| Row | `board[row][col]` | Row fixed, column changes |
| Column | `board[row][col]` | Column fixed, row changes |
| Main Diagonal | `board[i][i]` | Row and column increase together |
| Secondary Diagonal | `board[i][n-1-i]` | Row increases, column decreases |
---
## Game Result
| Condition | Result |
|-----------|--------|
| 3 same symbols in row/column/diagonal | Winner |
| No winner + 9 moves completed | Draw |
| Otherwise | Continue Game |
---
## Concepts Used
- 2D Array
- Array Traversal
- Loops
- Conditions
- Index CalculationFolders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|