# vaidik1n1ly/baagh-chaal architecture

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

- Interactive diagram: https://gitdiagram.com/vaidik1n1ly/baagh-chaal
- Repository: https://github.com/vaidik1n1ly/baagh-chaal

## Overview

This is a browser-based Baagh-Chaal game. The user plays by clicking board positions: the game handles goat placement and movement, tiger movement and captures, then updates the board, status, and log. The sampled source shows game state, board rendering, turn handling, move validation, capture logic, and move highlighting combined in one JavaScript file. The HTML and CSS are present in the tree, but their contents were not provided, so their specific wiring and responsibilities are not inferred.

Main entry points: [`js/game.js`](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js) (Board Interaction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game Runtime"]
  node_interaction["Board Interaction<br/>[game.js]"]
  node_state["Game State<br/>[game.js]"]
  node_rules["Move and Capture Rules<br/>[game.js]"]
end

subgraph group_presentation["Game Presentation"]
  node_board["Board Rendering<br/>[game.js]"]
  node_status["Status and Log<br/>[game.js]"]
  node_page["Game Page<br/>[index.html]"]
  node_styles["Game Styles<br/>[style.css]"]
end

node_player(("Player"))

node_player -->|"clicks board"| node_interaction
node_interaction -->|"updates state"| node_state
node_interaction -->|"checks moves"| node_rules
node_interaction -->|"refreshes display"| node_board
node_interaction -->|"updates status"| node_status
node_board -->|"renders pieces"| node_state
node_status -->|"displays counts"| node_state

click node_interaction "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js"
click node_state "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js"
click node_rules "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js"
click node_board "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js"
click node_status "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js"
click node_page "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/index.html"
click node_styles "https://github.com/vaidik1n1ly/baagh-chaal/blob/main/css/style.css"

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_interaction,node_state,node_rules toneBlue
class node_board,node_status,node_page,node_styles toneAmber
class node_player toneIndigo
```

## Components

### Game Runtime

- [Board Interaction](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js): `js/game.js`
- [Game State](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js): `js/game.js`
- [Move and Capture Rules](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js): `js/game.js`

### Game Presentation

- [Board Rendering](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js): `js/game.js`
- [Status and Log](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/js/game.js): `js/game.js`
- [Game Page](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/index.html): `index.html`
- [Game Styles](https://github.com/vaidik1n1ly/baagh-chaal/blob/main/css/style.css): `css/style.css`

### Other components

- **Player**

## Connections

- Player → Board Interaction: clicks board (evidence: `js/game.js`)
- Board Interaction → Game State: updates state (evidence: `js/game.js`)
- Board Interaction → Move and Capture Rules: checks moves (evidence: `js/game.js`)
- Board Interaction → Board Rendering: refreshes display (evidence: `js/game.js`)
- Board Interaction → Status and Log: updates status (evidence: `js/game.js`)
- Board Rendering → Game State: renders pieces (evidence: `js/game.js`)
- Status and Log → Game State: displays counts (evidence: `js/game.js`)
