|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
See:
Description
| Class Summary | |
| Canvas | Provides some additional code on top of standard JPanels |
| Card | A Card from the game Set. |
| FrameworkTest | jUnit tests for SetGame framework. |
| ImageLoader | Load an image from a String or URL |
| SetCanvas | Play a solitaire game of Set on a GUI |
| SetGame | Implements the primary logic for the Set Game |
| SimpleTest | Quick tests for Project 2 |
This package implements project 2 for the Fall 2004 CMSC semester. The project consists of implementing a self-playing version of the Set Card Game.
The description below defines the standard rules of the card game Set. Some of you are already familiar with the game Set. For those that are not, information about the game, including a very simple but complete java tutorial on the rules of the game, can be found at http://www.setgame.com/set/
Briefly, the game Set consists of a collection of some number of playing cards layed out on a table. Each card is has four attributes: a number (1,2,3), a color (red, purple, green), a shape (squiggle, diamond,oval), and a shading (solid, striped, or open). Three cards form a set if for each attribute all three cards are the same, or all three cards are different. You might, for example, have a set in which
For example, the following form a set:
![]() |
![]() |
![]() |
| (1,red,solid,diamond) | (2,red,striped,diamond) | (3,red,open,diamond) |
1,2,3 are all different; all three are diamond; all three are red; and solid,striped,open are all different.
The following do not form a set:
![]() |
![]() |
![]() |
| (1,red,solid,diamond) | (2,red,striped, squiggle) | (3,red,open, diamond) |
The first card is a diamond, the second is a squiggle, the third is a diamond. These three things are neither all different (there are two diamonds) nor all the same (squiggle and diamond are different). Therefore the cards do not form a set.
In a human played game of Set cards are dealt onto the table and players simply pick up sets as fast as they can find them, the goal being to get the most cards. Typically there are 12 cards on the table, and whenever a set of 3 cards is removed, 3 new cards are drawn from the deck to replace them.
You must implement the SetGame class. It
provides some static methods, such as SetGame.generateDeck() and SetGame.isSet(oop2.setGame.Card, oop2.setGame.Card, oop2.setGame.Card). An instance of the class represents a set
of cards on a table in a set game. There are 8 instance methods for the
class that you must implement.
You should not modify any other existing class. You may write your own additional utility or testing classes.
You can test your code with simple unit tests, such as those provided
within the jUnit test clas SimpleTest.
There is also a class SetCanvas with a main
method that will display a visual representation of a robot solitaire game of
Set. This won't work very well until you've implemented most of the
functionality of the project. We've put up a
movie, much faster than normal speed,
to show you what this should look like.
For those overachievers out there, we have 4 physical copies of the Set Card Game to give away. We will give these out to the 4 people judged to do the most interesting extension of the project. Possible things to do for an extension:
If you want to do something for extra credit, please include a file named "ExtraCredit" in your submission explaining what you would like to have considered for extra credit.
The instructors reserve the right to decide that there are not 4 qualifying entries.
|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||