Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Assignment 5

In this assignment we expand the set of commands to the full possible set. Add the functionality for the following commands:

  • CreatureName:clean – this command forces the creature with name CreatureName to clean the room. This command has multiple special cases, so be careful to implement all of them. The respect of the PC is altered accordingly, other Creatures react accordingly (possibly altering the PC’s respect even further), etc. If a Creature with name CreatureName cannot be found in the current Room, output a sensible message and repeat the command loop.
  • CreatureName:dirty – same as above, only force the creature to dirty the current room rather than clean it.
  • CreatureName:north – force CreatureName to go north. If it cannot (there is no room to the north or it is full), output a sensible message and repeat the command loop. Remember that when it enters the new room, it may not like its state, triggering a chain of reactions as per the project description.
  • CreatureName:south, CreatureName:west, CreatureName:east – same as above for the respective direction.

You will also complete the implementation of the singly linked list begun in class (see the comment at the bottom for methods you must implement). You may not use the Iterator in implementing these methods (that’s for external use only). Substitute all arrays that you have used so far in your project with instances of your linked list. This should include the list of Creatures in a Room. Be careful to remove (or comment out) all code that is now irrelevant.

Note that this homework should complete the functionality of the project. Read the complete project description to see whether you have missed anything. Did you implement a help message? Did you do the “lickface”, “growl”, and the like messages? Did you check whether the PC’s respect is 0 or 80 to see if the game should end in shame or praise? etc.