ICode国际青少年编程竞赛- Python-4级训练场-绿色能量1

发布于:2024-05-14 ⋅ 阅读:(231) ⋅ 点赞:(0)

ICode国际青少年编程竞赛- Python-4级训练场-绿色能量1

1、
在这里插入图片描述

Dev.step(3)
Dev.turnLeft()
Dev.step(3)
Spaceship.step(4)
Spaceship.turnRight()
Spaceship.step(4)
Dev.step(3)
while Item[1].y != Dev.y:
    wait()

2、
在这里插入图片描述

Dev.step(4)
while Item[0].x != Dev.x:
    wait()
Dev.turnLeft()
Dev.step()
Dev.turnRight()
Dev.step(4)
while Item[1].x != Dev.x:
    wait()

3、

在这里插入图片描述

Dev.step(2)
Dev.turnRight()
Dev.step(-1)
while Item[1].y != Dev.y:
    wait()
Dev.step(6)
Dev.turnRight()
Dev.step(2)
while Item[3].x != Dev.x:
    wait()

4、
在这里插入图片描述

for i in range(6):
    Dev.step()
    while Item[i].x != Dev.x:
        wait()

5、
在这里插入图片描述

for i in range(3):
    Dev.step(4)
    while Item[i].x != Dev.x:
        wait()

6、
在这里插入图片描述

for i in range(4):
    Dev.step(i+1)
    while Item[i].x != Dev.x:
        wait()

7、
在这里插入图片描述

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

8、
在这里插入图片描述

Dev.step(-1)
for i in range(4):
    while Item[i].y != Dev.y:
        wait()
    Dev.turnRight()
    Dev.step(4)

9、
在这里插入图片描述

for i in range(3):
    Dev.turnRight()
    Dev.step(4)
    while Item[i].x != Dev.x:
        wait()

10、
在这里插入图片描述

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

11、

在这里插入图片描述

for i in range(4):
    Dev.step(i+3)
    Dev.turnLeft()
    Dev.step(i+3)
    while Item[i].y != Dev.y:
        wait()
    Dev.step(-i-3)
    Dev.turnRight()

12、

在这里插入图片描述

for i in range(4):
    Dev.step(i+2)
    Dev.turnLeft()
    Dev.step(i+2)
    Dev.turnRight()
    while Item[i].y != Dev.y:
        wait()

13、
在这里插入图片描述

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

14、
在这里插入图片描述

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

15、

在这里插入图片描述

for i in range(4):
    Dev.step(i+2)
    Dev.turnRight()
    Dev.step(i+1)
    while Item[i].x != Dev.x:
        wait()
    Dev.step(-i-1)
    Dev.turnLeft()

16、
在这里插入图片描述

for i in range(3):
    Dev.step(5)
    while (Item[i].x != Dev.x) or (Item[i].y != Dev.y):
        wait()
    Dev.turnRight()

17、

在这里插入图片描述

for i in range(4):
    Dev.step(3+i)
    while Item[i].x != Dev.x or Item[i].y != Dev.y:
        wait()
    Dev.step()
    Dev.turnRight()

18、

在这里插入图片描述

for i in range(3):
    Dev.step(2+i)
    while Item[i].x != Dev.x or Item[i].y != Dev.y:
        wait()
    Dev.step(3-i)
    Dev.turnRight()

19、
在这里插入图片描述

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

20、
在这里插入图片描述

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

网站公告

今日签到

点亮在社区的每一天
去签到