def back(): turn("left") turn("left") while(not isLightOn()): if(not hasBlocked('right')): turn("right") move() elif(not hasBlocked('forward')): move() elif(not hasBlocked('left')): turn("left") move() else: back() toggle()
def back(): turn("left") turn("left") while(not isLightOn()): if(not hasBlocked('right')): turn("right") move() elif(not hasBlocked('forward')): move() elif(not hasBlocked('left')): turn("left") move() else: back() toggle()
© 2024 玉汝于成