Suggest_Code_01
func turnRight(){
turnLeft()
turnLeft()
turnLeft()
}
moveForward()
turnLeft()
moveForward()
turnRight()
moveForward()
turnRight()
moveForward()
turnRight()
moveForward()
turnLeft()
moveForward()
toggleSwitch()
Result: OK
Suggest_Code_02
Func turnRight(){
turnLeft()
turnLeft()
turnLeft()
}
moveForward()
turnRight()
moveForward()
turnRight()
moveForward()
moveForward()
turnRight()
moveForward()
moveForward()
moveForward()
moveForward()
turnRight()
moveForward()
toggleSwitch()
Result: OK
Hint:
關卡內有3塊開關,只要將沒有發亮的開關打開即可,本來就亮著的開關不用再去做 toggleSwitch 的動作。
沒有留言:
張貼留言