コード例 #1
0
def vs(player_o,player_x,game_count):
    game = tg.Game()
    
    player_o.set_side(tl.Pid.O)
    player_x.set_side(tl.Pid.X)
    
    game.setPlayer(tl.Pid.O, player_o)
    game.setPlayer(tl.Pid.X, player_x)
    
    game.run(game_count=game_count)

    return game.result()
コード例 #2
0
        if status.winner == tl.OPP[self.side]:
            raise Exception('FTIRAQKFKT')

    def input(self, status):
        choice_list, _ = cal_min_max(status, self.side)
        return random.choice(choice_list)

    def input_error(self):
        raise Exception('FLSTQLRK')

    def turn_end(self, status):
        pass

    def close(self):
        pass


if __name__ == '__main__':
    game = tg.Game()

    po = Player()
    po.set_side(tl.Pid.O)

    px = Player()
    px.set_side(tl.Pid.X)

    game.setPlayer(tl.Pid.O, po)
    game.setPlayer(tl.Pid.X, px)

    game.run(-1)