Program 4 for Comp 150
This is a pair assignment worth 40 points, with 80% allocated to code that works correctly and 20% to the graphical user interface.
The program should begin with a comment including your names,
a brief description of what the program does and information on any help you received on
the project. If it is entirely your own
work, say so. If anyone helped either of you,
identify them by name and describe how they helped.
Remember to have each team member submit a log to
Blackboard also. It is described in the Pairs Administration page:
The log should
indicate your hours working on the homework and an assessment of your
contribution and an assessment of your partner's
contribution. Please name the file 150log4ID.doc, where ID is your
blackboard ID, and the 4 refers to Program 4, so if I were submitting a
log for this assignment, it would
be called 150log4aharrin.doc.
The Problem: Find the Hole
The program should use a random number generator to select a
point and a radius around that point. These constitute the target and
are not revealed to the player. The user is then permitted
to click around on the screen to “find the hole”. You
should show the points the user has tried. Once the user selects
a point that is within the mystery radius of the mystery point, the
circle and possibly a different color of the point should appear.
There should be a message announcing how many steps it took.
Here are some enhancements
- You can make it more interesting by putting a limit on the number
of tries the user can have. You could think about what would be
reasonable – does it depend on the radius? On the number of
possible point?
- Add extra graphical items like a count of the current number of tries
- You might offer different levels of difficulty for playing the game – fewer tries, a smaller circle, etc.
- You can always make it more visually appealing.
- You can permit the user to decide the number of games to play and then display the best score.
A grade of 80% (32) will be given for a program that correctly
satisfies the minimum requirements. Better grades will be given
to projects that implement one or more enhancements and a nice user
interface.