MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / generate_random_hand

Function generate_random_hand

project_euler/problem_054/test_poker_hand.py:139–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

137
138
139def generate_random_hand():
140 play, oppo = randrange(len(SORTED_HANDS)), randrange(len(SORTED_HANDS))
141 expected = ["Loss", "Tie", "Win"][(play >= oppo) + (play > oppo)]
142 hand, other = SORTED_HANDS[play], SORTED_HANDS[oppo]
143 return hand, other, expected
144
145
146def generate_random_hands(number_of_hands: int = 100):

Callers 1

generate_random_handsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected