# xandaokruger/common-core architecture

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

- Interactive diagram: https://gitdiagram.com/xandaokruger/common-core
- Repository: https://github.com/xandaokruger/common-core

## Overview

This repository is a collection of 42-school projects rather than one integrated application: C utility libraries, a stack-sorting program, a maze generator/viewer, and independent Python exercises. The clearest end-to-end workflow is push_swap: read command-line input, initialize stacks, select and run a strategy, then free resources. The maze project separately generates and renders mazes. Relationships for unsampled implementations are omitted; the graph uses the provided excerpts and SOURCE INDEX, not assumptions about sibling modules.

Main entry points: [`Milestone1/push_swap/srcs/main.c`](https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/main.c) (Program entry), [`Milestone2/A_maze_ing/a_maze_ing.py`](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/a_maze_ing.py) (Application entry), [`Milestone2/A_maze_ing/mazegen/generator.py`](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/mazegen/generator.py) (Generate and solve), [`Milestone2/A_maze_ing/view/menu.py`](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/view/menu.py) (Interactive menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cutils["C Utilities"]
  node_libft_original["Original libft"]
  node_libft_extended["Extended libft"]
  node_gnl["Line reader<br/>[get_next_line.c]"]
  node_printf["Formatter<br/>[ft_printf.c]"]
  node_printf_helpers["Format helpers"]
end

subgraph group_sorting["Stack Sorting"]
  node_ps_main["Program entry<br/>[main.c]"]
  node_ps_init["Input and setup<br/>[push_swap.c]"]
  node_ps_flags["Strategy selection<br/>[flags.c]"]
  node_ps_stacks["Stack state<br/>[stack.c]"]
  node_ps_algorithms["Sorting algorithms"]
  node_ps_operations["Stack operations"]
  node_ps_libft["Bundled libft"]
end

subgraph group_maze["Maze Application"]
  node_maze_entry["Application entry<br/>[a_maze_ing.py]"]
  node_maze_config["Maze configuration<br/>[config.py]"]
  node_generator["Generate and solve<br/>[generator.py]"]
  node_glyphs["Maze glyphs<br/>[glyphs.py]"]
  node_menu["Interactive menu<br/>[menu.py]"]
  node_render["Maze renderer<br/>[render.py]"]
end

subgraph group_python["Python Projects"]
  node_py_exercises["Python exercises"]
  node_alchemy["Alchemy exercises"]
  node_creature_tournament["Creature tournament<br/>[tournament.py]"]
end

node_user(("CLI user"))
node_maze_user(("Maze user"))

node_user -->|"runs"| node_ps_main
node_ps_main -->|"initializes input"| node_ps_init
node_ps_main -->|"sets up stacks"| node_ps_stacks
node_ps_main -->|"executes strategy"| node_ps_flags
node_user -->|"runs"| node_maze_entry
node_maze_entry -->|"imports"| node_maze_config
node_maze_entry -->|"imports package"| node_generator
node_maze_entry -->|"imports view"| node_menu
node_generator -->|"uses glyphs"| node_glyphs
node_menu -->|"uses generator"| node_generator
node_menu -->|"uses renderer"| node_render
node_render -->|"reads maze"| node_generator
node_printf -->|"dispatches specs"| node_printf_helpers
node_creature_tournament -->|"imports creature packages"| node_py_exercises
node_creature_tournament -.-> node_alchemy

click node_libft_original "https://github.com/xandaokruger/common-core/tree/main/Milestone0/LIBFT_ORIGINAL"
click node_libft_extended "https://github.com/xandaokruger/common-core/tree/main/Milestone0/libft_modificado"
click node_gnl "https://github.com/xandaokruger/common-core/blob/main/Milestone1/get_next_line/get_next_line.c"
click node_printf "https://github.com/xandaokruger/common-core/blob/main/Milestone1/printf/ft_printf.c"
click node_printf_helpers "https://github.com/xandaokruger/common-core/tree/main/Milestone1/printf"
click node_ps_main "https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/main.c"
click node_ps_init "https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/push_swap.c"
click node_ps_flags "https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/flags.c"
click node_ps_stacks "https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/stack.c"
click node_ps_algorithms "https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/algorithm"
click node_ps_operations "https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/operations"
click node_ps_libft "https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/libft"
click node_maze_entry "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/a_maze_ing.py"
click node_maze_config "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/config.py"
click node_generator "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/mazegen/generator.py"
click node_glyphs "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/mazegen/glyphs.py"
click node_menu "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/view/menu.py"
click node_render "https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/view/render.py"
click node_py_exercises "https://github.com/xandaokruger/common-core/tree/main/Milestone2/Python_Modules"
click node_alchemy "https://github.com/xandaokruger/common-core/tree/main/Milestone2/Python_Modules/Python_Module_06"
click node_creature_tournament "https://github.com/xandaokruger/common-core/blob/main/Milestone2/Python_Modules/Python_Module_07/tournament.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_libft_original,node_libft_extended,node_gnl,node_printf,node_printf_helpers,node_user,node_maze_user toneBlue
class node_ps_main,node_ps_init,node_ps_flags,node_ps_stacks,node_ps_algorithms,node_ps_operations,node_ps_libft toneAmber
class node_maze_entry,node_maze_config,node_generator,node_glyphs,node_menu,node_render toneMint
class node_py_exercises,node_alchemy,node_creature_tournament toneRose
```

## Components

### C Utilities

- [Original libft](https://github.com/xandaokruger/common-core/tree/main/Milestone0/LIBFT_ORIGINAL): `Milestone0/LIBFT_ORIGINAL`
- [Extended libft](https://github.com/xandaokruger/common-core/tree/main/Milestone0/libft_modificado): `Milestone0/libft_modificado`
- [Line reader](https://github.com/xandaokruger/common-core/blob/main/Milestone1/get_next_line/get_next_line.c): `Milestone1/get_next_line/get_next_line.c`
- [Formatter](https://github.com/xandaokruger/common-core/blob/main/Milestone1/printf/ft_printf.c): `Milestone1/printf/ft_printf.c`
- [Format helpers](https://github.com/xandaokruger/common-core/tree/main/Milestone1/printf): `Milestone1/printf`

### Stack Sorting

- [Program entry](https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/main.c): `Milestone1/push_swap/srcs/main.c`
- [Input and setup](https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/push_swap.c): `Milestone1/push_swap/srcs/push_swap.c`
- [Strategy selection](https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/flags.c): `Milestone1/push_swap/srcs/flags.c`
- [Stack state](https://github.com/xandaokruger/common-core/blob/main/Milestone1/push_swap/srcs/stack.c): `Milestone1/push_swap/srcs/stack.c`
- [Sorting algorithms](https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/algorithm): `Milestone1/push_swap/algorithm`
- [Stack operations](https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/operations): `Milestone1/push_swap/operations`
- [Bundled libft](https://github.com/xandaokruger/common-core/tree/main/Milestone1/push_swap/libft): `Milestone1/push_swap/libft`

### Maze Application

- [Application entry](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/a_maze_ing.py): `Milestone2/A_maze_ing/a_maze_ing.py`
- [Maze configuration](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/config.py): `Milestone2/A_maze_ing/config.py`
- [Generate and solve](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/mazegen/generator.py): `Milestone2/A_maze_ing/mazegen/generator.py`
- [Maze glyphs](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/mazegen/glyphs.py): `Milestone2/A_maze_ing/mazegen/glyphs.py`
- [Interactive menu](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/view/menu.py): `Milestone2/A_maze_ing/view/menu.py`
- [Maze renderer](https://github.com/xandaokruger/common-core/blob/main/Milestone2/A_maze_ing/view/render.py): `Milestone2/A_maze_ing/view/render.py`

### Python Projects

- [Python exercises](https://github.com/xandaokruger/common-core/tree/main/Milestone2/Python_Modules): `Milestone2/Python_Modules`
- [Alchemy exercises](https://github.com/xandaokruger/common-core/tree/main/Milestone2/Python_Modules/Python_Module_06): `Milestone2/Python_Modules/Python_Module_06`
- [Creature tournament](https://github.com/xandaokruger/common-core/blob/main/Milestone2/Python_Modules/Python_Module_07/tournament.py): `Milestone2/Python_Modules/Python_Module_07/tournament.py`

### Other components

- **CLI user**
- **Maze user**

## Connections

- CLI user → Program entry: runs
- Program entry → Input and setup: initializes input (evidence: `Milestone1/push_swap/srcs/main.c`)
- Program entry → Stack state: sets up stacks (evidence: `Milestone1/push_swap/srcs/main.c`)
- Program entry → Strategy selection: executes strategy (evidence: `Milestone1/push_swap/srcs/main.c`)
- CLI user → Application entry: runs
- Application entry → Maze configuration: imports (evidence: `Milestone2/A_maze_ing/a_maze_ing.py`)
- Application entry → Generate and solve: imports package (evidence: `Milestone2/A_maze_ing/a_maze_ing.py`)
- Application entry → Interactive menu: imports view (evidence: `Milestone2/A_maze_ing/a_maze_ing.py`)
- Generate and solve → Maze glyphs: uses glyphs (evidence: `Milestone2/A_maze_ing/mazegen/generator.py`)
- Interactive menu → Generate and solve: uses generator (evidence: `Milestone2/A_maze_ing/view/menu.py`)
- Interactive menu → Maze renderer: uses renderer (evidence: `Milestone2/A_maze_ing/view/menu.py`)
- Maze renderer → Generate and solve: reads maze (evidence: `Milestone2/A_maze_ing/view/render.py`)
- Formatter → Format helpers: dispatches specs (evidence: `Milestone1/printf/ft_printf.c`)
- Creature tournament → Python exercises: imports creature packages (evidence: `Milestone2/Python_Modules/Python_Module_07/tournament.py`)
- Creature tournament → Alchemy exercises
