# itshafsa04/emulador-de-videojuegos architecture

> Architecture diagram of the GitHub repository itshafsa04/emulador-de-videojuegos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itshafsa04/emulador-de-videojuegos
- Repository: https://github.com/itshafsa04/emulador-de-videojuegos

## Overview

##### Project type and purpose
- This is a command-line “emulator” application written in Python, bundling four standalone mini-games (Number Guessing, Word Guessing, Hangman, Number 21) under a single menu interface. It’s an open-source CLI tool for entertainment.

##### File structure
- Top-level Python scripts:
- menu.py        – main entry point and game selector
- number.py      – “Adivina el número” logic
- wordguessing.py– “Adivina la palabra” logic
- hangman.py     – Hangman game logic
- Number21.py    – “Juego del Número 21” logic
- README.md      – project description, installation, usage
- LICENSE, .gitignore

##### README for additional insights
- The README describes each game’s rules, features, and command to launch.
- Number21.py contains a clear decomposition into helper functions (input validation, turn handling, restart logic).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global entities
    User["User / CLI"]:::ui

    %% Main menu
    Menu["Menu Module\n(menu.py)"]:::menu

    %% Game modules
    subgraph "Game Modules"
        direction TB
        NG["Number Guessing\n(number.py)"]:::game1
        WG["Word Guessing\n(wordguessing.py)"]:::game2
        HG["Hangman\n(hangman.py)"]:::game3
        subgraph "Number 21 Module"
            direction TB
            N21["Number21\n(Number21.py)"]:::game4
            IV["InputValidator\n(get_valid_input,\ncheck_consecutive)"]:::helper
            GE["GameEngine\n(start_game_vs_computer,\nstart_game_vs_player)"]:::helper
            ST["Strategy\n(nearest_multiple,\ncomputer_turn)"]:::helper
            CF["Control Flow\n(lose,\nreiniciar_o_salir,\nmain loop)"]:::helper
        end
    end

    %% Connections
    User -->|"python menu.py"| Menu
    Menu -->|"invoke"| NG
    Menu -->|"invoke"| WG
    Menu -->|"invoke"| HG
    Menu -->|"invoke"| N21

    NG -->|"read input / display output"| NG
    NG -->|"return to menu"| Menu

    WG -->|"read input / display output"| WG
    WG -->|"return to menu"| Menu

    HG -->|"read input / display output"| HG
    HG -->|"return to menu"| Menu

    N21 -->|"read input"| IV
    N21 -->|"start game"| GE
    GE -->|"use strategy"| ST
    GE -->|"control flow"| CF
    CF -->|"return to menu"| Menu

    %% Click Events
    click Menu "https://github.com/itshafsa04/emulador-de-videojuegos/blob/main/menu.py"
    click NG "https://github.com/itshafsa04/emulador-de-videojuegos/blob/main/number.py"
    click WG "https://github.com/itshafsa04/emulador-de-videojuegos/blob/main/wordguessing.py"
    click HG "https://github.com/itshafsa04/emulador-de-videojuegos/blob/main/hangman.py"
    click N21 "https://github.com/itshafsa04/emulador-de-videojuegos/blob/main/Number21.py"

    %% Styles
    classDef ui fill:#FFD966,stroke:#333,stroke-width:1px;
    classDef menu fill:#9DC3E6,stroke:#333,stroke-width:1px;
    classDef game1 fill:#C4D79B,stroke:#333,stroke-width:1px;
    classDef game2 fill:#A2C4C9,stroke:#333,stroke-width:1px;
    classDef game3 fill:#E06666,stroke:#333,stroke-width:1px;
    classDef game4 fill:#F4B183,stroke:#333,stroke-width:1px;
    classDef helper fill:#D9D2E9,stroke:#333,stroke-width:1px;
```
