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

Method menu

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

Source from the content-addressed store, hash-verified

494 self.player.showing()
495
496 def menu(self):
497 pattern = "HS"
498 if self.first_hand:
499 pattern += "U"
500 if self.dealer.hand[1].rank == 1 and self.player.chips.current_amount():
501 pattern += "I"
502 self.dealer.ask_insurance()
503 if self.player.is_point(">", 10) and self.player.chips.can_double():
504 pattern += "D"
505 self.first_hand = False
506 choices = self.player.select_choice(pattern)
507 select = self.get_select(len(choices), general_err="Select above number.")
508 return choices[select]
509
510 @staticmethod
511 def get_select(select_max, prompt=">> ", general_err=""):

Callers 1

playMethod · 0.95

Calls 6

get_selectMethod · 0.95
current_amountMethod · 0.80
ask_insuranceMethod · 0.80
is_pointMethod · 0.80
can_doubleMethod · 0.80
select_choiceMethod · 0.80

Tested by

no test coverage detected