teaching machines

Spec Adventure

December 8, 2017 by . Filed under public, teaching.

The last few weeks of our introductory program class focus on objects. For a lab exercise, students design a Room class to support a text adventure game. Each Room has a description, four Room neighbors, and whatever other state the students need to support their interaction.

One of the students designed an adventure that featured me as the “villain.” Here’s what happens if you try to take me on before getting your work done:

Welcome to the Horror House
Use the keyboard to indicate your actions
N-Travel North | E-Travel East | S-Travel South | W-Travel West
end-Channel your cowardice, and end the game
+++++++++++++++++++++++++++++++++++++++++
You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>s
You turn around and exit the door onto the patio. A thick fog blocks your path out of the house. Press y to attempt to maneuver through the fog.

>y
You travel not even five feet before you are knocked onto the ground. From the fog, appears a towering figure.

Christophoros Johnsonus, Checker of Specifications has blocked your path! If you believe you are well prepared for the fight, press t to defeat the defender of the house.

>t
The defender is not pleased. His gaze pierces you with the strength of a thousand suns as he shrieks, 'You have not passed all tests. But you will! Keep at it.'

You have failed. Game Over

Here’s what happens if you don’t manage your time well:

You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>n
You traverse the stairs to the Upstairs Study. There is a comfortable bed in the corner, beckoning to you. Press p to take a rest, or Press o to search the underside of the bed

>p
You wake up from your rest feeling refreshed. It is still dark outside, and you are unsure of how much time has passed.

>s
You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>s
You turn around and exit the door onto the patio. A thick fog blocks your path out of the house. Press y to attempt to maneuver through the fog.

>y
You travel not even five feet before you are knocked onto the ground. From the fog, appears a towering figure.

Christophoros Johnsonus, Checker of Specifications has blocked your path! If you believe you are well prepared for the fight, press t to defeat the defender of the house.

>t
You have slept through the time required. There will be no Amnesty Period provided.

You have failed. Game Over

And here is what happens when you get all your work done in time:

You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>w
You pull the door open just enough to squeeze through. It is darker than the blackest night. There is a chipped lightswitch to your right. Press i to illuminate the area.

>i
You flip the switch and it reveals the room to be a crypt. You see a shadow dart out of the corner of your eye. It is a man. Press u to confront the man.

>u
The man speaks in a garbled language. You cannot understand him, but he motions for you to put out your hands. He places into them a scroll. The scroll contains a hodgepodge of characters and braces. Perhaps a 'code' of sorts
Scroll added to inventory

>e
You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>n
You traverse the stairs to the Upstairs Study. There is a comfortable bed in the corner, beckoning to you. Press p to take a rest, or Press o to search the underside of the bed

>o
While searching under the bed, you find an elixir and consume it.
Willpower added to inventory

>s
You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>e
The sacrifice is ready to be made. A force beyond your own mind compells you to push the items from your inventory to the bucket. With a great flash, the items are consumed by the bucket, and you are left empty handed.
Items 'scroll' and 'willpower' removed from inventory.

>w
You have arrived in the landing of a dark and weathered house. There is a crumbling flight of stairs ahead of you, a glass door to your right, a rusted iron door to your left, and a heavy double door behind you.

>s
You turn around and exit the door onto the patio. A thick fog blocks your path out of the house. Press y to attempt to maneuver through the fog.

>y
You travel not even five feet before you are knocked onto the ground. From the fog, appears a towering figure.

Christophoros Johnsonus, Checker of Specifications has blocked your path! If you believe you are well prepared for the fight, press t to defeat the defender of the house.

>t
The defender bellows with the strength of a thousand winds '4 out of 4 tests pass. High five. You have passed all tests.'

You have now left the Horror House. Thank you for playing!

The quotes that Michael includes are taken directly from the SpecCheckers—the unit tests—that I distribute to students. Thanks, Michael, for honoring them and me in this way!