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()