«

icode函数入门-5-12

admin 发布于 阅读:47 iCode


# 找到地图中重复的部分,定义函数,根据需要完成函数的调用
def func():
    Dev.step(3)
    Dev.turnRight()
    Dev.step(3)
    Dev.turnLeft()
    Spaceship.step(3)
    Dev.step(-3)

Dev.step(3)
Dev.turnLeft()
Dev.step(-1)
Dev.step()

Spaceship.step(3)
Spaceship.turnRight()
func()

Spaceship.step(3)
func()

Spaceship.turnRight()
Dev.turnRight()
func()

Dev.turnLeft()
Dev.step(-1)