ICode国际青少年编程竞赛- Python-3级训练场-坐标判断1

ICode国际青少年编程竞赛- Python-3级训练场-坐标判断1

1、

在这里插入图片描述

for i in range(4):   
    Spaceship.step(3)
    Spaceship.turnLeft()
    Spaceship.step(3)
    Spaceship.turnRight()
    if Item[i].y < Dev.y:
        Dev.step(3)
        Dev.step(-3)

2、
在这里插入图片描述

for i in range(9):   
    if Flyer[i].y != Dev.y:
        Flyer[i].step(2)
Dev.step(Item.x - Dev.x)

3、
在这里插入图片描述

for i in range(4):
    Dev.step(3)
    Dev.turnLeft()
    if i != 2:
        Dev.step(3)
        Dev.step(-3)
    Dev.step(-3)
    Dev.turnRight()

4、
在这里插入图片描述

for i in range(4):
    Dev.step(2)
    Dev.turnRight()
    Dev.step(i + 1)
    if Item[i].x > Dev.x:
        Dev.step(2)
        Dev.step(-2)
    Dev.turnLeft()

5、
在这里插入图片描述

for i in range(6):
    if Flyer[i].x != Dev.x:
        Flyer[i].step(Dev.x - Flyer[i].x)
for i in range(4):
    Dev.step(4)
    Dev.step(-4)
    Dev.turnRight()

6、
在这里插入图片描述

for i in range(5):
    Dev.step(2)
    Dev.turnLeft()
    Dev.step(-1)
    Dev.step(1)
    if Dev.y > Item[2 * i].y:
        Dev.step(5)
        Dev.step(-5)
    Dev.turnRight()   

7、
在这里插入图片描述

for i in range(8):
    if Flyer[i].x != 3:
        Flyer[i].step(2)
for i in range(3):
    Dev.step(i + 2)
    Dev.turnLeft()
    Dev.step(i + 2)
    Dev.turnRight()
Dev.step(-9)
Dev.turnRight()
Dev.step(6)

8、
在这里插入图片描述

Dev.turnRight()
for i in range(5):
    Dev.step(4)
    if Item[4 - i].x > Dev.x:
        Dev.turnRight()
        Dev.step(1)
        Dev.step(-1)
        Dev.turnLeft()
    Dev.step(-4)
    Spaceship.step(4)

9、

在这里插入图片描述

for i in range(5):
    Dev.turnLeft()
    Dev.step(5)
    if Item[i].y > Dev.y:
        Dev.turnLeft()
        Dev.step(2)
        Dev.step(-2)
        Dev.turnRight()
    Dev.step(-5)
    Dev.turnRight()
    Dev.step(4)

10、
在这里插入图片描述

for i in range(5):
    if Item[i].x != Flyer[i].x:
        Flyer[i].step()
    Dev.step(2)
    Dev.turnRight()
    Dev.step(2)
    Dev.turnLeft()

11、

在这里插入图片描述

for i in range(8):
    if Flyer[i].x != Item[i].x:
        Flyer[i].step(2)
for i in range(4):
    Dev.step(8)
    Dev.turnRight()

12、

在这里插入图片描述

for i in range(8):
    if Flyer[i].x != Dev.x:
        Flyer[i].step(Dev.x - Flyer[i].x)
Dev.step(Dev.y - Item.y)

13、
在这里插入图片描述

for i in range(6):
    Dev.step(1)
    if Dev.y > Item[i].y:
        Dev.turnLeft()
        Dev.step(10 - Item[i].y)
        Dev.step(Dev.y - 10)
        Dev.turnRight()
    
    Dev.step(1)

14、

在这里插入图片描述

for i in range(7):
    Spaceship.step(2)
    if Item[i].y > Spaceship.y:
        Spaceship.turnRight()
        Spaceship.step(Item[i].y - 9)
        Spaceship.turnRight()
        Spaceship.turnRight()
        Spaceship.step(Spaceship.y - 9)
        Spaceship.turnRight()

15、
在这里插入图片描述

for i in range(6):
    if Item[i].y < Spaceship.y:
        Spaceship.turnLeft()
        Spaceship.step(9 -Item[i].y)
        Spaceship.turnRight()
        Spaceship.turnRight()
        Spaceship.step(9 -Spaceship.y)
        Spaceship.turnLeft()
    Spaceship.step(2)

16、

在这里插入图片描述

for i in range(5):
    Spaceship.step(Item[i].x - Spaceship.x)
    if Item[i].y < Spaceship.y:
        Spaceship.turnLeft()
        Spaceship.step(9 -Item[i].y)
        Spaceship.turnRight()
        Spaceship.turnRight()
        Spaceship.step(9 -Spaceship.y)
        Spaceship.turnLeft()

17、
在这里插入图片描述

for i in range(7):
    if Flyer[i].y != Item[i].y:
        Flyer[i].step(Item[i].y - Flyer[i].y)
for i in range(4):
    Dev.step(7-i)
    Dev.turnRight()

18、

在这里插入图片描述

for i in range(5):
    if Flyer[4-i].y >= Item[4-i].y:
        Flyer[4-i].step(Flyer[4-i].y - Item[4-i].y + 1)
    Spaceship.step(2)
    Spaceship.turnRight()
    Spaceship.step(3)
    Spaceship.turnRight()
    Spaceship.turnRight()
    Spaceship.step(3)
    Spaceship.turnRight()

19、

在这里插入图片描述

for i in range(7):
    if Flyer[i].x != Item[i].x:
        Flyer[i].step()
    Dev.step(2)
    Dev.turnRight()
    Dev.step(Item[i].y - 3)
    Dev.step(3 - Dev.y)
    Dev.turnLeft()

20、
在这里插入图片描述

for i in range(6):
    Spaceship.step()
    if Flyer[i].y != Item[i].y:
        Flyer[i].step(Item[i].y - Flyer[i].y)
    Dev.step(Dev.y - Item[i].y)
    Dev.step(Dev.y - Spaceship.y)
    
    Spaceship.step()
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

青岛少儿编程-王老师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值