# alvarojorgeg/ejercicio-algoritmos architecture

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

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

## Overview

##### Main Components
- Component for Ejercicio 1 – “Movimiento Caballo”
- Main module: ejercicio1/main.py (entry point for execution)
- Business logic: ejercicio1/clases/logica.py (contains the MovimientoCaballo class with the movimientos_validos method)
- Component for Ejercicio 2 – “Problema de las N-Reinas”
- Main module: ejercicio2/main.py (entry point for execution)
- Business logic: ejercicio2/clases/logica.py (contains the NReinas class with métodos such as resolver, colocar, and es_valido)
- Global Component Consideration:
- There is a “main GLOBAL.py” file at the repository root which might be used for orchestrating or testing the overall functionality, although its purpose is not explicitly explained in the README.

##### Depicting Relationships and Interactions
- Separate application flows – one for each exercise.
- Create distinct blocks for Ejercicio 1 and Ejercicio 2:

##### Architectural Patterns and Design Principles
- Simple modular separation where each exercise is independently executable.
- Use of separation of concerns: main modules handle execution and user input, and the “clases” directories encapsulate the business logic.
- That the design follows a basic layered architecture even though it’s a command-line Python application; this might be useful when discussing how responsibilities are organized.

##### Relevant Technologies and Frameworks
- This project is implemented entirely in Python (requires Python 3.10 or higher).

## Diagram (Mermaid)

```mermaid
flowchart TD
    GlobalMain["main GLOBAL.py"]
    
    subgraph "Ejercicio 1 - Movimiento del Caballo"
        E1Main["ejercicio1/main.py"]
        E1Logic(("ejercicio1/clases/logica.py"))
    end

    subgraph "Ejercicio 2 - Problema de las N-Reinas"
        E2Main["ejercicio2/main.py"]
        E2Logic(("ejercicio2/clases/logica.py"))
    end

    GlobalMain -->|"triggers"| E1Main
    GlobalMain -->|"triggers"| E2Main
    E1Main -->|"invokes"| E1Logic
    E2Main -->|"invokes"| E2Logic

    click GlobalMain "https://github.com/alvarojorgeg/ejercicio-algoritmos/blob/main/main GLOBAL.py"
    click E1Main "https://github.com/alvarojorgeg/ejercicio-algoritmos/blob/main/ejercicio1/main.py"
    click E1Logic "https://github.com/alvarojorgeg/ejercicio-algoritmos/blob/main/ejercicio1/clases/logica.py"
    click E2Main "https://github.com/alvarojorgeg/ejercicio-algoritmos/blob/main/ejercicio2/main.py"
    click E2Logic "https://github.com/alvarojorgeg/ejercicio-algoritmos/blob/main/ejercicio2/clases/logica.py"

    classDef globalStyle fill:#ffcccc,stroke:#333,stroke-width:2px;
    classDef ejercicio1MainStyle fill:#aed6f1,stroke:#333,stroke-width:2px;
    classDef ejercicio1LogicStyle fill:#d4efdf,stroke:#333,stroke-width:2px;
    classDef ejercicio2MainStyle fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef ejercicio2LogicStyle fill:#f5cba7,stroke:#333,stroke-width:2px;

    class GlobalMain globalStyle;
    class E1Main ejercicio1MainStyle;
    class E1Logic ejercicio1LogicStyle;
    class E2Main ejercicio2MainStyle;
    class E2Logic ejercicio2LogicStyle;
```
