ICode国际青少年编程竞赛- Python-2级训练场-基础训练3

ICode国际青少年编程竞赛- Python-2级训练场-基础训练3

1、

python 复制代码
d = Item.x - Dev.x
Dev.step(d)

2、

python 复制代码
d = Spaceship.x - Item.x
Spaceship.step(d)

3、

python 复制代码
d = Item.y - Dev.y
Dev.step(d)

4、

python 复制代码
for i in range(4):
    Spaceship.step(2)
    d = Item[i].x - Dev.x
    Dev.step(d)
    Dev.step(-d)

5、

python 复制代码
for i in range(4):
    d = Item[i].y - Dev.y
    Dev.step(d)
    Dev.step(-d)
    Spaceship.step(3)

6、

python 复制代码
for i in range(5):
    Spaceship.step(3)
    d = Dev.y - Item[i].y
    Dev.step(d)
    Dev.step(-d)

7、

python 复制代码
for i in range(4):
    Spaceship.step(3)
    if Spaceship.y < Item[i].y:
        Dev.step(4)
        Dev.step(-4)

8、

python 复制代码
for i in range(6):
    d = Item[3].y - Flyer[i].y
    Flyer[i].step(d)
Dev.step(Item[4].x - Dev.x)

9、

python 复制代码
for i in range(5):
    d = Item[i].x - Flyer[i].x
    if d < 0:
        d = -d
    Flyer[i].step(d)
for i in range(5):
    Dev.step(3)
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()

10、

python 复制代码
for i in range(8):
    d = Item[i].x - Flyer[i].x
    if d < 0:
        d = -d
    Flyer[i].step(d)
for i in range(5):
    Dev.step(3)
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()

11、

python 复制代码
for i in range(5):
    Spaceship.step(3)
    if not Item[i].broken():
        Dev.step(5)
        Dev.step(-5)

12、

python 复制代码
for i in range(4):

    Spaceship.step(3)
    if not Item[i].broken():
        Dev.step(4)
        Dev.step(-4)

13、

python 复制代码
for i in range(6):
    Spaceship.step(2)
    if not Item[i].broken():
        Spaceship.turnLeft()
        Spaceship.step(4)
        Spaceship.turnLeft()
        Spaceship.turnLeft()
        Spaceship.step(4)
        Spaceship.turnLeft()

14、

python 复制代码
for i in range(6):
    Dev.step(3)
    Dev.turnLeft()
    Dev.step(2)
    if not Item[i].broken():
        Dev.step(3)
        Dev.step(-3)
    Dev.turnRight()

15、

python 复制代码
for i in range(8):
    if i < 3 or i > 4:
        Flyer[i].step(3)
Dev.step(Item[3].x - Dev.x)

16、

python 复制代码
for i in range(12):
    if i < 4 or i > 7:
        Flyer[i].step(1)
for i in range(4):
    Dev.step(4)
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()
    Dev.step(2)
    Dev.turnRight()

17、

python 复制代码
for i in range(8):
    if i > 1 and i < 7:
        Flyer[i].step(3)
Dev.step(Item[3].x - Dev.x)

18、

python 复制代码
for i in range(6):
    if i > 1 and i < 5:
        Flyer[i].step(2)
Dev.step(Item.y - Dev.y)

19、

python 复制代码
for i in range(12):
    if 9 > i > 2:
        Flyer[i].step(2)
for i in range(3):
    Dev.step(7)
    Dev.turnRight()

20、

python 复制代码
for i in range(8):
    if 7 > i > 2:
        Flyer[i].step(3)
for i in range(4):
    Dev.step(2)
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()
相关推荐
灵智工坊LingzhiAI2 小时前
人体坐姿检测系统项目教程(YOLO11+PyTorch+可视化)
人工智能·pytorch·python
烛阴9 小时前
简单入门Python装饰器
前端·python
好开心啊没烦恼10 小时前
Python 数据分析:numpy,说人话,说说数组维度。听故事学知识点怎么这么容易?
开发语言·人工智能·python·数据挖掘·数据分析·numpy
面朝大海,春不暖,花不开10 小时前
使用 Python 实现 ETL 流程:从文本文件提取到数据处理的全面指南
python·etl·原型模式
2301_8050545611 小时前
Python训练营打卡Day59(2025.7.3)
开发语言·python
万千思绪11 小时前
【PyCharm 2025.1.2配置debug】
ide·python·pycharm
微风粼粼13 小时前
程序员在线接单
java·jvm·后端·python·eclipse·tomcat·dubbo
云天徽上13 小时前
【PaddleOCR】OCR表格识别数据集介绍,包含PubTabNet、好未来表格识别、WTW中文场景表格等数据,持续更新中......
python·ocr·文字识别·表格识别·paddleocr·pp-ocrv5
你怎么知道我是队长14 小时前
python-input内置函数
开发语言·python
叹一曲当时只道是寻常14 小时前
Python实现优雅的目录结构打印工具
python