Mitra Poker
Poker 5-Card Draw ( Due 23 Mar 2012 )
In this programming assignment you will simulate a regular Pokergame otherwise known as the 5-Card Draw. Regular Poker is playedwith a standard deck of 52 cards. Cards are ranked from high tolow in the following order: Ace, King, Queen, Jack, 10, 9, 8, 7,6, 5, 4, 3, 2. The value of an Ace is higher than a King which ishigher than a Queen and so on. There are four suits - Spades, Hearts, Clubs, and Diamonds. The suits are of equal value.
KDslots.com Agen game multiplayer online ternama di Asia yang menyediakan permainan TEXAS POKER ONLINE, CEME KELILING ONLINE, DOMINO ONLINE, CEME ONLINE, BLACKJACK ONLINE, CAPSASUSUN ONLINE, SUPER 10 ONLINE, OMAHA ONLINE. Diskusikan dengan mitra poker Anda apakah ada situs web tertentu di tempat mereka suka bermain dan benar-benar merasa aman. Yang perlu Anda lakukan adalah mencari situs judi terbaik yang menyediakan roulette dan yang memungkinkan Anda memainkan versi permainan gratis dan uang yang sebenarnya. Coba versi uji coba Magic Hold em Poker Calculator dan banding sendiri dengan kalkulator peluang gratis. Nikmati lisensi gratis saat satu tahun dengan mendaftar dan kerjakan setoran kecil dengan situs mitra. Kamar-kamar ini termasuk Titan Poker, Party Poker, Full Tilt, Expekt, Mansion, dan Everest.
Rules of the Game
Each player is dealt five cards. The player with the highest valuedhand wins. The best to worst hands are ranked in the following order:
Mitra 99 Poker
- Royal Flush
- Straight Flush
- Four of a Kind
- Full House
- Flush
- Straight
- Three of a Kind
- Two Pair
- One Pair
- High Card
Royal Flush: A Royal Flush is made of 10, Jack, Queen, King, and Ace all of thesame of suit.The probability of getting a royal flush is so low that ties arenot broken.
Straight Flush: A straight flush is made of 5 cards innumerical sequence but of the same suit.If there are two straight flushes, then which ever hand has the highestcard value wins. In the above example, Hand 2 wins.
Four of a Kind: In four of a kind, the hand must have fourcards of the same numerical rank, e.g. four aces or four queens.In the event of a tie the hand that has highest ranking four of a kindcards wins. In the above example, Hand 2 wins.
Full House: For a full house, three of the cards must have thesame numerical rank and the the two remaining cards must also have the samenumerical rank but obviously different rank than the other three.If there are two full houses, then the hand that has the higher rankingcards for the three of a kind wins. In the above example, Hand 2wins.
Flush: In a flush there are 5 cards all of the same suit.The numerical order does not matter.In the event of two flushes, the one with the highest ranking cardwins. In the above example, Hand 1 wins.
Straight: In a straight hand, the 5 cards are in numericalorder but are not all of the same suit.When there are two stright hands, then the one with the highest rankingcard wins. In the above example, Hand 2 wins.
Three of a Kind: In three of a kind hand, there are 3 cardsof the same rank and the other two are unrelated.When there are two three of a kind hands, the hand with the highestranking three of a kind card wins. In the above example, Hand 2wins.
Mitra Power Supply Mtr 12136
Two Pair: In a two pair hand there are two cards of amatching rank, another two cards of a different matching rank, and a fifth random card.When there are two hands that are two pair the hand having the highestpair wins. If the highest pair in both hands are of the same rank, thenthe highest second pair wins. If the two hands have two identical pairs,then the hand with the highest ranking fifth card wins. In the example,above, Hand 2 wins.
One Pair: In a one pair hand there are two cards of the samerank and the other three cards are unrelated.In the event of a tie, then the hand with highest pair wins. If the twopairs are the same, then highest side card wins, and if necessary, thesecond highest side card, and finally the third highest side care can beused to break the tie. In the above example, Hand 1 wins.
High Card: If none of the hands in a game qualified under thecategories listed above then the hand having the highest ranking card wins.To break a tie, the second-highest, third-highest, fourth-highest, and thesmallest card can be used in order. In the above example, Hand 1wins.
Poker Game Simulation
You will modify the classes that you created for the Blackjack assignment. The overall structure of the program will be as follows:
Mitra Poker Qq
Use the Card class given below instead of the one in the book. Thenotation for the cards will be more compact.
In the function main() you will be prompting the user to enter thenumber of hands to play. Make sure that that number is between 2 and6 inclusive. In the class Poker you will create that many hands froma single of deck of cards. Here is a suggested outline of the Pokerclass:
Mira Poker
Most of the programming will be concentrated on writing the above functions.Now, these functions will return a 0 if the hand does not fulfil thatparticular condition. For example, if the hand is not four of a kind thefunction isFour() will return 0. Otherwise it will return a numbergreater than 0 that can used to order the hands and even break a tieaccording to the rules given above. There is a scheme that is suggestedbelow that you may or may not use.
Assignment of Points to a Hand: This scheme assumes that youwill systematically check if a hand meets the requirements from a RoyalFlush to a High Card. Once a hand has met a certain criteria,say Straight Flush then you will not check if it meets the criterialower down the ranking scale.
Mitra Poker Club
Here are the points (h) alloted for a hand:
- Royal Flush: 10
- Straight Flush: 9
- Four of a Kind: 8
- Full House: 7
- Flush: 6
- Straight: 5
- Three of a Kind: 4
- Two Pair: 3
- One Pair: 2
- High Card: 1
- Four of a Kind
- c1, c2, c3, and c4 are the ranks of the four of a kind cards and c5is the side card.
- Full House
- c1, c2, and c3 are the ranks of the three cards having the same rankand c4 and c5 are the ranks of the two remaining cards having the samerank.
- Three of a Kind
- c1, c2, and c3 are the ranks of the three cards of the same rankand c4 and c5 are the ranks of the remaining cards where c4 has higherrank than c5.
- Two Pair
- c1 and c2 are the ranks of the first and higher ranking pair. c3and c4 are the ranks of the second and lower ranking pair. c5 is therank of the remaining side card.
- One Pair
- c1 and c2 are the ranks of the pair of cards having the same rank.c3, c4, and c5 are the ranks of the side cards from highest to lowestrank.
The file that you will be turning in will be called Poker.py. The file will have a header of the following form:
Your output session will look as follows:
Use the turnin program to submit your Poker.py file. The TAs should receiveyour work by 11 PM on Friday, 23 March 2012. We will be looking for cleanlogic and good documentation. There will be substantial penalties if you donot adhere to the guidelines.
- You must submit the .py file.
- Your .py file should have the header with the proper documentation.
- You should be submitting your .py file through the web based turnin program. We will not accept files e-mailed to us.
- Your code must compile and run before submission.
- Here is the Grading Criteria.