【代码】iCode-Python 基础操作:11-20关
icode-python基础操作单元属于入门单元,11-20关主要是让学习者熟悉Dev坐船,Spaceship飞船左转、右转等指令,以及实现掉头动作。
切记:飞船不能后退!
参考代码如下:
第11-20关
#第11关Dev.step(1)Spaceship.step(1)#第12关Spaceship.step(4)Dev.step(4)#第13关Dev.step(5)Spaceship.step(5)#第14关Spaceship.turnRight()Spaceship.step(1)#第15关Spaceship.turnLeft()Spaceship.step(1)#第16关Spaceship.step(5)Dev.step()Spaceship.turnLeft()Spaceship.step(5)#第17关Dev.step()Spaceship.step(5)Spaceship.turnRight()Spaceship.step(4)#第18关Spaceship.turnLeft()Spaceship.turnLeft()Spaceship.step(2)#第19关Dev.step(3)Spaceship.turnRight()Spaceship.turnRight()Spaceship.step(5)#第20关Dev.step(-2)Spaceship.step(4)Dev.step(2)
