本文主要是介绍ICode国际青少年编程竞赛- Python-1级训练场-多变量应用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ICode国际青少年编程竞赛- Python-1级训练场-多变量应用
1、
a = 1
b = 2
for i in range(4):Spaceship.step(a)Dev.step(b)Dev.step(-b)a = a + 1b = b + 1
2、
a = 2
b = 5
for i in range(3):Spaceship.turnLeft()Spaceship.step(a)Spaceship.turnRight()Spaceship.step(b)a = a + 1b = b - 2
3、
a = 4
b = 2
for i in range(3):Dev.step(a)Dev.turnRight()Dev.step(b)Dev.turnLeft()a = a - 1b = b + 1
4、
y = 3
x = 2
for i in range(3):Dev.step(y)Dev.turnRight()Dev.step(x)Dev.turnLeft()y = y - 1x = x + 2
5、
space = 1
dev = 7
for i in range(4):Spaceship.step(space)Dev.step(dev)Dev.step(-dev)space += 1dev -= 2
6、
space = 1
dev = 5
for i in range(4):Spaceship.step(space)Dev.step(dev)Dev.step(-dev)Dev.turnRight()Spaceship.turnRight()space += 2dev -= 1
7、
space = 2
dev = 4
for i in range(4):Dev.step(-dev)Dev.step(dev)Spaceship.step(space)Dev.turnRight()Spaceship.turnRight()dev -= 1space += 1
8、
y = 1
x = 2
for i in range(3):Dev.turnRight()Dev.step(y)Dev.turnLeft()Dev.step(-x)y += 1x += 2
9、
space = 1
dev = 1
for i in range(4):Spaceship.step(space)Dev.step(dev)Dev.step(-dev)space += 1dev *= 2
10、
y = 4
x = 1
Spaceship.step()
for i in range(4):Spaceship.step(y)Spaceship.turnRight()Spaceship.step(x)Spaceship.turnLeft()y -= 1x += 1
11、
dev = 7
space = 4
for i in range(4):Dev.step(dev)Dev.step(-dev)Spaceship.turnLeft()Spaceship.step(space)Dev.turnLeft()dev -= 2space -= 1
12、
a =1
b =1
for i in range(5):Dev.step(b)Dev.turnRight()Dev.step(-a)Dev.step(a)a = a + 1b = b + 2
13、
dev = 1
space = 5
for i in range(4):Spaceship.step(space)Dev.step(dev)Dev.step(-dev)Spaceship.turnRight()Spaceship.turnRight()Spaceship.step(space)Spaceship.turnLeft()Dev.turnRight()dev += 1space -= 1
14、
space = 1
dev = 7
for i in range(4):Spaceship.step(space)Dev.step(dev)Dev.step(-dev)Spaceship.turnRight()Spaceship.turnRight()Spaceship.step(space)Spaceship.turnLeft()Dev.turnRight()space += 1dev -= 2
15、
space = 1
dev = 7
for i in range(4):Spaceship.step(space)Dev.turnLeft()Dev.step(-dev)Dev.step(dev)Spaceship.turnLeft()space *= 2dev -= 2
16、
y = 1
x = 5
for i in range(4):Dev.step(y)Dev.turnRight()Dev.step(x)Dev.step(-2 * x)Dev.step(x)Dev.turnLeft()y += 1x -= 1
17、
y = 4
x = 1
for i in range(4):Dev.turnLeft()Dev.step(x)Dev.step(-2 * x)Dev.step(x)Dev.turnRight()Dev.step(y)x += 2y -= 1
18、
y = 1
x = 7
for i in range(4):Dev.step(y)Dev.turnRight()Dev.step(x)Dev.step(-2 * x)Dev.step(x)Dev.turnLeft()y += 1x -= 2
19、
x = 5
y = 8
for i in range(4):Dev.step(x)Dev.turnRight()Dev.step(y)Dev.step(-y)Dev.turnLeft()Dev.step(-x)Dev.turnRight()x -= 1y -= 2
20、
y = 1
x = 1
for i in range(3):Dev.step(y)Dev.turnLeft()Dev.step(x)Dev.step(-2 * x)Dev.step(x)Dev.turnRight()x *= 2y += 2
这篇关于ICode国际青少年编程竞赛- Python-1级训练场-多变量应用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!