CS494, Spring 05
Homework 2: Card Games

You may work in pairs or alone on this assignment.
Proposed due date: No later than Tuesday., March 15, at 11:59 pm.
Note: For each 24-hour period you submit earlier than that, you earn one free "late" day on the takehome midterm exam, up to a maximum of 3 late-days. The takehome midterm will be distributed on Weds., March 2, and also normally be due on Thurs., March 17, at 11:59 pm.
Comments on this policy welcome. Post them on the forum (see below) or send anonymous email. Comments will be read and possible changes introduced no later than Tuesday, March 1.

Introduction

Goal

You have just been hired by the Charlottesville Gaming Society to write an online poker system. Having dealt with them in the past, you know that they often change their specifications, so you need this system to be flexible and robust. For this assignment, you do not need to deal with any networking or graphical interfaces -- they just want to make sure that you can build a decent card playing system.

Resources

You will be making many design decisions and assumptions when building this system. You may decide that you have a superior design than the one given to you, but this may break compatibility with our testing components.
While coding must be done by yourself or in pairs, you are encouraged to discuss these design issues / limitations with one another. We have set up a class discussion forum specifically for this purpose on Toolkit:
http:/www.cs.virginia.edu/forums
You must register for a user-id and password first if you do not have one, and then go look in the CS494 forum.
Note: The TA will be monitoring the forum and may post helpful info there, so please monitor this!

The TA, Ben Taitelbaum <bet3q@cs.virginia.edu>, is your "client" and "supervisor" for this homework. Contact him with questions or problems, using email or the forum. Please put "CS494" in the subject-line of any email you send him.

Submission

To submit this project, jar/zip/tar your entire eclipse project and submit it to toolkit.
Note: we may change this! We're hoping to set up CVS for submission to make this easier for you (and for grading).

The CardGame System

We have created an API for the card playing system you are to create. While you may add more methods, classes, and packages, the specified method and package names must be adhered to (you only need to implement the public methods and properties. The protected and private ones are more of a suggestion - feel free to leave these out).
In addition to implementing this system, you must also create your own game. Note that a game is a combination of a CardGame subclass and a specific Hand and Deck. The CardGame determines the overall structure of the game (collecting bets, trading in cards, etc.) whereas the Hand determines who has better cards. In order to test the game, you must also subclass the Player class. You do not need to implement any advanced AI, although that would be great.

CardGames API

Examples

Here are some examples of classes you may wish to create:

JUnit Tests

While you are encouraged to write unit tests for all your methods, the following methods require adequate testing (for abstract methods, you should test your own methods in the subclasses)

Written Questions

Please include a text file named README with your project that contains your answers to the following questions. Please state any assumptions you make. For most of these, a sentence or two will suffice. Feel free to discuss these problems in the discussion forums.

  1. What are the biggest advantages of your design?
  2. What are the largest weaknesses of this design?
  3. How would you modify the design to add a graphical user interface? (We'll talk about this later in the term!)
  4. How would you modify the design to make it network playable?
  5. Can a player cheat in this game? If so, how?
  6. In games like seven card stud, some of the cards are face down (only visible to one player) while others are face up (visible to everyone). How would you model this behavior given the current design?
  7. What factors should a good AI consider?

Grading (Out of 100)