ICode国际青少年编程竞赛- Python-3级训练场-能量状态判断1
1、
for i in range(6):
Spaceship.step(2)
if not Item[i].broken():
Spaceship.turnLeft()
Spaceship.step(4)
Spaceship.turnLeft()
Spaceship.turnLeft()
Spaceship.step(4)
Spaceship.turnLeft()
2、
for i in range(6):
if not Item[i].broken():
Dev.turnLeft()
Dev.step(i + 2)
Dev.step(-i - 2)
Dev.turnRight()
Dev.step(2)
3、
for i in range(4):
Spaceship.step(Spaceship.x - Item[3 - i].x)
if not Item[3 - i].broken():
Dev.step(4)
Dev.step(-4)
4、
for i in range(4):
Dev.step(i + 1)
Dev.turnLeft()
if not Item[3 - i].broken():
Dev.step(2)
Dev.step(-2)
Dev.step(-4)
Dev.step(4)
Dev.turnRight()
5、
for i in range(6):
Dev.step(3)
Dev.turnLeft()
Dev.step(2)
if not Item[i].broken():
Dev.step(3)
Dev.step(-3)
Dev.turnRight()
6、
for i in range(4):
Dev.step(6)
Dev.turnRight()
if not Item[2 * i].broken():
Dev.step(3)
Dev.step(-3)
Dev.step(-3)
Dev.step(3)
Dev.turnLeft()
Dev.step(-6)
Dev.turnRight()
7、
for i in range(4):
Dev.step(8)
if not Item[2 * i+1].broken():
Dev.turnLeft()
Dev.step(2)
Dev.step(-2)
Dev.turnRight()
Dev.step(-3)
Dev.turnRight()
8、
for i in range(5):
Dev.step(2 * i + 1)
Dev.turnRight()
if not Item[2 * i + 1].broken():
Dev.step(-2)
Dev.step(2)
9、
for i in range(4):
Dev.step(4)
Dev.turnRight()
if not Item[i].broken():
Dev.step(2)
Dev.step(-2)
Dev.step(-2)
Dev.step(2)
Dev.turnLeft()
Dev.step(-4)
Dev.turnRight()
10、
Dev.step()
for i in range(5):
Spaceship.step(2 + i * 2)
Spaceship.turnRight()
if not Item[2 * i + 1].broken():
Dev.step(1)
Dev.step(-1)
Dev.turnRight()
11、
for i in range(4):
Spaceship.step(3)
if not Item[1 + 2 * i].broken():
Dev.turnRight()
Dev.step(1)
Dev.step(-1)
Spaceship.turnRight()
Spaceship.turnRight()
Spaceship.step(3)
Spaceship.turnLeft()
12、
for i in range(4):
if not Item[i].broken():
Dev.step(1)
Dev.step(-1)
Dev.turnLeft()
Spaceship.step(2)
Spaceship.turnLeft()
Spaceship.step(2)
13、
for i in range(4):
Dev.step(2)
Dev.step(-2)
if not Item[2 * i].broken():
Dev.step(-2)
Dev.step(2)
Dev.turnRight()
Spaceship.step(3)
Spaceship.turnRight()
Spaceship.step(3)
14、
for i in range(6):
Dev.step(i + 1)
if not Item[i].broken():
Dev.turnLeft()
Dev.step()
Dev.step(-1)
Dev.turnRight()
Dev.step(i + 1)
Dev.turnRight()
15、
for i in range(7):
Dev.step(2)
if not Item[i].broken():
Flyer[i].step(i + 1)
Dev.turnRight()
Dev.step(8 - i)
Dev.step(i - 8)
Dev.turnLeft()
16、
for i in range(6):
if not Item[i].broken():
Flyer[i].step(Item[i].y - Flyer[i].y)
Dev.turnLeft()
Dev.step(4)
Dev.step(-4)
Dev.turnRight()
Dev.step(2)
17、
for i in range(6):
Spaceship.step(2)
if not Item[5 - i].broken():
Spaceship.turnRight()
Spaceship.step(10 - Item[5 - i].y)
Spaceship.turnRight()
Spaceship.turnRight()
Spaceship.step(10 - Spaceship.y)
Spaceship.turnRight()
18、
Dev.turnRight()
for i in range(6):
if not Item[i].broken():
Flyer.step(Dev.x - Flyer.x)
Dev.turnLeft()
Dev.step(Dev.y - Item[i].y)
Dev.step(Dev.y - 12)
Dev.turnRight()
Dev.step(2)
19、
Dev.turnLeft()
Dev.step(1)
for i in range(5):
Spaceship.step(2)
if not Item[2 * i].broken():
Dev.step(Dev.y - Item[2 * i].y)
Dev.step(Dev.y - Spaceship.y)
Flyer.step(Item[9].x - Flyer.x)
Dev.step(-3)
Dev.turnLeft()
Dev.step(Dev.x - Item[1].x)
20、
Dev.turnLeft()
for i in range(6):
Spaceship.step(1)
if not Item[2 * i + 1].broken():
Dev.step(-2)
Dev.step(2)
if not Item[2 * i].broken():
Dev.step(Dev.y - Item[2 * i].y)
Dev.step(Dev.y - Spaceship.y)
Spaceship.step(1)