COMP 14-090 Summer I 2000

Assignment 5: Video Poker (part I)

Assigned: Friday, June 9
Due: Thursday, June 15
Worth: 80 points

Description

       Write a text-based video poker game.  A description of the game and rules for scoring video poker are below.  Allow the user to play the game until he or she decides to quit. For this assignment, you do not have to implement the discard round of gameplay.  Tally the score after dealing the initial five cards.  (Note: You will have to implement discard in assignment 6.)  Don't reshuffle the deck after every hand -- only reshuffle when necessary (i.e., when you won't have enough cards to play a complete hand).

    The templates for all of the classes (including instance variables and method headers) have been provided.  Though, you will still need to add your own support methods to assist the tallyPoints method (such as hasFlush(), hasFullHouse(), ...).  It is your assignment to fill in the functions of the game.  You may design the user interface in any manner you like, but one requirement -- print to the screen only in the playTextGame method (this will help in assignment 6).  Extra credit will be given for outstanding user interfaces.
 

What to Turn In

Steps to Follow
  1. Follow the instructions in Getting Started with Visual J++ under "Creating a New Project."  Use Assignment5 as your project name.
  2. Follow the instructions under "Adding a New Class."  Name your class VideoPokerGame.
  3. For the Card and Deck classes, follow the instructions under "Adding a New Class" except choose Class instead of ClassMain.
  4. For each of the classes you've created, copy and paste the templates from the sample source code web page:  VideoPokerGame.java       Deck.java       Card.java
  5. Fill in the parts marked /* Insert your code here */ with code that you write.
  6. Save often!
Notes

Hints


Rules of Video Poker

The player is dealt 5 cards from a shuffled deck. The player then decides which cards, if any, to hold.  The rest are discarded.  The dealer replaces the discards, if any, with the next cards from the deck.  This marks the end of the hand -- time to tally the score.

Face order (lowest to highest): 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace

Scoring

1    Jacks or Better -- a pair of Jacks or higher
2    Two pair
4    Three of a kind
6    Straight -- any 5 cards in consecutive value order
10   Flush -- all 5 cards are in the same suit
14   Full House -- a pair and a three of a kind
20   Four of a Kind
40   Straight Flush -- satisfies both Flush and Straight
100 Royal Flush -- Straight Flush that goes 10 - Ace


Michele Clark
clark@cs.unc.edu

Back to COMP 14