ICode国际青少年编程竞赛- Python-4级训练场-综合训练4
1、
Dev.turnLeft()
Dev.step(3)
Dev.turnRight()
Dev.step(3)
Dev.turnLeft()
Dev.step(4)
2、
for i in range(3):
Dev.step(2)
Dev.turnRight()
while Flyer[i].disappear():
wait()
Dev.step(2 + i)
Dev.turnLeft()
3、
for i in range(3):
Dev.step(2 + 2 * i)
while Dev.y != Item[i + 1].y:
wait()
4、
for i in range(4):
Spaceship.step(5)
Spaceship.turnRight()
Spaceship.step(1)
Dev.turnRight()
Dev.step(1)
for j in range(4):
Dev.step(3)
Dev.turnRight()
Dev.step(-1)
Spaceship.turnLeft()
Spaceship.turnLeft()
Spaceship.step(1)
Spaceship.turnLeft()
Spaceship.step(5)
Spaceship.turnLeft()
5、
for i in range(4):
for j in range(3):
Spaceship.step(3)
Spaceship.turnRight()
Spaceship.step(6)
6、
for i in range(2):
for j in range(3 - i):
Spaceship.step(1 + j + i * 3)
Dev.step(i + j + 1)
Dev.step(-1 - j - i)
Spaceship.turnRight()
Dev.turnRight()
Spaceship.step(6)
Dev.step(2)
7、
for i in range(3):
for j in range(3):
Dev.step(2)
Dev.turnRight()
Dev.step(2)
Dev.turnLeft()
Spaceship.step(6)
Spaceship.turnLeft()
Spaceship.step(1)
Spaceship.turnRight()
Dev.step(-5)
8、
for i in range(3):
for j in range(3):
Dev.turnRight()
Dev.step(1)
Flyer[i].step(1)
Dev.turnLeft()
Dev.step(1)
Dev.step(-1)
Dev.step(-2)
9、
for i in range(3):
for j in range(3):
Spaceship.step(2 + i)
Dev.step(3 - j)
Dev.step(-3 + j)
Spaceship.turnLeft()
Dev.turnLeft()
10、
for i in range(4):
Dev.step(7 + 2 * i)
for j in range(3):
Dev.turnRight()
Dev.step(3 + i)
11、
for i in range(3):
for j in range(3):
Dev.step(-2 - j)
Dev.step(2 + j)
Spaceship.step(2)
Spaceship.turnLeft()
Spaceship.step(2)
Spaceship.turnRight()
12、
for i in range(3):
for j in range(3):
Dev.step(11 - 4 * i)
Dev.turnRight()
Spaceship.step(2)
Spaceship.turnLeft()
Dev.step(9 - 4 * i)
Dev.turnRight()
Spaceship.step(2)
Spaceship.turnRight()
13、
for i in range(7):
Flyer[i].step(8 - i)
Flyer[7 + i].step(7 - i)
Dev.step(1)
Dev.turnRight()
Dev.step(1)
Dev.turnLeft()
14、
for i in range(10):
if i < 1 or i > 5:
Flyer[i].step(3)
for i in range(3):
Spaceship.step(2)
for j in range(4):
Dev.step(6 - 2 * i)
Dev.turnRight()
Dev.step(6 - 2 * i)
15、
for i in range(4):
for j in range(3):
Spaceship.step(1)
Spaceship.turnRight()
Spaceship.step(1)
Spaceship.turnLeft()
Spaceship.turnRight()
Dev.step(1)
Dev.step(-1)
Spaceship.step(3)
Dev.step(1)
Dev.step(-1)
Dev.turnRight()
16、
for i in range(2):
for j in range(3):
while Flyer[i * 3 + j].disappear():
wait()
Dev.step(2 + j)
Dev.turnRight()
17、
for i in range(7):
Dev.step(2)
Dev.turnLeft()
for j in range(8 - i):
Flyer[7 - j].step(2)
Dev.step(9 - i)
Dev.step(i - 9)
Dev.turnRight()
18、
for i in range(5):
Dev.turnRight()
Dev.step(7)
if i < 4:
Dev.step(-7)
Dev.turnLeft()
Dev.step(2)
Flyer[5 - i].step(2)
Flyer[4 - i].step(2)
19、
for i in range(4):
Spaceship.step(2 + i)
while Flyer[i].disappear():
wait()
Dev.step(-2 - i)
for j in range(4):
Dev.step(-1 - i)
Dev.turnLeft()
Dev.step(i)
while Flyer[i].disappear():
wait()
Dev.step(2)
20、
Spaceship.step(5)
Spaceship.turnRight()
for i in range(4):
Dev.step(1)
Dev.turnLeft()
for j in range(2):
Dev.step(5 - 3*j)
Dev.turnRight()
Dev.step(10)
Dev.turnRight()
while (Item[i].x != Dev.x) or (Item[i].y != Dev.y):
wait()
Dev.step(1)
Spaceship.step(5)
while Flyer[1 + 2*i].disappear():
wait()
Dev.step(2)
Spaceship.turnRight()
Spaceship.step(5)
Dev.turnLeft()