# rithik-hyperloop69/c-projects- architecture

> Architecture diagram of the GitHub repository rithik-hyperloop69/c-projects-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rithik-hyperloop69/c-projects-
- Repository: https://github.com/rithik-hyperloop69/c-projects-

## Overview

This repository is a **monorepo of six independent terminal-based C programs**, each implemented as a single `.c` file with a matching prebuilt `.exe` artifact. There is **no shared library, framework, or cross-project runtime**; each program is its own boundary and can be compiled and run separately.

1. **Repository shape**
   - Root contains six standalone C sources plus compiled executables.
   - The architecture is intentionally flat: one file per app, no subfolders, no reusable core module.
   - The README is the only coordinating document; it describes each program and basic build commands.

2. **Primary architectural pattern**
   - All projects follow a **console I/O loop** model:
     - read user input from stdin
     - perform small in-memory computation
     - print results to stdout
   - This makes the repo best understood as a set of **small algorithmic demos**, not a layered application.

3. **BMI Calculator boundary**
   - `BMI_Calculator.c` is a self-contained interactive calculator.
   - Data flow: user enters weight and height → program computes BMI → categorizes result → renders an ASCII “health meter” → repeats until exit.
   - Its logic is centered on arithmetic, formatted output, and looping control.

4. **Dice Roller boundary**
   - `Dice.c` is the simplest executable and demonstrates randomness.
   - Data flow: initialize PRNG seed from time → generate a die roll → display a number from 1 to 6.
   - There are no persistent inputs or state beyond one random draw.

5. **Number Guessing Game boundary**
   - `Number_Guessing_Game.c` combines random number generation with difficulty selection.
   - Data flow: user selects difficulty → program sets a range and generates a secret number → player repeatedly guesses → app responds with high/low hints → final attempt count is mapped to a rating.
   - The main architectural element is a **game loop with stateful attempts tracking**.

6. **Password Generator boundary**
   - `password_generator.c` builds a random string from a fixed character set.
   - Data flow: user requests password length → program indexes into a charset array using random values → assembles and prints the password.
   - The core concern is string/array construction, not security infrastructure or storage.

7. **Tic-Tac-Toe boundary**
   - `Tic-Tac-Toe.c` is a two-player local game with board state in memory.
   - Data flow: player input → validate move → update 3×3 board → render board → check win/draw after each turn.
   - The important subsystem here is **game-state management** using a 2D array and win-detection logic.

8. **DNA Animation boundary**
   - `DNA_Animation.c` is a terminal animation rather than a game or calculator.
   - Data flow: compute strand positions using trigonometric functions → apply ANSI color/escape sequences → continuously redraw the console in a timed loop.
   - This program’s architecture is dominated by **frame generation and terminal rendering**, with an infinite loop controlled by user interruption (`Ctrl+C`).

9. **Shared technical dependencies**
   - The repo targets standard C compilation with GCC across Windows, Linux, and macOS.
   - Common libraries and runtime features include:
     - standard C I/O and math utilities
     - `rand()` / `srand()` with time-based seeding for randomness
     - `math.h` and `-lm` for the DNA animation
     - terminal control/ANSI coloring for visual output
   - The presence of `.exe` files suggests Windows builds are checked in alongside sources.

10. **Data and state model**
   - There is **no file I/O, database, network, or external service integration** in the current codebase.
   - All state is ephemeral and in-process: arrays, counters, board state, secret numbers, and generated strings.
   - This keeps each executable isolated and easy to diagram as a standalone input-process-output pipeline.

11. **Project roadmap boundary**
   - The README roadmap lists future programs like To-Do List, Hangman, Caesar Cipher, and others.
   - These are not implemented yet, so they should be treated as planned future modules rather than current architecture.

12. **How to diagram this repo**
   - Draw the repo as a **collection of independent command-line apps** under one source-control umbrella.
   - Show each app as its own box with a single user-facing console interface.
   - Optionally group them by concept:
     - calculators/utilities
     - randomizers/games
     - terminal animation
   - The only shared boundary across all apps is the C toolchain and standard runtime libraries.

Main entry points: [`BMI_Calculator.c`](https://github.com/rithik-hyperloop69/c-projects-/blob/main/BMI_Calculator.c) (BMI Calc), [`Dice.c`](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Dice.c) (Dice Roll), [`Number_Guessing_Game.c`](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Number_Guessing_Game.c) (Guess Game), [`password_generator.c`](https://github.com/rithik-hyperloop69/c-projects-/blob/main/password_generator.c) (Password Gen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs"]
  node_readme["README<br/>docs<br/>[README.md]"]
end

subgraph group_calc["Calculators"]
  node_bmi["BMI Calc<br/>console app<br/>[BMI_Calculator.c]"]
  node_bmi_logic(("BMI loop<br/>calc pipeline<br/>[BMI_Calculator.c]"))
end

subgraph group_games["Randomizers & Games"]
  node_dice["Dice Roll<br/>console app<br/>[Dice.c]"]
  node_dice_logic(("Roll draw<br/>random draw<br/>[Dice.c]"))
  node_guess["Guess Game<br/>console app"]
  node_guess_logic(("Game loop<br/>stateful game"))
  node_pwd["Password Gen<br/>console app"]
  node_pwd_logic(("String build<br/>string assembly"))
  node_ttt["Tic-Tac-Toe<br/>console app<br/>[Tic-Tac-Toe.c]"]
  node_ttt_logic(("Board state<br/>state machine<br/>[Tic-Tac-Toe.c]"))
end

subgraph group_anim["Animation"]
  node_dna["DNA Anim<br/>terminal animation<br/>[DNA_Animation.c]"]
  node_dna_logic(("Frame loop<br/>render loop<br/>[DNA_Animation.c]"))
end

node_repo["Repo"]
node_toolchain["C toolchain<br/>runtime"]

node_repo -->|"documents"| node_readme
node_repo -->|"builds with"| node_toolchain
node_repo -->|"contains"| node_bmi
node_repo -->|"contains"| node_dice
node_repo -->|"contains"| node_guess
node_repo -->|"contains"| node_pwd
node_repo -->|"contains"| node_ttt
node_repo -->|"contains"| node_dna
node_bmi -->|"runs"| node_bmi_logic
node_dice -->|"runs"| node_dice_logic
node_guess -->|"runs"| node_guess_logic
node_pwd -->|"runs"| node_pwd_logic
node_ttt -->|"runs"| node_ttt_logic
node_dna -->|"runs"| node_dna_logic
node_bmi_logic -->|"uses"| node_toolchain
node_dice_logic -->|"uses"| node_toolchain
node_guess_logic -->|"uses"| node_toolchain
node_pwd_logic -->|"uses"| node_toolchain
node_ttt_logic -->|"uses"| node_toolchain
node_dna_logic -->|"uses"| node_toolchain

click node_readme "https://github.com/rithik-hyperloop69/c-projects-/blob/main/README.md"
click node_bmi "https://github.com/rithik-hyperloop69/c-projects-/blob/main/BMI_Calculator.c"
click node_bmi_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/BMI_Calculator.c"
click node_dice "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Dice.c"
click node_dice_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Dice.c"
click node_guess "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Number_Guessing_Game.c"
click node_guess_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Number_Guessing_Game.c"
click node_pwd "https://github.com/rithik-hyperloop69/c-projects-/blob/main/password_generator.c"
click node_pwd_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/password_generator.c"
click node_ttt "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Tic-Tac-Toe.c"
click node_ttt_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/Tic-Tac-Toe.c"
click node_dna "https://github.com/rithik-hyperloop69/c-projects-/blob/main/DNA_Animation.c"
click node_dna_logic "https://github.com/rithik-hyperloop69/c-projects-/blob/main/DNA_Animation.c"

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_readme toneBlue
class node_bmi,node_bmi_logic toneAmber
class node_dice,node_dice_logic,node_guess,node_guess_logic,node_pwd,node_pwd_logic,node_ttt,node_ttt_logic toneMint
class node_dna,node_dna_logic toneRose
class node_repo,node_toolchain toneNeutral
```

## Components

### Docs

Repository coordination and planning

- [README](https://github.com/rithik-hyperloop69/c-projects-/blob/main/README.md): docs · Describes each program and build commands · `README.md`

### Calculators

Utility-style console programs

- [BMI Calc](https://github.com/rithik-hyperloop69/c-projects-/blob/main/BMI_Calculator.c): console app · Interactive BMI calculator with category and meter output · `BMI_Calculator.c`
- [BMI loop](https://github.com/rithik-hyperloop69/c-projects-/blob/main/BMI_Calculator.c): calc pipeline · Reads weight/height, computes BMI, categorizes result, repeats until exit · `BMI_Calculator.c`

### Randomizers & Games

Interactive terminal apps with state and randomness

- [Dice Roll](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Dice.c): console app · Single random die roll from 1 to 6 · `Dice.c`
- [Roll draw](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Dice.c): random draw · Seeds PRNG from time and emits one die value · `Dice.c`
- [Guess Game](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Number_Guessing_Game.c): console app · Difficulty-based number guessing game with hints and attempt rating · `Number_Guessing_Game.c`
- [Game loop](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Number_Guessing_Game.c): stateful game · Sets range, tracks guesses, gives high/low hints, rates attempts · `Number_Guessing_Game.c`
- [Password Gen](https://github.com/rithik-hyperloop69/c-projects-/blob/main/password_generator.c): console app · Builds random passwords from a fixed character set · `password_generator.c`
- [String build](https://github.com/rithik-hyperloop69/c-projects-/blob/main/password_generator.c): string assembly · Indexes charset with random values and assembles output string · `password_generator.c`
- [Tic-Tac-Toe](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Tic-Tac-Toe.c): console app · Local two-player board game with move validation and win checks · `Tic-Tac-Toe.c`
- [Board state](https://github.com/rithik-hyperloop69/c-projects-/blob/main/Tic-Tac-Toe.c): state machine · Maintains 3x3 board, validates moves, detects win or draw after each turn · `Tic-Tac-Toe.c`

### Animation

Terminal rendering program

- [DNA Anim](https://github.com/rithik-hyperloop69/c-projects-/blob/main/DNA_Animation.c): terminal animation · Continuously redraws a colored DNA strand in the terminal · `DNA_Animation.c`
- [Frame loop](https://github.com/rithik-hyperloop69/c-projects-/blob/main/DNA_Animation.c): render loop · Computes strand positions, applies ANSI color, and redraws until interrupted · `DNA_Animation.c`

### Other components

- **Repo**: monorepo · Flat collection of independent C programs
- **C toolchain**: runtime · GCC plus standard C library; math and terminal features where needed

## Connections

- Repo → README: documents · README coordinates the repo
- Repo → C toolchain: builds with · All programs compile as standard C executables
- Repo → BMI Calc: contains · Independent source file and executable pair
- Repo → Dice Roll: contains · Independent source file and executable pair
- Repo → Guess Game: contains · Independent source file and executable pair
- Repo → Password Gen: contains · Independent source file and executable pair
- Repo → Tic-Tac-Toe: contains · Independent source file and executable pair
- Repo → DNA Anim: contains · Independent source file and executable pair
- BMI Calc → BMI loop: runs · Calculator is driven by an interactive input-process-output loop
- Dice Roll → Roll draw: runs · Single random outcome generation
- Guess Game → Game loop: runs · Gameplay is centered on repeated guesses and state tracking
- Password Gen → String build: runs · Password output is assembled from random charset selection
- Tic-Tac-Toe → Board state: runs · Board updates and win detection drive the app
- DNA Anim → Frame loop: runs · Animation is driven by timed frame generation
- BMI loop → C toolchain: uses · Standard I/O and math utilities
- Roll draw → C toolchain: uses · rand/srand and time-based seeding
- Game loop → C toolchain: uses · Randomness plus console I/O
- String build → C toolchain: uses · Randomness plus array/string handling
- Board state → C toolchain: uses · Console I/O and in-memory board state
- Frame loop → C toolchain: uses · math.h, ANSI terminal control, and timing
