# gustavoconteudistacna/batalha_turnos architecture

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

- Interactive diagram: https://gitdiagram.com/gustavoconteudistacna/batalha_turnos
- Repository: https://github.com/gustavoconteudistacna/batalha_turnos

## Overview

The repository contains two independent terminal games, not one shared application: `desafio.py` runs a turn-based player-versus-NPC battle, while `aula4.py` runs a word-guessing game. The README documents the battle game's input, combat, and victory flow; the other game is evidenced by its source excerpt. The graph separates both workflows and shows their internal state and randomness. Both scripts are sampled in full; there are no shared modules or persistent stores.

Main entry points: [`desafio.py`](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py) (Battle Round Loop), [`aula4.py`](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py) (Guessing Loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_battle["Turn-Based Battle"]
  node_battle_player(("Player"))
  node_battle_loop["Battle Round Loop<br/>[desafio.py]"]
  node_battle_input["Action Input<br/>[desafio.py]"]
  node_battle_rng["Random NPC Action<br/>[desafio.py]"]
  node_battle_state["Combat Stats<br/>[desafio.py]"]
  node_battle_result["Winner Check<br/>[desafio.py]"]
end

subgraph group_wordgame["Word Guessing"]
  node_word_player(("Player"))
  node_word_loop["Guessing Loop<br/>[aula4.py]"]
  node_word_choice["Secret Word Choice<br/>[aula4.py]"]
  node_word_state["Guess State<br/>[aula4.py]"]
  node_word_result["Win/Loss Check<br/>[aula4.py]"]
end

node_battle_player -->|"starts game"| node_battle_loop
node_battle_loop -->|"requests action"| node_battle_input
node_battle_input -->|"returns choice"| node_battle_loop
node_battle_loop -->|"chooses NPC action"| node_battle_rng
node_battle_loop -->|"updates stats"| node_battle_state
node_battle_loop -->|"checks outcome"| node_battle_result
node_word_player -->|"starts game"| node_word_loop
node_word_loop -->|"selects word"| node_word_choice
node_word_loop -->|"records guesses"| node_word_state
node_word_loop -->|"checks outcome"| node_word_result

click node_battle_loop "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py"
click node_battle_input "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py"
click node_battle_rng "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py"
click node_battle_state "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py"
click node_battle_result "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py"
click node_word_loop "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py"
click node_word_choice "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py"
click node_word_state "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py"
click node_word_result "https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.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_battle_player,node_battle_loop,node_battle_input,node_battle_rng,node_battle_state,node_battle_result toneBlue
class node_word_player,node_word_loop,node_word_choice,node_word_state,node_word_result toneAmber
```

## Components

### Turn-Based Battle

- **Player**
- [Battle Round Loop](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py): `desafio.py`
- [Action Input](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py): `desafio.py`
- [Random NPC Action](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py): `desafio.py`
- [Combat Stats](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py): `desafio.py`
- [Winner Check](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/desafio.py): `desafio.py`

### Word Guessing

- **Player**
- [Guessing Loop](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py): `aula4.py`
- [Secret Word Choice](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py): `aula4.py`
- [Guess State](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py): `aula4.py`
- [Win/Loss Check](https://github.com/gustavoconteudistacna/batalha_turnos/blob/master/aula4.py): `aula4.py`

## Connections

- Player → Battle Round Loop: starts game (evidence: `README.md`)
- Battle Round Loop → Action Input: requests action (evidence: `desafio.py`)
- Action Input → Battle Round Loop: returns choice (evidence: `desafio.py`)
- Battle Round Loop → Random NPC Action: chooses NPC action (evidence: `desafio.py`)
- Battle Round Loop → Combat Stats: updates stats (evidence: `desafio.py`)
- Battle Round Loop → Winner Check: checks outcome (evidence: `desafio.py`)
- Player → Guessing Loop: starts game (evidence: `aula4.py`)
- Guessing Loop → Secret Word Choice: selects word (evidence: `aula4.py`)
- Guessing Loop → Guess State: records guesses (evidence: `aula4.py`)
- Guessing Loop → Win/Loss Check: checks outcome (evidence: `aula4.py`)
