Question: need help finishing this code in python. I started a portion Score category calculations - Singles: The sum of the occurrences of a single value.
need help finishing this code in python. I started a portion




Score category calculations - Singles: The sum of the occurrences of a single value. - Three of a kind: 30 , if the dice contain at least three of the same values. - Four of a kind: 40 , if the dice contain at least four of the same values. - Five of a kind: 50 , if the dice contain five identical values. - Full house: 35 , if the dice contain a full house (a pair and three of a kind). Note: Five of a kind also satisfies the definition of a full house since (4,4,4,4,4) includes a pair of 4 s and three 4s. - Straight: 45 , if the dice contain a straight of (1,2,3,4,5) or (2,3,4,5,6). Design requirements In the file main.py - do not make any changes In the file poker.py implement the following functions: - check_singles parameters: a list of five dice values, a possible die value returns singles score - check_three_of_a_kind parameter: a list of five dice values returns 0 or three of a kind score - check_four_of_a_kind - parameter: a list of five dice values - returns 0 or four of a kind score - check_five_of_a_kind - parameter: a list of five dice values - returns 0 or five of a kind score - check_full_house - parameter: a list of five dice values - returns 0 or full house score - check_straight - parameter: a list of five dice values - returns 0 or straight score - find_highest_score - parameter: a list of five dice values - returns the highest score among the six possible scoring categories In the file poker_dice_test.py, implement incremental tests of poker.py. There should a minimum of two tests for each function in poker.py. - check_singles tests: Input: [1,2,4,4,5],1 Result: 1 Input: [1, 2, 4, 4, 5], 2 Result: 2 Input: [1,2,4,4,5],3 Result: 0 Input: [1, 2, 4, 4, 5], 4 Result: 8 - Input: [1,2,4,4,5],5 Result: 5 - Input: [1, 2, 4, 4, 5], 6 Result: 0 - check_three_of_a_kind tests: - Input: [2,3,3,3,6] Result: 30 \# Find highest score def find_high_score(values): high_score = 0 \# Type your code here. return high_score \# Add all occurences of goal value def check_singles(dice, goal): score =0 \# Type your code here. return score \# if die1 >= 3 : def check_three_of_a_kind(dice): score =0 die1=0 die =0 die3=0 die4=0 die5=0 \# Type your code here. for x in dice: if
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
