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