CSC 216 F09/pretty-pretty-program: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 24: Line 24:


Spaces on the Game Board
Spaces on the Game Board
  - The spaces on the game board mean different things when you land on them.
( The spaces on the game board mean different things when you land on them.)
#Crown: Add the Crown to your LinkedList if no one has yet added it. Otherwise, use a Remove method to get the crown from them, and then add it into your LinkedList instead.
#Crown: Add the Crown to your LinkedList if no one has yet added it. Otherwise, use a Remove method to get the crown from them, and then add it into your LinkedList instead.
#Black ring: If you land on the black ring, you must add the black ring to your LinkedList. If another player already has the black ring in their linked list, use a remove method to take the ring from them and add it to your own list.
#Black ring: If you land on the black ring, you must add the black ring to your LinkedList. If another player already has the black ring in their linked list, use a remove method to take the ring from them and add it to your own list.

Revision as of 18:27, 17 November 2009

Formatting Resources

Formatting Help Guide from MetaWiki

Pretty Pretty Program

The problem

This exercise is loosely based on the board game, "Pretty Pretty Princess", a game in which players must acquire 5 pieces of jewelry: 2 earrings, a necklace, a tiara, and a ring.

In this exercise, students will play a variant called "Pretty Pretty Programmer", where they will try to collect the same things. However instead of actually wearing the items in question, the students must demonstrate their mastery of Java by storing the items in a LinkedList. Students must be able to both add, swap, and remove objects from the list, as the dreaded "Black Ring" can not be used to win the game, and must be replaced with a regular ring before the player can win.

Participants and props

The class will be divided into four teams, and the game also requires a gameboard and a spinner.

The script

Who Goes First?

  1. Everyone who is playing spins the spinner. The player who spins the highest number goes first, and the play continues clockwise.

Game Play

  1. Spin the spinner and move your piece the number of spaces the spinner lands on. The space you land on will have a direction for you to follow. If you land on a space and already have that piece of jewelry, your turn is over. If you land on a space with the earrings, you may only add one earring to your LinkedList. That is the end of the turn, and the play goes to the next person. You can also share spaces with other people.

Spaces on the Game Board ( The spaces on the game board mean different things when you land on them.)

  1. Crown: Add the Crown to your LinkedList if no one has yet added it. Otherwise, use a Remove method to get the crown from them, and then add it into your LinkedList instead.
  2. Black ring: If you land on the black ring, you must add the black ring to your LinkedList. If another player already has the black ring in their linked list, use a remove method to take the ring from them and add it to your own list.
  3. Take any piece: Add a single piece of jewelery to your LinkedList. This can come from other players (in which case, they must remove the item from their list) or from the unclaimed pile (so you only must add it to your own). You can take the crown, even if no one else has claimed it.
  4. Put one back: You must remove any piece of your jewelry or the crown from your LinkedList. If you have the black ring, you must remove this from your LinkedList instead of getting to choose. If there is nothing for you to return, your turn is over.

Winning

  1. To win the game, you must collect a complete set of the jewelry in your LinkedList. You must also have the crown and not have the black ring. If you have all of that, you win. Turn to the programmers all around you and haughtily announce, "I'm a Pretty Pretty Programmer!"

See http://www.ehow.com/about_5076372_pretty-pretty-princess-game-rules.html as a reference