CSCI 200 - Fall 2026
Foundational Programming Concepts & Design

A2 - Samodelkin Dungeon Crawler

→This assignment is due by Tuesday, September 29, 2026, 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 · 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.


Sample Game Output


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

% ./A2
You continue deeper into the dungeon, this time exploring Room #4
You enter room #4.  You have 100HP, Key = No, Weapon = No
        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 = N
        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
        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
        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.
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
        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
        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
        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
        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.
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
        There's a massive locked gate blocking your way.
        You try the key you found earlier.  It fits!
After visiting 9 rooms, you have finally escaped alive!

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

% ./A2
You continue deeper into the dungeon, this time exploring Room #10
You enter room #10.  You have 100HP, Key = No, Weapon = No
        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 #6
You enter room #6.  You have 100HP, Key = No, Weapon = No
        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.
Do you wish to continue exploring? (Y/N): n
After visiting 2 rooms, 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.

Grading Rubric


As this is an introductory C++ course that teaches the fundamental concepts of the language and implementation details of each algorithm, the use of the C++ algorithm library, lambda functions, structured bindings, and smart pointers are prohibited. The use of auto is also discouraged to be aware of the explicit type of every variable used throughout your program.

Your submission will be graded according to the following rubric:

PointsRequirement Description
0.5Submitted correctly by Tuesday, September 29, 2026, 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


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 where USERNAME is your user id. Upload this zip file to Canvas under A2.

After submitting to Canvas, download your submission to ensure your submission is correct and complete. Submissions that are empty or contain only the starter code will not be considered.


→This assignment is due by Tuesday, September 29, 2026, 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.←