COW Q2 N6

SET Game

Level 1

Do the following:

·  Learn how to play and then play SET online. There are several web sites for this. One of the better ones is:

http://www.setgame.com/sites/default/files/Tutorials/tutorial/SetTutorial.swf

·  Look over the SetCard class. Take note of the SET Card has four aspects to it that are stored as ints. Each is set to a value of 1, 2, or 3 in the constructor when they are passed in. Take note that the class also has access methods for each aspect but does not have any way change them once they are set in the constructor.

Level 2

In the SETGame class:

·  Program the constructor

o  Make sure to create the two class ArrayLists and the array

·  Program createCardsForDealer

·  Program shuffle

·  After createCardsForDealer is finished, remove the first twelve cards and place them in the inPlayDeck array

·  Note that the three index variables should be set to -1 to indicate that they have not been set to any one card.

Level 3

In the SETGame class, program the pickCard method. Note that the index variables should be used to keep track of which cards have been picked. Once all three cards have been picked (ie – none of the indexes are -1), then match should be used to determine if all three cards are a match. For right now just have match return true. If there is a match then those three cards should be placed in the discardDeck and replaced by three new cards from the dealerDeck.

Level 4

In the SETGame class, program the match method so it functions properly. Hint – do NOT try and program it with one giant if statement.

Level 5

In the SETGame class, program the how many method that determines how many SETS are currently possibly from the cards in the inPlayDeck. Also, change pick so that once the number of cards in the dealerDeck runs out, have the cards from the discardDeck moved to the dealerDeck and reshuffle the dealerDeck.