ICode国际青少年编程竞赛- Python-2级训练场-坐标入门
1、
d = Item.x - Dev.x
Dev.step(d)
2、
d = Item.y - Dev.y
Dev.step(d)
3、
d = Dev.y - Item.y
Dev.step(d)
4、
d = Item[0].x - Dev.x
Dev.step(d)
Dev.step(-d)
Dev.turnRight()
d = Item[1].y - Dev.y
Dev.step(d)
5、
Spaceship.step(Item.x - Spaceship.x)
6、
d = Spaceship.x - Item.x
Spaceship.step(d)
7、
d = Spaceship.y - Dev.y
Spaceship.step(d)
Dev.turnRight()
Dev.step(Spaceship.x - Dev.x)
Spaceship.step(Spaceship.y - Item.y)
Spaceship.turnRight()
Spaceship.step(Item.x - Spaceship.x)
8、
Dev.step(Dev.y - Spaceship.y)
Spaceship.step(Spaceship.x - Item.x)
Spaceship.turnRight()
Spaceship.step()
9、
Dev.step(Spaceship.x - Dev.x)
Spaceship.step(Spaceship.y - Item.y)
10、
Spaceship.step(Item.x -Spaceship.x)
Spaceship.turnRight()
Spaceship.step(Item.y - Spaceship.y)
11、
Spaceship.step(Spaceship.x - Item.x)
Spaceship.turnRight()
Spaceship.step(Spaceship.y - Item.y)
12、
Dev.step(Dev.y - Item.y)
Dev.turnLeft()
Dev.step(Dev.x - Item.x)
13、
Spaceship.step(Spaceship.y - Item.y)
Spaceship.turnLeft()
Spaceship.step(Spaceship.x - Item.x)
14、
Spaceship.step(Spaceship.y - Flyer.y)
Dev.step(Dev.x - Item.x)
15、
Spaceship.turnRight()
Spaceship.step(Flyer.y - Spaceship.y - 1)
Spaceship.turnLeft()
Spaceship.step(Item.x - Spaceship.x)
Spaceship.turnLeft()
Spaceship.step(Spaceship.y - Item.y)
16、
Spaceship.step(Spaceship.x - Flyer.x)
Spaceship.turnRight()
Spaceship.step(Spaceship.y - Flyer.y - 1)
Dev.step(Spaceship.y - Item[0].y)
17、
Spaceship.step(Spaceship.x - Item.x - 1)
Dev.step(1)
Dev.turnRight()
Dev.step(1)
18、
Spaceship.step(Item[0].x - Spaceship.x)
Spaceship.turnRight()
Spaceship.step(Item[1].y - Spaceship.y)
Spaceship.turnLeft()
Spaceship.step(Item[2].x - Spaceship.x)
Spaceship.turnRight()
Spaceship.step(Item[3].y - Spaceship.y)
19、
Spaceship.step(Spaceship.x - Item[0].x)
Spaceship.turnLeft()
Spaceship.step(Item[1].y - Spaceship.y)
Spaceship.turnRight()
Spaceship.step(Spaceship.x - Item[2].x)
Spaceship.turnLeft()
Spaceship.step(Item[3].y - Spaceship.y)
20、
Spaceship.turnRight()
Spaceship.step(Spaceship.y - Item[0].y)
Spaceship.turnLeft()
Spaceship.step(Spaceship.x - Item[0].x)
Spaceship.turnRight()
Spaceship.step()
Spaceship.turnLeft()
Spaceship.step(Spaceship.x - Item[1].x)
Spaceship.turnRight()
Spaceship.step(Spaceship.y - Item[2].y)
Spaceship.turnLeft()
Spaceship.step(Spaceship.x - Item[2].x)