Example #1
0
 def __init__(self, tournament_id):
     self.tournament_id = tournament_id
     self.moves = []
     self.start_time = None
     self.end_time = None
     self.game = Game()
     self.start()
Example #2
0
def initialize_game(moves):
    game = Game()
    boards = [game.board]

    for move in moves:
        game.move(move)
        boards.append(game.board)

    return game, boards
def play_game(prediction_request, simulation_depth):
    startTime = datetime.now()
    global game, player1, player2

    game = Game()
    player1 = Player(1, game, MultiprocessModel(prediction_request))
    player2 = Player(2, game, MultiprocessModel(prediction_request))

    while not game.is_over():
        play_turn(simulation_depth)

    finalize_lessons()

    print('game over', datetime.now() - startTime, len(game.moves), 'moves')
Example #4
0
def game():
    return Game()
Example #5
0
	def setUp(self):
		self.game = Game()