©2005 Felleisen, Proulx, et. al.

Maze Game

Refer to Problem 2.3 and Problem 3.9 from Assignments 2 and 3.

5.10  Problem

Design the methods that computes the maximum money the player can win, when starting with the given amount.

5.11  Problem

Design the methods that determines whether two rooms are the same. Two wizard rooms are considered the same if they use the same formula to compute the reward.

5.12  Problem

Design the method nextMove for the class that represents the girl player. The method produces a new girl player. If the game is over, the method just returns the girl player unchanged. Otherwise, the girl's fortune is either increased by the elf or a wizard, or plundered by the monster. The method consumes a String "left" or String "right" that determines the choice of doors, left or right, and the player moves to that room. The player should not move anywhere, if the input is different from these two values. Of course, there are no doors in the wizard room.

5.13  Problem

Design the methods that draw the three different rooms for the Maze Game, i.e. the Monster room, the Elf room, and the Wizard room in the World. They can be just rectangles of different color, but you may use some creativity along the way.

This problem will not be graded, but you need some graphical representation of the different rooms to proceed with the rest of the problems.

5.14  Problem

Design the methods that draw some representation of the amount of money the girl player has. It can be as simple as a yellow circle of increasing or decreasing radius, or a fancy pile of gold nuggets.

This problem will not be graded, but you need some graphical representation of the money to proceed with the rest of the problems.

5.15  Problem

Add the girl player to the World. Define the two methods needed to play the interactive game -- draw and move and onKeyEvent.

You shold now be able to play the game.