Need help with your Discussion

Get a timely done, PLAGIARISM-FREE paper
from our highly-qualified writers!

glass
pen
clip
papers
heaphones

Program Poker Hand Evaluation

Program Poker Hand Evaluation

Program Poker Hand Evaluation

Question Description

Poker Hand Evaluation – From Best to Worst

Note: Cards can appear in any order.

  • Royal Flush: Contains a 10, jack, queen, king and ace, all of the same suit. For example: king clubs, jack clubs, ace clubs, 10 clubs, queen clubs.
  • Straight Flush: Contains five consecutive cards that share the same suit. A straight flush does not contain an ace. For example: 3 clubs, 7 clubs, 6 clubs, 4 clubs, 5 clubs.
  • Four of a Kind: Contains four cards that share the same rank. For example: 4 clubs, 10 diamonds, 4 hearts, 4 spades, 4 diamonds.
  • Full House: Contains three cards that share the same rank and two cards that share a different rank. For example: jack hearts, king hearts, king clubs, jack clubs, jack diamonds.
  • Straight: Contains five consecutive cards that do not all share the same suit. For example: 3 clubs, 7 diamonds, 6 hearts, 5 hearts, 4 clubs.
  • Three of a Kind: Contains three cards that share the same rank and two cards that have unique ranks. For example: 6 clubs, 7 clubs, 8 clubs, 7 diamonds, 7 hearts.
  • Two Pair: Contains two cards that share the same rank, two cards that share a different rank, and one card that has a unique rank. For example: six diamonds, six hearts, queen spades, ace clubs, queen diamonds.
  • Pair: Contains two cards that share the same rank and three cards that have unique ranks. For example: king hearts, queen hearts, 9 diamonds, 9 hearts, ace spades.
  • Nothing: All other hands of five cards. For example: 9 hearts, 6 diamonds, 3 diamonds, 10 spades, queen clubs.

Assignment

  • Download poker.py, make sure that you fully understand it, and then modify it so that it evaluates poker hands correctly. When it is run using the hands provided, it should produce this output.
  • The evaluate function is correct – do not modify it.
  • If it is helpful to do so, you are welcome to introduce other functions into your solution.

Grading – 100 points

Note: Your program will be tested on a different set of poker hands than the ones that appear in the main() function of poker.py. Thus, it is important that you test your program on different inputs and identify the different types of poker hands in a general fashion.

  • 10 points – Every royal flush is identified correctly. (All or nothing.)
  • 5 points – Every straight flush is identified correctly. (All or nothing.)
  • 10 points – Every four of a kind is identified correctly. (All or nothing.)
  • 10 points – Every full house is identified correctly. (All or nothing.)
  • 10 points – Every straight is identified correctly. (All or nothing.)
  • 10 points – Every three of a kind is identified correctly. (All or nothing.)
  • 10 points – Every two pair is identified correctly. (All or nothing.)
  • 10 points – Every pair is identified correctly. (All or nothing.)
  • 10 points – Every nothing is identified correctly. (All or nothing.)
  • 15 points – The Python solution is properly commented, easy to understand, high quality and does not contain unnecessary code. (3 points for each type of improvement up to 15 points.)

Test Data

def main():    print("CSCI 127: Poker Hand Evaluation Program")    print("---------------------------------------")    evaluate([[14, "spades"], [10, "spades"], [8, "spades"], [2, "hearts"], [5, "spades"]])     # nothing    evaluate([[14, "spades"], [6, "spades"], [8, "spades"], [6, "hearts"], [5, "spades"]])      # 1 pair    evaluate([[14, "spades"], [6, "spades"], [14, "clubs"], [6, "hearts"], [5, "spades"]])      # 2 pair    evaluate([[14, "spades"], [6, "spades"], [8, "spades"], [6, "hearts"], [6, "clubs"]])       # 3 of a kind    evaluate([[3, "spades"], [5, "spades"], [6, "spades"], [4, "hearts"], [2, "spades"]])       # straight    evaluate([[4, "spades"], [6, "spades"], [4, "diamonds"], [6, "hearts"], [6, "clubs"]])      # full house    evaluate([[14, "spades"], [6, "spades"], [6, "diamonds"], [6, "hearts"], [6, "clubs"]])     # 4 of a kind    evaluate([[13, "spades"], [11, "spades"], [12, "spades"], [9, "spades"], [10, "spades"]])   # straight flush    evaluate([[13, "spades"], [11, "spades"], [12, "spades"], [14, "spades"], [10, "spades"]])  # royal flush

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter


1. Professional & Expert Writers: Eminence Papers only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Eminence Papers are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Eminence Papers are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Eminence Papers, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.

We Can Write It for You! Enjoy 20% OFF on This Order. Use Code SAVE20

Stuck with your Assignment?

Enjoy 20% OFF Today
Use code SAVE20