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

Method calculate_chips

BlackJack_game/blackjack_simulate.py:590–607  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

588 return "Both"
589
590 def calculate_chips(self):
591 if self.choice == "Surrender":
592 if self.player.chips.bet_amount == 1:
593 if self.player.chips.current_amount() == 0:
594 self.player.chips.amount = 0
595 else:
596 surrender_amount = self.player.chips.bet_amount // 2
597 self.player.chips.amount -= surrender_amount
598
599 elif self.choice in ("Double-down", "Stand", "Insurance", "Hit"):
600 if self.winner == "Player":
601 self.player.chips.amount += (
602 self.player.chips.bet_amount + self.player.chips.insurance * 2
603 )
604 elif self.winner == "Dealer":
605 self.player.chips.amount -= (
606 self.player.chips.bet_amount + self.player.chips.insurance
607 )
608
609 def result_exhibit(self):
610 def get_color():

Callers 1

playMethod · 0.95

Calls 1

current_amountMethod · 0.80

Tested by

no test coverage detected