Comp 388-005 Week 7

Lewis Tower 415, 4:15-8:15


Readings:



Discuss the number of notes pages allowed for the final

Answer: 5 sides


B-trees

See trees.html#btree

Red-black trees


Adding a room class to Zuul

We will add the StoneRoom class to Zuul. The desired behavior is described in lab 7. Our edible will be a cookie, and we will not create a special class for them.

The general respond() logic is as follows:

if the command is "eat cookie":
    make sure the user has the cookie
    if so, remove the cookie from the inventory
    say something about new energy
    set just_eaten = true

if the command is "move stone":
    if not just_eaten, it's too heavy
    if stone is already moved, say so
    add a JEWEL
    update the room's description (note the use of the constructor altdesc here)

Note that all the work is in class StoneRoom, except for two lines to create the room in RoomMaker.cs. We don't have to change the existing game logic.

I want the effect of eating the cookie to last only a single turn. Notice how I can handle this in StoneRoom.Respond().


Mini-Java Compiler

See compiler.html

CompileExprN
common-subexpression handling



C++ memory-management issues
    smart pointers