# daniel-penalosa/blackjack-mopi2 architecture

> Architecture diagram of the GitHub repository daniel-penalosa/blackjack-mopi2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daniel-penalosa/blackjack-mopi2
- Repository: https://github.com/daniel-penalosa/blackjack-mopi2

## Overview

Blackjack por terminal: el usuario inicia y juega una partida desde main.py; el flujo reparte cartas, solicita acciones, ejecuta el turno de la banca y muestra el resultado, permitiendo repetir. La puntuación y las reglas están separadas de la interacción de terminal. Las conexiones se basan en las llamadas visibles en los archivos fuente y en las capacidades descritas por el README.

Main entry points: [`main.py`](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/main.py) (Coordinar partida), [`juego.py`](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/juego.py) (Reglas y ganador), [`interfaz.py`](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py) (Acciones y repetición), [`cartas.py`](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/cartas.py) (Baraja y puntos)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flujo["Partida"]
  node_bucle["Bucle de partidas<br/>[main.py]"]
  node_partida["Coordinar partida<br/>[main.py]"]
end

subgraph group_reglas["Cartas y reglas"]
  node_baraja["Baraja y puntos<br/>[cartas.py]"]
  node_reparto["Reparto<br/>[juego.py]"]
  node_reglas_juego["Reglas y ganador<br/>[juego.py]"]
end

subgraph group_terminal["Interfaz terminal"]
  node_manos["Mostrar manos<br/>[interfaz.py]"]
  node_acciones["Acciones y repetición<br/>[interfaz.py]"]
  node_resultado["Mostrar resultado<br/>[interfaz.py]"]
end

node_usuario(("Jugador"))

node_usuario -->|"inicia"| node_bucle
node_bucle -->|"ejecuta"| node_partida
node_partida -->|"crea y puntúa"| node_baraja
node_partida -->|"reparte"| node_reparto
node_partida -->|"comprueba y resuelve"| node_reglas_juego
node_partida -->|"muestra"| node_manos
node_partida -->|"solicita acción"| node_acciones
node_partida -->|"presenta ganador"| node_resultado
node_reglas_juego -->|"calcula puntos"| node_baraja
node_acciones -->|"lee entrada"| node_usuario

click node_bucle "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/main.py"
click node_partida "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/main.py"
click node_baraja "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/cartas.py"
click node_reparto "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/juego.py"
click node_reglas_juego "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/juego.py"
click node_manos "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py"
click node_acciones "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py"
click node_resultado "https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py"

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_bucle,node_partida toneBlue
class node_baraja,node_reparto,node_reglas_juego toneAmber
class node_manos,node_acciones,node_resultado toneMint
class node_usuario toneIndigo
```

## Components

### Partida

- [Bucle de partidas](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/main.py): `main.py`
- [Coordinar partida](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/main.py): `main.py`

### Cartas y reglas

- [Baraja y puntos](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/cartas.py): `cartas.py`
- [Reparto](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/juego.py): `juego.py`
- [Reglas y ganador](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/juego.py): `juego.py`

### Interfaz terminal

- [Mostrar manos](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py): `interfaz.py`
- [Acciones y repetición](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py): `interfaz.py`
- [Mostrar resultado](https://github.com/daniel-penalosa/blackjack-mopi2/blob/main/interfaz.py): `interfaz.py`

### Other components

- **Jugador**

## Connections

- Jugador → Bucle de partidas: inicia (evidence: `README.md`)
- Bucle de partidas → Coordinar partida: ejecuta (evidence: `main.py`)
- Coordinar partida → Baraja y puntos: crea y puntúa (evidence: `main.py`)
- Coordinar partida → Reparto: reparte (evidence: `main.py`)
- Coordinar partida → Reglas y ganador: comprueba y resuelve (evidence: `main.py`)
- Coordinar partida → Mostrar manos: muestra (evidence: `main.py`)
- Coordinar partida → Acciones y repetición: solicita acción (evidence: `main.py`)
- Coordinar partida → Mostrar resultado: presenta ganador (evidence: `main.py`)
- Reglas y ganador → Baraja y puntos: calcula puntos (evidence: `juego.py`)
- Acciones y repetición → Jugador: lee entrada (evidence: `interfaz.py`)
