CSC 216 F09/pretty-pretty-program

From Expertiza_Wiki
Jump to navigation Jump to search


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 crown, and a ring.

In this exercise, students will play a variant called "Pretty Pretty Program", where they will try to collect the different parts of a program. 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 programmers are very greedy, and much stealing, replacing, and bickering over each others LinkedLists is bound to occur.

Participants and props

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

4 small tokens, or some other way to note team positions.

A 4-sided die or 4 section spinner numbered 1-4 is also required.

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. Players may place their team marker on any of the 16 spaces to start.
  2. 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 code, your turn is over. If you land on a space with the JUnit tests, you may only add one JUnit 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. Compiler: Add the Compiler to your LinkedList if no one has yet added it. Otherwise, use a Remove method to take the Compiler from them, and then add it into your LinkedList instead.
  2. Null Pointer Exception: If you land on the Null Pointer Exception object, you must add it to your LinkedList. If another player already has a Null Pointer Exception in their linked list, use a remove method to take it from them and add it to your own list. The Null Pointer Exception replaces your team's getter/setter object, if you already have one.
  3. Steal Code!: Add a single piece of code 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 compiler, even if no one else has claimed it.
  4. Crash Without Saving!: You must remove any piece of your code or the Compiler from your LinkedList. If you have the Null Pointer Exception, you must remove this from your LinkedList instead of getting to choose. If there is nothing for you to return, your turn is over.
  5. JUnit Test: Add a single JUnit Test to your LinkedList. If you already have a JUnit Test, you may take another.
  6. GUI Elements: Add the GUI Elements to your LinkedList.
  7. Instance Variables: Add Instance Variables to your LinkedList.
  8. Getters / Setters : Add Getters/Setters to your LinkedList.

Maintaining your LinkedList

  1. The order one acquires the code pieces is irrelevant, but your LinkedList must not have any "holes" in it. When an element is removed by another player, your team must write code to condense the list so that you no longer have any null objects as part of the LinkedList.
  2. Your LinkedList starts out already defined with zero elements. The name of your LinkedList is the same as your team name (default: Purple / Green / Pink / Blue)

Winning

  1. To win the game, you must collect all the necessary code in your LinkedList: This includes TWO JUnit Tests, Instance Variables, Getters/Setters, and GUI Components. You must also have the Compiler and not have the Null Pointer Exception. If you have all of that, you win. Turn to the programmers all around you and haughtily announce, "I have a Pretty Pretty Program!"

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