• Проблемы в коде на Python?

    Staffic Доброго времени суток!
    Для начала сделай отступы в своём коде.
    А потом ты ошибся в последней строчке. Сравни свой код и код из книги.

    def create_map():
        global obstacles
        locations = []
        for i in range(10):
        row = random.randint(0, 9)
        col = random.randint(0, 9)
        location = [col * 64 + 20, row * 64 + 20 + 640]
        if not (location in locations):
            locations.append(location)
            type = random.choice(["tree", "flag"])
            if type == "tree": img = "skier_tree.png"
            elif type == "flag": img = "skier_flag.png"
            obstacle = ObstacleClass(img, location, type)
            obstacles.add(obstacle)


    Вот здесь есть код из книги и все файлы.
    Ответ написан
    Комментировать