CS Project 1 Fall 2017

Similar documents
CS Programming Project 1

Programming Assignment 4

PROBLEM SET 2 Due: Friday, September 28. Reading: CLRS Chapter 5 & Appendix C; CLR Sections 6.1, 6.2, 6.3, & 6.6;

{ a, b }, { a, c }, { b, c }

To play the game player has to place a bet on the ANTE bet (initial bet). Optionally player can also place a BONUS bet.

BRIDGE is a card game for four players, who sit down at a

Problem Set 4: Video Poker

LEARN HOW TO PLAY MINI-BRIDGE

Simple Poker Game Design, Simulation, and Probability

TABLE OF CONTENTS TEXAS HOLD EM... 1 OMAHA... 2 PINEAPPLE HOLD EM... 2 BETTING...2 SEVEN CARD STUD... 3

Counting Poker Hands

Poker Hands. Christopher Hayes

Poker Rules Friday Night Poker Club

A Case Study. Overview. References. Video poker Poker.Card & Poker.Hand General.dll & game variants

CS 210 Fundamentals of Programming I Spring 2015 Programming Assignment 8

Activity 6: Playing Elevens

10, J, Q, K, A all of the same suit. Any five card sequence in the same suit. (Ex: 5, 6, 7, 8, 9.) All four cards of the same index. (Ex: A, A, A, A.

Problem A. Worst Locations

P a g e 1 HOW I LEARNED POKER HAND RANKINGS

CHAPTER 649a. THREE CARD POKER

TABLE GAMES RULES OF THE GAME

CS 210 Fundamentals of Programming I Fall 2015 Programming Project 8

PHASE 10 CARD GAME Copyright 1982 by Kenneth R. Johnson

Maryland State Lottery and Gaming Control Agency Standard Rules Criss Cross Poker

Maryland State Lottery and Gaming Control Agency Standard Rules - Double Draw Poker

DELIVERABLES. This assignment is worth 50 points and is due on the crashwhite.polytechnic.org server at 23:59:59 on the date given in class.

CSE 231 Fall 2012 Programming Project 8

HEADS UP HOLD EM. "Cover card" - means a yellow or green plastic card used during the cut process and then to conceal the bottom card of the deck.

Texas Hold'em $2 - $4

Ante or ante wager means the initial wager required to be made prior to any cards being dealt in order to participate in the round of play.

FORTUNE PAI GOW POKER

A. Rules of blackjack, representations, and playing blackjack

9 Video Poker Paytables in 1 Game Ultimate X Triple Play Draw Poker provides a rich selection of the most popular video poker paytables:

After receiving his initial two cards, the player has four standard options: he can "Hit," "Stand," "Double Down," or "Split a pair.

CHAPTER 69F RULES OF THE GAMES

CSCI 4150 Introduction to Artificial Intelligence, Fall 2004 Assignment 7 (135 points), out Monday November 22, due Thursday December 9

A Rule-Based Learning Poker Player

For this assignment, your job is to create a program that plays (a simplified version of) blackjack. Name your program blackjack.py.

GAMBLING ( ) Name: Partners: everyone else in the class

List of poker hands. Contents. General rules

FAST ACTION HOLD EM. Copy hand-- means a five-card hand of a player that is identical in rank to the five-card hand of the dealer.

The Secret to Performing the Jesse James Card Trick

Chapter 2 Integers. Math 20 Activity Packet Page 1

Lab Exercise #10. Assignment Overview

Up & Down GOAL OF THE GAME UP&DOWN CARD A GAME BY JENS MERKL & JEAN-CLAUDE PELLIN ART BY CAMILLE CHAUSSY

BLACKJACK Perhaps the most popular casino table game is Blackjack.

FLOP POKER. Rank-- or ranking means the relative position of a card or hand as set forth in Section 5.

Welcome to the Best of Poker Help File.

No Flop No Table Limit. Number of

HIGH CARD FLUSH 1. Definitions

Poker Hand Rankings Highest to Lowest A Poker Hand s Rank determines the winner of the pot!

ULTIMATE TEXAS HOLD EM

FOUR CARD POKER. Hand-- means the best four card poker hand that can be formed by each player and the dealer from the cards they are dealt.

Ch. 670a SIX-CARD FORTUNE PAI GOW POKER a.1. CHAPTER 670a. SIX-CARD FORTUNE PAI GOW POKER

POKER. Bet-- means an action by which a player places gaming chips or gaming plaques into the pot on any betting round.

Bridge Players: 4 Type: Trick-Taking Card rank: A K Q J Suit rank: NT (No Trumps) > (Spades) > (Hearts) > (Diamonds) > (Clubs)

Alberta 55 plus Cribbage Rules

FreeCell Puzzle Protocol Document

CATFISH BEND CASINOS, L.C. RULES OF THE GAME FOUR CARD POKER

Project 2 - Blackjack Due 7/1/12 by Midnight

Phase 10 Masters Edition Copyright 2000 Kenneth R. Johnson For 2 to 4 Players

Presents: Basic Card Play in Bridge

Live Casino game rules. 1. Live Baccarat. 2. Live Blackjack. 3. Casino Hold'em. 4. Generic Rulette. 5. Three card Poker

Ultimate Texas Hold em features head-to-head play against the player/dealer and optional bonus bets.

CRISS-CROSS POKER. Community cards Cards which are used by all players to form a five-card Poker hand.

Electronic Wireless Texas Hold em. Owner s Manual and Game Instructions #64260

CSE231 Spring Updated 04/09/2019 Project 10: Basra - A Fishing Card Game

13:69E 1.13Z 5 Card Hi Lo table; physical characteristics. (a) 5 card hi lo shall be played at a table having on one side

LESSON 6. Rebids by Responder. General Concepts. General Introduction. Group Activities. Sample Deals

TEXAS HOLD EM BONUS POKER

CS107L Handout 06 Autumn 2007 November 2, 2007 CS107L Assignment: Blackjack

The Exciting World of Bridge

2. A separate designated betting area at each betting position for the placement of the ante wager;

Corners! How To Play - a Comprehensive Guide. Written by Peter V. Costescu RPClasses.com

PLAYERS AGES MINS.

Battle. Table of Contents. James W. Gray Introduction

Red Dragon Inn Tournament Rules

6/24/14. The Poker Manipulation. The Counting Principle. MAFS.912.S-IC.1: Understand and evaluate random processes underlying statistical experiments

acorns and flowers. The cards in each suit are ace, king, ober, under, banner, nine, eight, seven, six.

CARIBBEAN. The Rules

2016 CCSC Eastern Conference Programming Competition

LET IT RIDE POKER. Stub-- means the remaining portion of the deck after all cards in the round of play have been dealt or delivered.

Problem A: Code Breaking

THE NUMBER WAR GAMES

Animal Poker Rulebook

Finite Mathematical Structures A

Math 1111 Math Exam Study Guide

Fall 2017 March 13, Written Homework 4

Defensive Signals. Attitude Signals

POKER LOTTO GAME CONDITIONS and PRIZE STRUCTURE STATEMENT

1. Number of Players Two people can play.

HOW to PLAY TABLE GAMES

Sorting Squares. (Martin Gardner)

Name: Checked: jack queen king ace

CATFISH BEND CASINOS, L.C. RULES OF THE GAME FORTUNE PAI GOW

Lab 1. CS 5233 Fall 2007 assigned August 22, 2007 Tom Bylander, Instructor due midnight, Sept. 26, 2007

LESSON 2. Objectives. General Concepts. General Introduction. Group Activities. Sample Deals

(e) Each 3 Card Blitz table shall have a drop box and a tip box attached to it on the same side of the table as, but on opposite sides of the dealer.

13:69E-1.13Z Criss cross poker; physical characteristics

ECE2049: Foundations of Embedded Systems Lab Exercise #1 C Term 2018 Implementing a Black Jack game

Transcription:

Card Game: Poker - 5 Card Draw Due: 11:59 pm on Wednesday 9/13/2017 For this assignment, you are to implement the card game of Five Card Draw in Poker. The wikipedia page Five Card Draw explains the order in which cards are given to the players and Poker determines the "value" of each hand. This project is to be done individually. This is NOT a team project. You are to use the Java Programming Language for this project. The game is played using a standard deck of 52 cards. Each card has a Rank and Suit value. There are 13 Ranks and 4 Suits making the 52 cards in the deck. The Suits are colored either Black or Red. The cards are to be listed using a two character sequence for each card. The first character is to specify the rank of the card and the second character is to specify the suit. The ranks and suits with the associated characters are given in the table below. Use upper case letters when specifying cards. Rank Characters 2 - Two 3 - Three 4 - Four 5 - Five 6 - Six 7 - Seven 8 - Eight 9 - Nine T - Ten J - Jack Q - Queen K - King A - Ace Suit Characters C - Clubs (Black) D - Diamonds (Red) H - Hearts (Red) S - Spades (Black) Note that the ranks are listed in order with Two being the lowest rank, Ace being the high rank. In the game of Poker, an Ace can being either low or high. Aces should be treated as a high rank in all cases except in the cases of "straights" (to be explained below). Thus: 7C > 5S According to the wikipedia, the suits don't impact the game of poker except when determining a flush. We will use the rules described at its Rank of Hands page as our official rules.

The Game's Idea In the game of Five Card Draw, the following actions occur. 1. The 52 cards in the deck are shuffled (randomized) and put in the "draw pile". 2. Then each player is given one card in some determined order. This is repeated (using the same order of players) until each player has 5 cards. This is called "dealing the cards" into each player s hand. 3. The first player is allowed to discard up to 3 cards from their hand (the "first" player is player at the beginning of the order from step 2). The player can discard a 4th card only if the remaining card in the player's hand is an Ace. The cards that are discarded are put into a "discard pile" which is separate from the "draw pile". The player then given enough cards from the "draw pile" so that the player will have 5 cards. Following the same order that was used in dealing the cards, this is repeated for the other players. 4. Now the hands are evaluated and the winner is determined. The Evaluation of Hands Refer to wikipedia's page on poker's rank of hands for our official page on this. It has a great way to determine how a determine ties and how to determine winners when things appear the same. Since our rules do not include wild cards, the Straight Flush is the highest possible hand. The evaluation of hands from highest to lowest is: Straight Flush - All five cards are in sequence and of the same suit. An Ace can be either the high card (AS KS QS JS TS) or the low card (5H 4H 3H 2H AH). When comparing two Straight Flushes, the two high cards are compared. If these are the same, there is a tie. Four of a Kind - Four of the five cards have the same rank. When comparing, the rank of the matched cards is used to determine the winner. Full House - Three of the cards have one rank and two of the cards have another rank. When comparing, the rank of the three matched cards is used to determine the winner. Flush - All five cards have the same suit. When comparing two flushes, the highest ranking card of each hand is used. If there is a tie, compare the next highest ranking card. Straight - All five card are in sequence. An Ace can be either the high card (AS KD QS JH TC) or the low card (5S 4D 3H 2C AS). When comparing the straights the high card from each straight is compared. If these are the same, there is a tie. Three of a Kind - Three of the five cards have the same rank. When comparing, the rank of the matched cards is used to determine the winner. Two Pair - Two cards in the hand contain one rank and a different two cards in the hand contain another rank. When comparing, the ranks of the higher ranked pair are

compared first. If those are the same, then the ranks of the lower ranked pair are compared. If those are also the same, the ranks of the remaining card are compared. If these are the same, there is a tie. One Pair or Two of a Kind - Two cards in the hand contain the same rank. When comparing, the rank of the matched cards are compared first. If there is a match, the non-paired cards are compared to determine the winner. If the non-paired cards contain the same ranks, there is a tie. High Card - When no cards have the same rank, nor are the five cards in sequence nor are the five cards of the same suit, the rank of the highest card is used to determine the winner. If those are the same the ranks of the next highest cards are compared. If the ranks are all the same, there is a tie. The Prompt for the User Player Your program must give some messages and prompt as the game is played. 1. The first prompt given to the user is the number of computer opponents. Your program must allow answers from 1 to 3. You can allow less computer opponents (i.e. zero) or more as you wish, but your program must accept the values 1, 2 and 3. 2. The program should then give some messages about the play of the game (i.e. "the desk is being shuffled", "the cards are being dealt to 3 players"). 3. The game is next in the "discard and draw" phase. When it is a computer opponent's turn to discard and draw, your program must display a message something like: Computer Player 1 has discarded 3 cards. When it is the user player's turn, you must show the five cards in the players hand and allow the user the select which cards will be discarded. Perhaps there is a prompt such as: The cards in your hand are: 1) AS 2) KH 3) TD 4) TC 5) 6S Since you have an Ace you can keep the Ace and discard the other four cards. List the cards numbers you wish to discard. > 4. Now show all of the hands, specify what type of hand it is (i.e. One Pair, Three of a Kind, etc) and list the winner. 5. Then thank the player for using the program and list whatever information you wish about the program. Finally end the program. When showing the cards in a hand, sort the cards from highest to lowest with the highest card being listed first (on the left).

For 5 points extra credit, sort the cards so that any matched cards are listed first. When multiple matched cards are in the hand (i.e. two pair or full house), list the more important match first. This would be the match with the higher rank for two pair and the match of three for the full house. Doing this will make breaking ties extremely easy. So you are strongly encouraged to do this. Not only will you get extra credit, but this will simplify a potentially difficult part of the assignment. The Computer Player's AI Algorithm For the computer player's turn, use the following AI algorithm. 1. First check if the computer player already has a hand of One Pair or better. If so, discard all other card. 2. If the hand evaluates to "High Card", determine if the user has 4 cards of the same suit. If so, discard the card of the different suit. 3. Next determine if the user has 4 cards in sequence. If so, discard the card that is out of sequence. 4. Next if the user has an Ace, discard the other four cards. 5. Otherwise, keep the two highest cards and discard the other 3. Class Requirements You must write at least 5 classes for this program. These classes are: 1. A Card Class - This class will keep the information about each card. 2. A Card Pile Class - This class is a collection of cards. While this class cannot just be an instance of a Java Collection Class, you may use a Java Collection Class instance as a data member of the Card Pile Class. 3. A User Player Class - This class will keep track of the user's hand and interact with the user interface. 4. An Opponent Player Class - This class will keep track of the computer player's hand and interact with the Artificial Intelligence. 5. A Game Class - This class is to contain the method main. This class will also keep track of the particulars of the game, such as the order of actions of the game (shuffling, dealing, discarding and determining the winner) and the evaluation of the hand (does the player have a Straight Flush, Four of a Kind, Full House, etc.). Actually it might be better to divide this into two classes: one to deal with the order of the actions and one to evaluate the hands.

General Comments Your program must be written in good programming style. This includes (but is not limited to): meaningful identifier names, a file header at the beginning of each source code file, a header comment at the beginning of each method, proper use of blank lines and indentation to aide in the reading of your code, explanatory "value-added" in-line comments The work you turn in must be 100% done on your own. You are not allowed to share code with any other students (inside this class or not). You may discuss the project with other students; however, you may not show any code you write to another student nor may you look at any other student's written code. This project is to be done individually (no teams for this project). Assignment Submission Assignments are to be submitted via Blackboard (unless something different is announced in class). Refer to the class syllabus for penalties for late submission.