示例#1
0
def _simulate_games(players, reps):
    log.info("players: %s; %s reps", players, reps)
    mmRules = rules.MauMau()
    games = []
    for i in range(reps):
        game = play.play_game(mmRules, players)
        games.append(game)
    return games
示例#2
0
 def _simulate_games(self, players, reps):
     log.info("players: %s; %s reps", players, reps)
     mmRules = rules.MauMau()
     games = []
     for i in range(reps):
         game = play.play_game(mmRules, players)
         games.append(game)
     return games
示例#3
0
def play_interactive_game():
    log.setLevel(level=logging.DEBUG)
    playedGame = play.play_game(_rulesOfTheGame, ['Eric', 'John', 'human'])
    log.info("And the winner is %s", playedGame.table.winner.name)
示例#4
0
def play_simple_game(players=3):
    log.setLevel(level=logging.DEBUG)
    playedGame = play.play_game(_rulesOfTheGame, players)
    log.info("And the winner is %s", playedGame.table.winner.name)
示例#5
0
文件: cli.py 项目: gregcodes/mau-mau
def play_interactive_game():
    log.setLevel(level=logging.DEBUG)
    playedGame = play.play_game(_rulesOfTheGame, ['Eric', 'John', 'human'])
    log.info("And the winner is %s", playedGame.table.winner.name)
示例#6
0
文件: cli.py 项目: gregcodes/mau-mau
def play_simple_game(players=3):
    log.setLevel(level=logging.DEBUG)
    playedGame = play.play_game(_rulesOfTheGame, players)
    log.info("And the winner is %s", playedGame.table.winner.name)
示例#7
0
def test_game_with_too_many_players_crashes_early():
    deckSize = len([(v, s) for v in DECK.VALUES for s in DECK.SUITS])
    tooManyPlayers = deckSize // mmRules.cardsPerPlayer + 2
    with pytest.raises(AssertionError):
        play.play_game(mmRules, tooManyPlayers)
示例#8
0
def test_game_with_default_amount_of_players_succeeds():
    play.play_game(mmRules, 3)
示例#9
0
def test_game_with_one_player_crashes_early():
    with pytest.raises(AssertionError):
        play.play_game(mmRules, 1)
示例#10
0
文件: cli.py 项目: tws0002/mau-mau
 def play(self):
     """play a game"""
     log.setLevel(level=logging.DEBUG)
     playedGame = play.play_game(self.rules, ['Eric', 'John', 'human'])
     log.info("And the winner is %s", playedGame.table.winner.name)
示例#11
0
文件: cli.py 项目: tws0002/mau-mau
 def sim(self, players=3):
     """simulate a game"""
     log.setLevel(level=logging.DEBUG)
     finishedGame = play.play_game(self.rules, players)
     log.info("And the winner is %s", finishedGame.table.winner.name)