ICode国际青少年编程竞赛- Python-4级训练场-综合训练4

ICode国际青少年编程竞赛- Python-4级训练场-综合训练4

1、
在这里插入图片描述

Dev.turnLeft()
Dev.step(3)
Dev.turnRight()
Dev.step(3)
Dev.turnLeft()
Dev.step(4)

2、
在这里插入图片描述

for i in range(3):
    Dev.step(2)
    Dev.turnRight()
    while Flyer[i].disappear():
        wait()
    Dev.step(2 + i)
    Dev.turnLeft()

3、
在这里插入图片描述

for i in range(3):
    Dev.step(2 + 2 * i)
    while Dev.y != Item[i + 1].y:
        wait()

4、
在这里插入图片描述

for i in range(4):
    Spaceship.step(5)
    Spaceship.turnRight()
    Spaceship.step(1)
    Dev.turnRight()
    Dev.step(1)
    for j in range(4):
        Dev.step(3)
        Dev.turnRight()
    Dev.step(-1)
    Spaceship.turnLeft()
    Spaceship.turnLeft()
    Spaceship.step(1)
    Spaceship.turnLeft()
    Spaceship.step(5)
    Spaceship.turnLeft()

5、
在这里插入图片描述

for i in range(4):
    for j in range(3):
        Spaceship.step(3)
        Spaceship.turnRight()
    Spaceship.step(6)

6、

在这里插入图片描述

for i in range(2):
    for j in range(3 - i):
        Spaceship.step(1 + j + i * 3)
        Dev.step(i + j + 1)
        Dev.step(-1 - j - i)
    Spaceship.turnRight()
    Dev.turnRight()
Spaceship.step(6)
Dev.step(2)

7、
在这里插入图片描述

for i in range(3):
    for j in range(3):
        Dev.step(2)
        Dev.turnRight()
        Dev.step(2)
        Dev.turnLeft()
    Spaceship.step(6)
    Spaceship.turnLeft()
    Spaceship.step(1)
    Spaceship.turnRight()
    Dev.step(-5)

8、
在这里插入图片描述

for i in range(3):
    for j in range(3):
        Dev.turnRight()
        Dev.step(1)
        Flyer[i].step(1)
        Dev.turnLeft()
        Dev.step(1)
        Dev.step(-1)
    Dev.step(-2)

9、
在这里插入图片描述

for i in range(3):
    for j in range(3):
        Spaceship.step(2 + i)
        Dev.step(3 - j)
        Dev.step(-3 + j)
    Spaceship.turnLeft()
    Dev.turnLeft()

10、

在这里插入图片描述

for i in range(4):
    Dev.step(7 + 2 * i)
    for j in range(3):
        Dev.turnRight()
        Dev.step(3 + i)

11、
在这里插入图片描述

for i in range(3):
    for j in range(3):
        Dev.step(-2 - j)
        Dev.step(2 + j)
        Spaceship.step(2)
    Spaceship.turnLeft()
    Spaceship.step(2)
    Spaceship.turnRight()

12、
在这里插入图片描述

for i in range(3):
    for j in range(3):
        Dev.step(11 - 4 * i)
        Dev.turnRight()
    Spaceship.step(2)
    Spaceship.turnLeft()
    Dev.step(9 - 4 * i)
    Dev.turnRight()
    Spaceship.step(2)
    Spaceship.turnRight()

13、
在这里插入图片描述

for i in range(7):
    Flyer[i].step(8 - i)
    Flyer[7 + i].step(7 - i)
    Dev.step(1)
    Dev.turnRight()
    Dev.step(1)
    Dev.turnLeft()

14、
在这里插入图片描述

for i in range(10):
    if i < 1 or i > 5:
        Flyer[i].step(3)
for i in range(3):
    Spaceship.step(2)
    for j in range(4):
        Dev.step(6 - 2 * i)
        Dev.turnRight()
        Dev.step(6 - 2 * i)

15、

在这里插入图片描述

for i in range(4):
    for j in range(3):
        Spaceship.step(1)
        Spaceship.turnRight()
        Spaceship.step(1)
        Spaceship.turnLeft()
    
    Spaceship.turnRight()
    Dev.step(1)
    Dev.step(-1)
    Spaceship.step(3)
    Dev.step(1)
    Dev.step(-1)
    Dev.turnRight()

16、

在这里插入图片描述

for i in range(2):
    for j in range(3):
        while Flyer[i * 3 + j].disappear():
            wait()
        Dev.step(2 + j)
    Dev.turnRight()

17、
在这里插入图片描述

for i in range(7):
    Dev.step(2)
    Dev.turnLeft()
    for j in range(8 - i):
        Flyer[7 - j].step(2)
    Dev.step(9 - i)
    Dev.step(i - 9)
    Dev.turnRight()

18、

在这里插入图片描述

for i in range(5):
    Dev.turnRight()
    Dev.step(7)
    if i < 4:
        Dev.step(-7)
        Dev.turnLeft()
        Dev.step(2)
        Flyer[5 - i].step(2)
        Flyer[4 - i].step(2)

19、
在这里插入图片描述

for i in range(4):
    Spaceship.step(2 + i)
    while Flyer[i].disappear():
        wait()
    Dev.step(-2 - i)
    for j in range(4):
        Dev.step(-1 - i)
        Dev.turnLeft()
    Dev.step(i)
    while Flyer[i].disappear():
        wait()
    Dev.step(2)

20、
在这里插入图片描述

Spaceship.step(5)
Spaceship.turnRight()
for i in range(4):
    Dev.step(1)
    Dev.turnLeft()
    for j in range(2):
        Dev.step(5 - 3*j)
        Dev.turnRight()
    Dev.step(10)
    Dev.turnRight()
    while (Item[i].x != Dev.x) or (Item[i].y != Dev.y):
        wait()
    Dev.step(1)
    Spaceship.step(5)
    while Flyer[1 + 2*i].disappear():
        wait()
    Dev.step(2)
    Spaceship.turnRight()
    Spaceship.step(5)
    Dev.turnLeft()

最近更新

  1. TCP协议是安全的吗?

    2024-05-12 09:46:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-05-12 09:46:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-05-12 09:46:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-05-12 09:46:02       18 阅读

热门阅读

  1. SD321放大器3V输入电流电压保护二极管25C电源电流

    2024-05-12 09:46:02       14 阅读
  2. react Hooks

    2024-05-12 09:46:02       8 阅读
  3. React Native vs Flutter:2023年移动开发框架对比

    2024-05-12 09:46:02       8 阅读
  4. React Native跨平台开发实战:从零到一

    2024-05-12 09:46:02       11 阅读
  5. 学习Vue3中reactive

    2024-05-12 09:46:02       13 阅读
  6. Docker在macbook搭建lnmp环境

    2024-05-12 09:46:02       11 阅读
  7. jquery

    jquery

    2024-05-12 09:46:02      9 阅读