How rithik-hyperloop69/c-projects- works
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 BMI Calc · Dice.c Dice Roll · Number_Guessing_Game.c Guess Game · password_generator.c Password Gen
Components 15
Docs
Repository coordination and planning
- README · Describes each program and build commands
README.md
Calculators
Utility-style console programs
Randomizers & Games
Interactive terminal apps with state and randomness
- Dice Roll · Single random die roll from 1 to 6
Dice.c - Roll draw · Seeds PRNG from time and emits one die value
Dice.c - Guess Game · Difficulty-based number guessing game with hints and attempt rating
Number_Guessing_Game.c - Game loop · Sets range, tracks guesses, gives high/low hints, rates attempts
Number_Guessing_Game.c - Password Gen · Builds random passwords from a fixed character set
password_generator.c - String build · Indexes charset with random values and assembles output string
password_generator.c - Tic-Tac-Toe · Local two-player board game with move validation and win checks
Tic-Tac-Toe.c - Board state · Maintains 3x3 board, validates moves, detects win or draw after each turn
Tic-Tac-Toe.c
Animation
Terminal rendering program
- DNA Anim · Continuously redraws a colored DNA strand in the terminal
DNA_Animation.c - Frame loop · Computes strand positions, applies ANSI color, and redraws until interrupted
DNA_Animation.c
Other components
- Repo · Flat collection of independent C programs
- C toolchain · GCC plus standard C library; math and terminal features where needed
Connections 20
- 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