MCPcopy Index your code
hub / github.com/geekcomputers/Python / dealer_choice

Function dealer_choice

blackjack.py:59–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 return
58
59 def dealer_choice():
60 if sum(d_cards) < 17:
61 while sum(d_cards) < 17:
62 random.shuffle(deck)
63 d_cards.append(deck.pop())
64
65 print("Dealer has total " + str(sum(d_cards)) + " with the cards ", d_cards)
66
67 if sum(p_cards) == sum(d_cards):
68 print("***************The match is tie !!****************")
69 return
70
71 if sum(d_cards) > 21:
72 print("**********************Player is winner !!**********************")
73 return
74
75 if sum(d_cards) > sum(p_cards):
76 print("***********************Dealer is the Winner !!******************")
77 else:
78 print("**********************Player is winner !!**********************")
79
80 # Player turn
81 while sum(p_cards) < 21:

Callers 1

start_gameFunction · 0.70

Calls 3

shuffleMethod · 0.45
appendMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected