コード例 #1
0
    def single_game(self, blue_starts: bool = True):
        pygame.init()
        pygame.display.set_caption("Hex")

        game = Game(board_size=self.BOARD_SIZE, itermax=self.ITERMAX, mode=self.MODE, blue_starts=blue_starts)
        game.get_game_info([self.BOARD_SIZE, self.ITERMAX, self.MODE, self.GAME_COUNT])
        while not game.winner:
            game.play()
コード例 #2
0
ファイル: main.py プロジェクト: Rodrixkill/monopoly_python
def test_players(players, total_games, verbose=False, turn_limit=100):
    num_wins = [0] * len(players)
    for i in range(total_games):
        if i % 10 == 0:
            print("Episodes:", i)
        game = Game(random.sample(players, len(players)), verbose=verbose)
        game.turn_limit = turn_limit
        winner = game.play()
        num_wins[players.index(winner)] += 1

    for i in range(len(players)):
        wins_array[i] = num_wins[i] / total_games
        print(players[i].name, ": ", num_wins[i] / total_games)
コード例 #3
0
ファイル: main.py プロジェクト: poiuytre121/wunsz
def main():
    window = pygame.display.set_mode((1199, 750))
    game = Game(window, 2)
    game.play()
コード例 #4
0
from classes.game import Game

game = Game()

Game.play(game)