def simulate(self, phit, n_games=100): wins = 0 legacy = self.is_legacy(phit) for _ in range(n_games): wins += 1 == BlackJack(phit, legacy=legacy).play() print("Player won {} out of {} games (win rate = {:.1%})".format( wins, n_games, wins / n_games))
def simulate(cls, n_games=100): phit = cls._get_injected_args()[0] wins = 0 for _ in range(n_games): wins += 1 == BlackJack(phit).play() print("Player won {} out of {} games (win rate = {:.1%})".format( wins, n_games, wins/n_games ))
def simulate_one_game(self, phit): game = BlackJack(phit, True, self.is_legacy(phit)) game.play()
def simulate_one_game(cls): phit = cls._get_injected_args()[0] game = BlackJack(phit, True) game.play()