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()
相关推荐
ζั͡山 ั͡有扶苏 ั͡✾16 小时前
从零搭建 Data-Juicer:一站式大模型数据预处理与可视化平台完整教程
python·data-juicer
SkylerHu17 小时前
tornado+gunicorn部署设置max_body_size
python·tornado·gunicorn
独行soc17 小时前
2025年渗透测试面试题总结-234(题目+回答)
网络·python·安全·web安全·渗透测试·1024程序员节·安全狮
木头左18 小时前
年化波动率匹配原则在ETF网格区间选择中的应用
python
清空mega18 小时前
从零开始搭建 flask 博客实验(3)
后端·python·flask
程序员小远18 小时前
7个常见的Jmeter压测问题
自动化测试·软件测试·python·测试工具·测试用例·压力测试·性能测试
红尘炼丹客18 小时前
《DeepSeek-OCR: Contexts Optical Compression》速览
人工智能·python·自然语言处理·ocr
☼←安于亥时→❦18 小时前
Playwright 安装与使用
python·playwright
大佬,救命!!!19 小时前
python实现象棋
开发语言·python·学习笔记·pygame·少儿编程·记录成长
棉猴19 小时前
《pygame中Sprite类实现多帧动画》注-通过多张序列帧显示动画2-2
开发语言·python·游戏·游戏程序·pygame