ICode国际青少年编程竞赛- Python-2级训练场-迷宫
1、
Dev.step(3)
Dev.turnLeft()
for i in range(2):
Dev.step(4)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
Dev.step(3)
Dev.step(-9)
2、
Dev.step(3)
Dev.turnRight()
Dev.step(2)
Dev.turnLeft()
for i in range(2):
Dev.step(4)
Dev.turnRight()
for i in range(2):
Dev.step((i+1) * 2)
Dev.turnLeft()
Dev.step(-5)
3、
for i in range(2):
Dev.step(1)
Dev.turnLeft()
Dev.step(3 - i)
Dev.turnRight()
Dev.step(2)
Dev.turnRight()
Dev.step(4)
for i in range(2):
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
Dev.step(2)
Dev.turnLeft()
Dev.step(2)
4、
Dev.step(2)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
for i in range(2):
Dev.step(2)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
Dev.step(4)
for i in range(2):
Dev.turnRight()
Dev.step(2)
5、
for i in range(2):
Spaceship.step(7 - i)
Spaceship.turnLeft()
Spaceship.step(4)
for i in range(2):
Spaceship.turnLeft()
Spaceship.step(2)
for i in range(3):
Spaceship.turnRight()
Spaceship.step((i + 1) * 2)
for i in range(2):
Spaceship.turnLeft()
Spaceship.step((i + 1) * 2)
Spaceship.turnRight()
Spaceship.step(2)
Spaceship.turnLeft()
Spaceship.step(5)
6、
Spaceship.step(1)
Spaceship.turnLeft()
Spaceship.step(4)
Spaceship.turnRight()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(8)
for i in range(2):
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(4)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(2)
7、
Dev.step(2)
Dev.turnRight()
Dev.step(6)
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
Dev.step(2)
for i in range(2):
Dev.turnLeft()
Dev.step(6)
8、
for i in range(2):
Spaceship.step(2 + i)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(5)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(3)
Spaceship.turnRight()
Spaceship.turnRight()
Spaceship.step(8)
9、
for i in range(2):
Dev.step(2)
Dev.turnLeft()
Dev.step(-4)
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
for i in range(3):
Dev.step(2)
Dev.turnLeft()
Dev.step(-2)
Dev.turnRight()
Dev.step(4)
Dev.turnLeft()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
Dev.step(-4)
Dev.turnLeft()
for i in range(2):
Dev.step(2)
Dev.turnRight()
Dev.step(-2)
Dev.turnLeft()
Dev.step(-5)
10、
for i in range(2):
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step(4)
Spaceship.turnRight()
for i in range(2):
Spaceship.step(2)
Spaceship.turnLeft()
Spaceship.step(4)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step()
Dev.step(3)
Spaceship.step(2)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step()
11、
for i in range(2):
Dev.step(5)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
Dev.step(4)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnRight()
Dev.step(-2)
Dev.turnLeft()
Dev.step(5)
Dev.step(-10)
12、
Dev.step(4)
Dev.turnRight()
Dev.step(2)
Dev.turnRight()
for i in range(3):
Dev.step(2)
Dev.turnLeft()
for i in range(2):
Dev.step(-4)
Dev.turnRight()
Dev.step(-2)
Dev.turnRight()
Dev.step(4)
Dev.step(-4)
Dev.turnLeft()
Dev.step(4)
Dev.turnLeft()
Dev.step(5)
13、
Spaceship.step(6)
Spaceship.turnLeft()
Spaceship.step(6)
Dev.step(1)
Dev.turnRight()
Dev.step(2)
Dev.turnLeft()
Dev.step(4)
for i in range(2):
Dev.turnLeft()
Dev.step(2)
for i in range(2):
Dev.turnRight()
Dev.step(i * 6 + 2)
for i in range(2):
Dev.turnLeft()
Dev.step(6 - i * 4)
14、
for i in range(-1, 2, 2):
Dev.step(2)
Dev.turnRight()
Dev.step(5 * i)
Dev.turnLeft()
for i in range(2):
Dev.step(4)
Dev.turnLeft()
Dev.step(2 * i + 2)
if i == 0:
Dev.turnRight()
15、
for i in range(2):
Dev.step(i * 4 + 2)
Dev.turnLeft()
Dev.step(2)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnRight()
Dev.step(4 + i)
Dev.turnLeft()
Dev.step(-10)
16、
for i in range(3):
Dev.step(2 ** i)
Dev.turnLeft()
Dev.step(-2)
Dev.turnLeft()
Dev.step(4)
Dev.turnLeft()
Dev.step(6)
for i in range(2):
Dev.turnRight()
Dev.step(-(4 - i * 2))
Dev.turnRight()
Dev.step(5)
17、
Spaceship.step(6)
for i in range(4):
if i != 2:
Spaceship.turnRight()
if i == 2:
Spaceship.turnLeft()
Spaceship.step(2)
for i in range(4):
if i != 3:
Spaceship.turnLeft()
if i == 3:
Spaceship.turnRight()
Spaceship.step(4)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
Spaceship.step()
18、
for i in range(2):
Dev.step(5)
Dev.turnLeft()
for i in range(2):
Dev.step(3)
Dev.turnLeft()
Dev.step(-2)
for i in range(2):
Dev.turnLeft()
Dev.step((i + 2) * 2)
for i in range(2):
Dev.turnRight()
Dev.step(2)
Dev.turnLeft()
Dev.step(-2)
for i in range(2):
Dev.step(-2 * (i + 1))
Dev.turnLeft()
Dev.step(-7)
19、
for i in range(2):
Dev.step(4)
Dev.turnLeft()
for i in range(2):
Dev.step(-2)
Dev.turnLeft()
for i in range(2):
Dev.step(-4+i*2)
Dev.turnLeft()
for i in range(3):
Dev.step(6-i*2)
Dev.turnRight()
for i in range(5):
Dev.step(-2)
if i % 2 == 0:
Dev.turnLeft()
if i % 2 != 0:
Dev.turnRight()
for i in range(2):
Dev.step(6-i*4)
Dev.turnLeft()
Dev.step(8)
Dev.turnLeft()
Dev.step(8)
20、
for i in range(2):
Dev.step(2 + i * 2)
Dev.turnLeft()
Dev.step(2 + i * 2)
Dev.turnRight()
for i in range(2):
Dev.step(2)
Dev.turnLeft()
for i in range(2):
Dev.step(2 * i - 4)
Dev.turnRight()
Dev.step(4)
Dev.turnRight()
Dev.step(6)
Dev.step(-2)
Dev.turnLeft()
Dev.step(1)