# danielriano-cpu/sweet-crush-informatica2 architecture

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

- Interactive diagram: https://gitdiagram.com/danielriano-cpu/sweet-crush-informatica2
- Repository: https://github.com/danielriano-cpu/sweet-crush-informatica2

## Overview

Sweet Crush is a console match-three game. The player chooses a board size and uses a menu to remove a tile or add/remove rows and columns; the game resolves matches and cascades, then displays board state and score. The map separates interaction, match resolution, board operations, and compact bit-level representation. Evidence is limited to the README’s product name and the sampled C++ files; no additional capabilities are documented.

Main entry points: [`main.cpp`](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/main.cpp) (Game menu), [`juego.cpp`](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/juego.cpp) (Match and cascades), [`tablero.cpp`](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/tablero.cpp) (Packed board access), [`marcador.cpp`](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/marcador.cpp) (Match markers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Console interaction"]
  node_cli["Game menu<br/>[main.cpp]"]
  node_display["State display<br/>[juego.cpp]"]
end

subgraph group_gameplay["Match gameplay"]
  node_match["Match and cascades<br/>[juego.cpp]"]
  node_markers["Match markers<br/>[marcador.cpp]"]
end

subgraph group_board["Board management"]
  node_board_ops["Board operations<br/>[tablero.cpp]"]
end

subgraph group_storage["Packed representation"]
  node_packed_board["Packed board access<br/>[tablero.cpp]"]
  node_bit_ops["Bit access<br/>[bits.cpp]"]
end

node_player(("Player"))

node_player -->|"chooses moves"| node_cli
node_cli -->|"creates or resizes"| node_board_ops
node_cli -->|"requests moves"| node_match
node_cli -->|"shows state"| node_display
node_match -->|"reads and updates"| node_board_ops
node_match -->|"marks matches"| node_markers
node_match -->|"reads and writes tiles"| node_packed_board
node_board_ops -->|"accesses cells"| node_packed_board
node_packed_board -->|"reads and writes bits"| node_bit_ops
node_markers -->|"stores marker bits"| node_bit_ops
node_display -->|"reads tiles"| node_packed_board

click node_cli "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/main.cpp"
click node_display "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/juego.cpp"
click node_match "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/juego.cpp"
click node_markers "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/marcador.cpp"
click node_board_ops "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/tablero.cpp"
click node_packed_board "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/tablero.cpp"
click node_bit_ops "https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/bits.cpp"

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_display toneBlue
class node_match,node_markers toneAmber
class node_board_ops toneMint
class node_packed_board,node_bit_ops toneRose
class node_player toneIndigo
```

## Components

### Console interaction

- [Game menu](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/main.cpp): `main.cpp`
- [State display](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/juego.cpp): `juego.cpp`

### Match gameplay

- [Match and cascades](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/juego.cpp): `juego.cpp`
- [Match markers](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/marcador.cpp): `marcador.cpp`

### Board management

- [Board operations](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/tablero.cpp): `tablero.cpp`

### Packed representation

- [Packed board access](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/tablero.cpp): `tablero.cpp`
- [Bit access](https://github.com/danielriano-cpu/sweet-crush-informatica2/blob/main/bits.cpp): `bits.cpp`

### Other components

- **Player**

## Connections

- Player → Game menu: chooses moves (evidence: `main.cpp`)
- Game menu → Board operations: creates or resizes (evidence: `main.cpp`)
- Game menu → Match and cascades: requests moves (evidence: `main.cpp`)
- Game menu → State display: shows state (evidence: `main.cpp`)
- Match and cascades → Board operations: reads and updates (evidence: `juego.cpp`)
- Match and cascades → Match markers: marks matches (evidence: `juego.cpp`)
- Match and cascades → Packed board access: reads and writes tiles (evidence: `juego.cpp`)
- Board operations → Packed board access: accesses cells (evidence: `tablero.cpp`)
- Packed board access → Bit access: reads and writes bits (evidence: `tablero.cpp`)
- Match markers → Bit access: stores marker bits (evidence: `marcador.cpp`)
- State display → Packed board access: reads tiles (evidence: `juego.cpp`)
