Overview
GDEV40024 Programming Fundamentals was completed across two assignments. Assignment 1 required ten C++ coding challenges covering core language concepts: ASCII art output, user I/O, a multi-function calculator, text box generation, text casing transformations, a number guessing game, party selection with a shop system, a dynamic inventory manager, a Vector2 math class, and a 16-bit bitwise controller input manipulator.
Assignment 2 required a complete C++ console game. The original concept — a narrative horror RPG titled The Forbidden Hell, inspired by Blair Witch Project, FINAL FANTASY XIII, Silent Hill Homecoming, Slender: The Arrival, Resident Evil 3: Nemesis, and The Evil Within — was scrapped four weeks before the deadline due to over-ambition and time constraints. The battle system alone had grown to 2,300 lines of unfinished code out of approximately 9,000 total. The game was redesigned as an endless dungeon: infinite floors of randomised enemies with dynamically increasing difficulty, a full turn-based battle system, player stats and roles, Windows API integrations, and a console UI library for the main menu.
The thread described the challenges as "a rollercoaster ride — they start nice and slow but become terrifyingly and quickly difficult to manage without trying to research more about C++ using 100+ Google Chrome tabs."
Assignment 1
Ten challenges increasing in complexity — from declarative ASCII output to a full bitwise controller manipulator. Each one introduced new C++ concepts and was later refactored for consistent code style.
\ as an escape character, breaking ASCII art strings entirely. The fix was raw string literals (R"(...)"), which allow multi-line strings without escape sequences or repeated std::cout calls. No variables required — purely declarative output.Windows.h to clear the console.cmath and iomanip headers. Implementing custom error codes in C++ for the first time.isalpha() and isspace() from ctype.h. Concept worked correctly on first attempt — minor tweaks for accuracy. Refactored out of main() into boolean helper functions..Size() on a string instead of correct index-based iteration. Fixed after returning to the problem with fresh perspective after illness.
for (int i = 0; i < inputString.Size(); i++) — .Size() is not the correct method for iterating string characters in C++. Failure to plan before writing led to three consecutive broken implementations.Shop class with an ID field, resolving the ordering bug cleanly.
Shop class with ID-based resetShop(id) function.unordered_map STL. Each item became a struct with ID and name. Search function made case-insensitive. Final code was described as "presentable and neat."uint16_t) representing controller input for up to 4 players. Lower 12 bits encode button states (DPad, face buttons, shoulder/trigger); upper 4 bits store player index. Four typedef structs in structure.h. Functions included: SetBitAtPosition, SetData, SetPlayers, GetPlayers, GetData, TransformInputByPlayer (D-pad rotated per player), and bitfield conversion utilities.
Assignment 1
After completing all ten challenges, all code was rewritten for consistent naming conventions and readability. The changes were lost once and had to be completed a second time. Three major systematic changes applied across all challenges:
using namespace std; — identified as bad practice. When multiple namespaces are in use, functions can silently collide with std equivalents. Explicit std:: prefixing applied throughout.while(true) loops — continuously accepting user input without requiring the application to restart between tests, saving significant debugging and recompilation time.main() — split monolithic main functions into appropriately named sub-functions for readability, maintainability, and isolation of bugs.Final naming convention pass: camelCase for variables and functions, PascalCase for classes and structs, SNAKE_CASE for #define and constant definitions.
Assignment 2
The original game concept was a narrative horror RPG titled The Forbidden Hell. Genre: Action, Adventure, Horror, Sci-Fi, Fantasy. Inspirations: Blair Witch Project, FINAL FANTASY XIII, Silent Hill Homecoming, Slender: The Arrival, Resident Evil 3: Nemesis, and The Evil Within. Planned mechanics included turn-based combat, player roles, an RPG levelling system, narrative story, varied randomised enemies, puzzles, player inventory/skills/abilities, save and load, RNG-based decision making, and BGM/SFX.
The plot: the player is knocked unconscious and wakes in a rural, isolated forest known as "The Forbidden Hell" — a location notorious for unexplained kidnappings and consistent murders. The player discovers they can cast healing magic when nursing a leg injury. The player's name was dynamically inserted into the narration via game_introduction().
The redesigned game retained the battle system architecture but scrapped the narrative. Key systems built or extended:
clear_console() extended with loading screen message parameters. Float variant of randomise_number() added.sleep_game(int sleep_time) with customisable duration. disable_console_resize() — thread implementation caused OS hang before process termination; resolved by using MessageBoxA() to warn the user. change_console_title() added. WIN32_LEAN_AND_MEAN defined for additional libraries.is_dead(), is_poisoned(), is_cursed(), is_player_turn(), assign_abilities(), output_roles(), switch_roles().The centrepiece of Assignment 2. Key functions: Battle_Setup() — configures enemy stats and assigns the player's role; Battle_Start(); Battle_End(); Battle_Cleanup() — deletes pointers and resets all variables; Game_Over(). Player logic: Battle_Player_Turn(), Battle_Player_Attack(), Battle_Player_Inflict_Bleed(). Ailment boolean functions for both player and enemy perform specific actions per active ailment — poison, curse, bleed, etc. Damage calculations factor in weakness, resistance, and immunity. The system uses inheritance.
Acknowledged getting "carried away" with original plans. The final build was disappointing — unable to implement everything intended. Code was written unnecessarily sophisticatedly, causing mental burnout. Boss BGM sourced from FINAL FANTASY XIII-2; voiceovers from South Park (both credited). Thread archived December 9, 2024.
Tutorials
Task 1: The \t escape sequence inserts a tab space; multiple \t characters insert multiple tabs. Task 2: 5+5 written directly within a cout statement performs the calculation dynamically without pre-assigning a variable — the result is printed directly.
Confirmed that arithmetic expressions within cout statements are evaluated at runtime. Task 2 was screenshot-based with no additional written content captured.
Covered conditional/relational operators and how they use booleans under the hood. Task 1 involved five explicit comparisons with predictions confirmed before running:
(5 < 1) → 0 / false(5 > 1) → 1 / true(5 == 1) → 0 / false(90 != 90) → 0 / false(-5*2)==(5*2) → 0 / false (−10 ≠ 10)Task 2 built progressively: a pass/fail grade calculator expanded with 2:2, 2:1, and 1st class thresholds; a name-equality check for "Bob"; ASCII-value string comparison ('Bob' > 'Car' is false because b = 98 < c = 99); and relational operator examples with int player_ammo, const int MAX_AMMO, and bool isPlayerOutOfAmmo.
Reflections
Inconsistent naming was a recurring problem across all challenges — fluctuating between PascalCase, camelCase, snake_case, and kebab-case within the same codebase. The final naming convention target: camelCase for variables and functions, PascalCase for classes and structs, SNAKE_CASE for #define and constant definitions.
Removing using namespace std; improves readability and prevents namespace collisions. If multiple namespaces are in use, functions can silently conflict with std equivalents. Explicit std:: prefixing makes the origin of every function call unambiguous.
using namespace std; — always prefix with std:: explicitly.
Challenge 9 and Challenge 10 both demonstrated that cognitive overload is a real barrier to knowledge retention. Challenge 9's scope was psychologically overwhelming despite being technically achievable once broken down. Challenge 10 induced a Stroop-effect-like fatigue where common English words began to look wrong after hours of focus on bitwise logic. Concepts learned under this kind of overload risk being lost immediately after the task ends.
A pattern of "over-functioning" — breaking every small block of logic into its own function — created branching trees of hundreds of unnecessary subfunctions where a single function would have sufficed. This was identified in the final challenge review and corrected. Functions should be extracted only when genuinely warranted: for reuse, readability, or isolation of complexity.
Assignment 2's original game concept was too ambitious given the time available and the level of C++ experience at the time. The same pattern had occurred the prior year. The redesign to an endless dungeon was necessary but left the final build feeling incomplete. Writing unnecessarily sophisticated code under time pressure causes mental burnout and produces worse output than simpler, more pragmatic architecture would have.
Implementing suboptimal solutions first and returning to rewrite them slowed overall progress and introduced new bugs — but ultimately refined programming skills through the revision process. Significant confidence was gained in C++ by the end of the module, particularly around structs, classes, namespaces, and header files.