CSC241: Homework 5


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

In order to optimize the finding of a Creature with a certain name in a Room, keep the array with Creature references that every Room has sorted at all times based on the Creature names. To do that, implement and execute quicksort on the array every time a Creature enters or leaves the Room. Then, when you are looking for a Creature with a certain name in a Room, implement and execute binary search on the array of Creature references.

Note that this homework should complete the functionality of the project. Do 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.