Program 5 Dordal Due: April 30, 2001 You are to modify the game program presented in class, adding the following features: 1. There is a damControlRoom with a large valve in it, from which steps lead down to a room below ("wetroom"). You are to arrange things so that the room below is described as "submerged", and you can't go there, until the player executes TURN VALVE in the damControlRoom. After you return to the damControlRoom, the wetroom should automatically "reflood", so you have to TURN VALVE again to go down there again. Note, however, that all the state regarding this puzzle is in damControlRoom; wetroom is just an ordinary room with no special state. 2. You are to add default interpretations to TURN, EAT, and every other verb so that, if you try to TURN ANYTHING anywhere but the damControlRoom, the game responds There is nothing to turn here and similarly for EAT You can't eat here (or, if you prefer, "you're not hungry yet"). That is, *every* verb should be recognized as a legitimate game term in *every* room, not just in the rooms where the verb is "applicable". This is important for the player, in order to give some hint as to what the relevant verbs *are*. To do this, you need to modify default_interpret. 3. If you eat the chocolate, it should go away. Optional: the chocolate should last 2-3 bites. Keep the number of bites left as an attribute of the chocolate itself. 4. You are to add one additional puzzle of your own. Your puzzle should, at a minimum, involve the following: one new CarryObj one new verb one new derived room class, with special behavior for at least one verb (new or existing). some kind of state change to the room or to an object (like the stone being moved or valve being turned) Your puzzle should also have appropriate clues in the game, and make sense as a puzzle as well as a program. Here are a few possibilities. UNLOCK CHEST with a KEY found elsewhere; once the chest is unlocked, something should be inside. FIGHT DRAGON with SWORD; while the dragon is alive flight is blocked. Cross a rickety two-move bridge over a bottomless pit; if you carry too much the bridge will break; if you try to DROP things once on the middle of the bridge to avoid this, they are lost forever. Have goblins attack you in a pitch-black cave room, if you fail to LIGHT LANTERN within 2 turns. Note that this puzzle involves keeping count of turns.