2009:Oct:28(Wed)
CS 162[M]
Project #1: Chutes and Ladders®
Due Monday, November 8, at Lecture
Write a Java program for playing
a simplified version of Chutes and Ladders®.
"Chutes and Ladders® is a registered trademark
of Milton Bradley/Hasbro.
For a description of this game,
see
http://www.hasbro.com/shop/details.cfm?guid=8EC0A8E0-6D40-1014-8BF0-9EFBF894F9D4&product_id=8626&src=endeca
and
http://www.hasbro.com/common/instruct/Chutes_and_Ladders_2004.pdf .
Here are images of an implementation of this game:
*
*
*
*
*
*
Details of the requirements for your work are as follows:
-
Your implementation doesn't have to look exactly like the images above.
(In fact you may notice that there are actually some differences
between some of the images above.)
But your program should possess functionality at least equivalent to
what's shown and specified here.
For example,
your program's goal doesn't have to be exactly 50,
but something like that.
-
A player's turn should proceed as follows:
-
The player clicks the 'spin(ner)'.
-
The 'spinner' choose a number randomly ranging
from 1 to 6.
-
If the player's current location
plus the spun number exceeds the number of spaces
on the board, then the player is told this
and their turn ends.
Otherwise, the turn continues as follows:
-
The player clicks the space where their icon is resting.
-
The space where the icon was resting no longer shows the icon
brightly,
and
the cursor (mouse) changes to the icon.
-
The player clicks the appropriate destination space.
-
The space where the icon was previously resting no longer shows the icon
at all,
the cursor (mouse) changes back to the default one,
and
the destination space shows the icon.
-
If that destination space is the 'beginning' of a 'ladder' or 'chute',
then the
player is informed and
the
icon automatically moves from that destination
to the 'end' of the ladder/chute.
- To earn a "B", it suffices to do that basic work.
-
You can earn a "B+" if you do that basic work and additionally write
your program in good style,
i.e.
using
Good Programming Practices
such as
standard
"Code Conventions for the JavaTM Programming Language" --
see
http://java.sun.com/docs/codeconv/ .
-
If you do the basic work
specified above
and you additionally write
your program in good style,
then further,
you may earn a
higher grade such as "A-" or better
by doing extra work.
Naturally, the quality of such an extra-credit grade
depends on the quality of the extra-credit work that you do.
Some suggestions are as follows:
-
Provide instructions.
-
Provide sounds.
-
Enable starting a new game (without completely restarting the program).
-
Number the spaces more like the real Chutes and Ladders game:
going upward from the bottom, and
having adjacency by
going
right-to-left sometimes.
-
Have a 'spinner' that appears more like a spinner.
-
Show chutes and ladders.
-
Enable the player to choose an icon.
-
Enable multiple players.
-
Enable keyboard shortcuts.
-
Do some other extra work that you think of.
Note that
writing
your program in good style,
i.e.
using
standard
Code Conventions,
is a precondition for getting
a
grade such as "A-" or better
via extra work.
Turn in
Submit a printout of your code,
a screen-shot showing the dialog when a player uses a ladder or chute,
and a screen-shot of the end of a game with the congratulatory dialog.
We may also do demos.
(Copyright © 2009 by
Hugh McGuire.)