# alvarojorgeg/ejercicios3 architecture

> Architecture diagram of the GitHub repository alvarojorgeg/ejercicios3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alvarojorgeg/ejercicios3
- Repository: https://github.com/alvarojorgeg/ejercicios3

## Overview

##### Overall Structure and Project Purpose
- The project consists of multiple self-contained exercises (ejercicio1 to ejercicio4), each focused on a different problem:
- Ejercicio 1 – Implements a Tower of Hanoi-like “Puzzle de la Pirámide” using classes such as Piramide and Juego.
- Ejercicio 2 – Calculates the determinant of a matrix with a focus on recursive and iterative methods, encapsulated in the Matriz class.
- Ejercicio 3 – Manages space ships (“naves”) with classes Nave and Rally to perform operations like sorting and searching.
- Ejercicio 4 – Handles various polynomial operations through a Polinomio class.
- Additionally, there is a global entry point (main GLOBAL.py) which can be used to execute all exercises sequentially.

##### Main Components
- Additionally, have a “Global Execution Manager” (or a “Main Global”) component that triggers the sequential execution of each exercise.

##### Identifying Relationships and Data Flow
- Input data or operations flow from the main script to its classes and, where applicable, note feedback from the classes back to main (like game results or computed determinants).

##### Architectural Patterns and Principles
- Although these are relatively small modules, the design follows a separation of concerns by splitting each exercise into its own folder with a clear distinction between “main” (the controller) and “classes” (the domain logic).
- Modularity: every exercise functions as an independent module which could be later extended or integrated into larger systems.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Ejercicios by Alvaro Jorge Gonzalez Repository"
        subgraph "Global Execution Manager"
            global["Global Execution Manager<br/>(main GLOBAL.py)"]:::manager
        end

        subgraph "Ejercicio 1: Puzzle de la Pirámide"
            E1_Main["main.py"]:::script
            E1_Juego["Juego<br/>(handles game logic)"]:::class1
            E1_Piramide["Piramide<br/>(puzzle structure)"]:::class1
        end

        subgraph "Ejercicio 2: Matrix Determinant Calculator"
            E2_Main["main.py"]:::script
            E2_Matriz["Matriz<br/>(computes determinant)"]:::class2
        end

        subgraph "Ejercicio 3: Space Ships Management"
            E3_Main["main.py"]:::script
            E3_Nave["Nave<br/>(space ship operations)"]:::class3
            E3_Rally["Rally<br/>(manages naves)"]:::class3
        end

        subgraph "Ejercicio 4: Polynomial Operations"
            E4_Main["main.py"]:::script
            E4_Polinomio["Polinomio<br/>(polynomial operations)"]:::class4
        end

        global -->|"triggers"| E1_Main
        global -->|"triggers"| E2_Main
        global -->|"triggers"| E3_Main
        global -->|"triggers"| E4_Main

        E1_Main -->|"calls"| E1_Juego
        E1_Main -->|"calls"| E1_Piramide

        E2_Main -->|"processes"| E2_Matriz

        E3_Main -->|"invokes"| E3_Nave
        E3_Main -->|"invokes"| E3_Rally

        E4_Main -->|"executes"| E4_Polinomio
    end

    click global "https://github.com/alvarojorgeg/ejercicios3/blob/main/main GLOBAL.py"
    click E1_Main "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio1/main.py"
    click E1_Juego "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio1/clases/juego.py"
    click E1_Piramide "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio1/clases/piramide.py"
    click E2_Main "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio2/main.py"
    click E2_Matriz "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio2/clases/matriz.py"
    click E3_Main "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio3/main.py"
    click E3_Nave "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio3/clases/nave.py"
    click E3_Rally "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio3/clases/rally.py"
    click E4_Main "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio4/main.py"
    click E4_Polinomio "https://github.com/alvarojorgeg/ejercicios3/blob/main/ejercicio4/clases/polinomio.py"

    classDef manager fill:#f9d423,stroke:#333,stroke-width:2px;
    classDef script fill:#e0e0e0,stroke:#333,stroke-width:2px;
    classDef class1 fill:#8ecae6,stroke:#333,stroke-width:2px;
    classDef class2 fill:#a8dadc,stroke:#333,stroke-width:2px;
    classDef class3 fill:#ffb703,stroke:#333,stroke-width:2px;
    classDef class4 fill:#a29bfe,stroke:#333,stroke-width:2px;
```
