CMSC 202 Project 3

Heads-Up One Card Poker

Assigned Wednesday Oct 15, 2008
Program Due 7:00AM, Monday Nov 3, 2008
Weight 8%
Updates  

Objectives


Project Description
Once considered a game for old men in smoke filled rooms, poker is now a game played by adults of all ages and types in almost every casino in the world. There are various forms of poker such as Texas Hold'em, Omaha, Razz, 7-card stud, and many others. In this project you will write code to support the game of "One Card Poker". As the name implies, One Card Poker is a game between two players in which each player receives just one card. More details are provided below

As in project 2, the work for this simulation is broken into two parts. The GUI interface is being written by another group of students. Your assignment is to implement the supporting classes discussed in class this week.

Designing this project will be an in-class student exercise based on the specification below. In class we will identify the classes necessary for the game and specify the required interface between these classes and the GUI. Note that as the GUI is developed this interface may change slightly if the GUI programmers discover that more public methods are required for a particular class.

This project will use a GUI to allow the user to control the game and display pertinent information as the game progresses. The GUI and the main driver will be provided for you in Project3.java to be found in Mr. Frey's public directory for this project.


Project Specification
The game of "One Card Poker" uses a standard 52-card deck which is shuffled one time at the beginning of the game. Cards are not reused during the game. Each player starts with 1200 chips worth $1 each. A game consists of 26 rounds in which both players initially place $3 (the "ante") into the "pot". Both players are dealt one card. Based on the rank of his card, the first player ("the bettor") "bets" some number of chips to wager that his card is higher than his opponent's card. The bet is added to the pot. The second player (the "caller") now has the option of matching the bet ("calling") or giving up ("folding"). If the second player folds, the pot is awarded to the bettor. If the second player calls, he places the same number of chips as the bet into the pot and the cards are revealed. The player with the highest ranking card is awarded the pot. If both player's cards have the same rank, the pot is carried over to the next round. Players take turns being the bettor and caller. The bettor always receives the first card. At the end of the 26 rounds, the player with the most chips is the winner.
Specification Details

Requirements, Hints, and Tips
  1. Mr. Frey's public directory for this project is /afs/umbc.edu/users/f/r/frey/pub/202/Proj3
  2. Each file for this project should be part of a package named proj3.
  3. You must implement main in each class to perform unit testing. See Testing Your Class in Main for help writing main to test your classes.
  4. Note that some of these classes may be designed and implemented as immutable classes. That means that making copies of them is not necessary since "aliasing" does no harm. Use this fact to make your code easier, but be sure you can tell the difference.
    If your class is not immutable, be sure that you make copies of objects when apporpriate.
  5. Inheritance is not used in this project.

Project Policy
This project is considered an CLOSED project. Please review the CLOSED project policy on the course website.
Grading
See the course website for a description of how your project will be graded.
Project Submission
  1. submit all .java files you create.. DO NOT submit Project3.java, Suit.java, Rank.java.
  2. submitls to verify they are in the remote directory
The order in which the files are listed doesn't matter. However, you must make sure that all files necessary to compile and run your project are submitted. You need not submit all files at the same time. You may resubmit your files as often as you like, but only the last submittal will be graded and will be used to determine if your project is late. For more information, see the projects page on the course website.

You can check to see what files you have submitted by typing

submitls cs202 Proj3 More complete documentation for submit and related commands can be found here.

Remember -- if you make any change to your program, no matter how insignificant it may seem, you should recompile and retest your program before submitting it. Even the smallest typo can cause compiler errors and a reduction in your grade.

Avoid unpleasant surprises!