Programming Resources
For Fun and Learning
Charles Cusack
Computer Science
Hope College
main

Python
C++
JAVA
PHP
SQL

Assignments


zuul-MVC


Description
(This is a homework assignment I give in my CSCI 225 class based on exercises from the "Objects First with Java" textbook)

World of Your Choosing

Purpose
  • To give you a little experience creating and designing your own classes.
  • To help you make choices about cohesion, coopling, and encapsulation.
  • Give you a little experience with refactoring code.
Assignment
You will extend the World of Zuul example from the book by completing several of the exercises from the textbook, and by giving it a theme of your choosing. You will do this in two parts.

Part 1
You need to design your game. Complete exercises 7.3 and 7.4. Include a clear description of your game, its features, and the goal. You do not have to implement anything at this point, however.

Before you make any decisions, read the rest of the assignment, both to get some ideas, and to see what elements are required in your game. Include in your description which exercises/features you plan on implementing. You will not necessarily be locked into your initial choices.

Notice that you will submit this part of the assignment about a week before Part 2 is due.

Part 2
You need to implement all of the following exercises:
  • 7.14
  • 7.22
  • 7.23
  • 7.29
  • 7.30
  • 7.31
  • 7.32
  • 7.33
  • 7.34
In addition, you need to implement at least 4 of the following:
  • 7.26
  • 7.42
  • 7.43
  • 7.44
  • 7.45
  • 7.46 (See Section 9.11 for some help on this one)
  • 7.48
  • 7.49
Your game should include enough rooms, objects, etc. to demonstrate that each of the features is properly implemented. Include a README.txt file which lists which exercises/features you chose to implement.

You should start with my version of the code which is available above in a zipfile. You should not modify the classes GameGUI.java or GameTXT.java.

Part 3
Create tests that verify that each exercise you implemented is correct. You should include some tests for prior exercises as well (like picking up and dropping items, for instance). I should be able to run your tests and be convinded that every feature you included is implemented properly. Include methods like testExercise23, when possible. You will submit this part the day after you submit Part 2.

As an example of how to do this, for Exercise 7.22, you might have the player move to a room with several objects, list the items he has, have him pick up several objects, list the items he has and verify that the list has the additional items. You can perform your tests by comparing the result string with what you expect it to be. Remember to use the equals methods, with strings, not ==!

Note that each testMethod acts in the same way that GameGUI or GameTXT operate--by simply calling methods on the GameModel class.
Handing in
Submit all parts using Webhandin under assignment HW9. For Part 1, submit a PDF file containing your game description and map. If you are unable to do your map in such a way that you can transfer it to PDF, then you may submit that on paper.

For Part 2, submit a zipfile containing all of the files in your project directory.

For Part 3, submit a zipfile containing all of the files in your project directory.
Grades
Your grade will be based on Part 1 (2 points), Part 2 (5 points), and Part 3 (3 points).
Solutions from Fall, 2008