CSCI 200 - Fall 2025
Foundational Programming Concepts & Design

A2 - Samodelkin Dungeon Crawler

→This assignment is due by Tuesday, September 30, 2025, 11:59 PM.←
→ As with all assignments, this must be an individual effort and cannot be pair programmed. Any debugging assistance must follow the course collaboration policy and be cited in the comment header block for the assignment.←

Jump To: · Rubric · Submission ·

Jump to a specific subsection: · Technical Requirements · Helper Functions · main Function · Extra Credit · Sample Output ·

Be sure to read all the of the specifications and requirements before beginning to implement this project. The task is to create a simple dungeon crawler where your Hero explores rooms, finding items, fighting baddies, and hoping to escape alive!


Technical Requirements



Helper Functions


The required helper functions are described below.

generate_random_room_number()

empty_room()

key_room()

weapon_room()

enemy_room()

potion_room()

exit_room()

enter_room()


The main Function


The main function will track the overall game state and implement the game flow.


Extra Credit


There are several extensions you can add in:


Sample Game Output


Below is a sample running of the game (with all the extensions implemented):

% ./A2
Difficulties:
        (1) Easy
        (2) Medium
        (3) Hard
        (4) Insane
Select game difficulty: 8
Select game difficulty: 1
You continue deeper into the dungeon, this time exploring Room #4
You enter room #4.  You have 100HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        A fountain flows in the middle of the room.  Cautiously you take a drink.
        You've restored 6HP.
Do you wish to continue exploring? (Y/N): Y
You continue deeper into the dungeon, this time exploring Room #10
You enter room #10.  You have 106HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        You look around, there's nothing here
Do you wish to continue exploring? (Y/N): d
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #7
You enter room #7.  You have 106HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        You appear to be in what was once an armory of sorts.  There are many broken weapons and shields scattered about.
        Mounted upon the wall is the mighty sword Excalibur.  Do you wish to take it with you? (Y/N): n
        You hope you don't regret that choice.
Do you wish to continue exploring? (Y/N): Y
You continue deeper into the dungeon, this time exploring Room #2
You enter room #2.  You have 106HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        There's a monster with 21HP in here!  Battle ensues!
        You punch the beast dealing 1 damage.
        The beast beats you dealing 10 damage.
        You punch the beast dealing 1 damage.
        The beast beats you dealing 7 damage.
        You punch the beast dealing 4 damage.
        The beast beats you dealing 9 damage.
        You punch the beast dealing 1 damage.
        The beast beats you dealing 6 damage.
        You punch the beast dealing 3 damage.
        The beast beats you dealing 9 damage.
        You punch the beast dealing 1 damage.
        The beast beats you dealing 5 damage.
        You punch the beast dealing 4 damage.
        The beast beats you dealing 5 damage.
        You punch the beast dealing 5 damage.
        The beast beats you dealing 6 damage.
        You punch the beast dealing 3 damage.
        The beast beats you dealing 9 damage.
        You have slain the enemy and found 16GP.
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #7
You enter room #7.  You have 40HP, Key = No, Weapon = No, Armor = No, Gold = 16GP
        You appear to be in what was once an armory of sorts.  There are many broken weapons and shields scattered about.
        Mounted upon the wall is the mighty sword Excalibur.  Do you wish to take it with you? (Y/N): y
        You instantly feel more powerful.
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #5
You enter room #5.  You have 40HP, Key = No, Weapon = Yes, Armor = No, Gold = 16GP
        There's a massive locked gate blocking your way.
        Perhaps you need to find a key somewhere?
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #3
You enter room #3.  You have 40HP, Key = No, Weapon = Yes, Armor = No, Gold = 16GP
        There doesn't seem to be much here, just a pile of things on the floor.
        You notice something shiny in the corner.  Do you wish to pick it up? (Y/N): y
        You've found a key!  Now to find what it goes to.
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #8
You enter room #8.  You have 40HP, Key = Yes, Weapon = Yes, Armor = No, Gold = 16GP
        There's a monster with 32HP in here!  Battle ensues!
        You swing Excalibur dealing 13 damage.
        The beast beats you dealing 10 damage.
        You swing Excalibur dealing 11 damage.
        The beast beats you dealing 10 damage.
        You swing Excalibur dealing 12 damage.
        The beast beats you dealing 8 damage.
        You have slain the enemy and found 28GP.
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #5
You enter room #5.  You have 12HP, Key = Yes, Weapon = Yes, Armor = No, Gold = 44GP
        There's a massive locked gate blocking your way.
        You try the key you found earlier.  It fits!
After visiting 9 rooms and finding 44GP, you have finally escaped alive!

A second run of the game with a different outcome is shown below:

% ./A2
Difficulties:
        (1) Easy
        (2) Medium
        (3) Hard
        (4) Insane
Select game difficulty: 3
You continue deeper into the dungeon, this time exploring Room #15
You enter room #15.  You have 100HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        You look around, there's nothing here
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #25
You enter room #25.  You have 100HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        You look around, there's nothing here
Do you wish to continue exploring? (Y/N): y
You continue deeper into the dungeon, this time exploring Room #26
You enter room #26.  You have 100HP, Key = No, Weapon = No, Armor = No, Gold = 0GP
        There's a monster with 20HP in here!  Battle ensues!
        You punch the beast dealing 5 damage.
        The beast beats you dealing 7 damage.
        You punch the beast dealing 2 damage.
        The beast beats you dealing 6 damage.
        You punch the beast dealing 5 damage.
        The beast beats you dealing 10 damage.
        You punch the beast dealing 1 damage.
        The beast beats you dealing 10 damage.
        You punch the beast dealing 3 damage.
        The beast beats you dealing 5 damage.
        You punch the beast dealing 4 damage.
        The beast beats you dealing 8 damage.
        You have slain the enemy and found 24GP.
Do you wish to continue exploring? (Y/N): n
After visiting 3 rooms and finding 24GP, you have given up, forever destined to wander the dungeon.
Maybe you will some day find the key to unlock the gate.
Perhaps a sword could make the escape quicker.
Perhaps you would have stayed longer with some armor.

Grading Rubric


Your submission will be graded according to the following rubric:

PointsRequirement Description
0.5Submitted correctly by Tuesday, September 30, 2025, 11:59 PM
0.5Project builds without errors nor warnings.
2.0Best Practices and Style Guide followed.
0.5Program follows specified user I/O flow.
0.5Public and private tests successfully passed.
2.0Fully meets specifications.
6.00Total Points

Extra Credit PointsRequirement Description
+0.1 +0.1 for each extension fully & correctly implemented


Submission


Always, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available.

Zip together your main.cpp, samodelkin.h, samodelkin.cpp, Makefile files and name the zip file A2_USERNAME.zip. Upload this zip file to Canvas under A2.


→This assignment is due by Tuesday, September 30, 2025, 11:59 PM.←
→ As with all assignments, this must be an individual effort and cannot be pair programmed. Any debugging assistance must follow the course collaboration policy and be cited in the comment header block for the assignment.←