For森林 For Forest

這關不用添加或更改任何指令,按RUN!細心觀察程式如何運行!
Just press “RUN!” and watch carefully how the program run!
試試於第三行裏用“distanceTo”及“b”來完成程式。
Use “distanceTo” and “b” in the third line to complete the program.
答案 Answer↓↓
試試參照第62關的程式來續寫第二及三行指令。
Reference challenge 62 and complete the second and third lines of code.
答案 Answer↓↓
嚇走老鼠後,用for循環來完成程式。
Use for loop to complete the program after drive out the mouse.
答案 Answer↓↓
先過橋“step 15”再用for循環來完成程式。
“step 15” to cross over the bridge and use a for loop to complete the program.
答案 Answer↓↓
第一行的“x = 10”足夠嗎?第二及三行指令是正確的,續寫第四行來成程式。要注意猴子的行動不是在循環裏面啊!
It is enough for “x = 10” in the first line? The second and third lines of code are correct. Code in the fourth line to complete the program. Remember that the monkey action is outside from the loop.
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓
每次猴子都要先返回木筏(raft)才能收集下一隻香蕉啊!
Monkey needs to return raft each time before catch the other banana.
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓
可以嘗試用“for i in islands”來完成程式。
Try to use “for i in islands” to complete the program.
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓
第二行的指令是“step 0”還是“step distanceTo t”?第三行的指令裏,t.step 10足夠嗎?
It should be “step 0” or “step distanceTo t” in the second line? It is enough for “t.step 10” in third line?
答案 Answer↓↓
試運用“x = distanceTo b”來完成程式。
Try to use “x = distanceTo b” to complete the program.
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓
我們遇到猴子的第三個朋友,鱷魚(crocodile)。鱷魚不懂得step,只懂得turn。充分利用鱷魚的協助:for c in crocodiles來完成程式吧!
We meet a new friend – crocodile! Crocodile does not know step. It only knows how to turn. Use “for c in crocodiles” to complete the program.
答案 Answer↓↓
試用for循環來完成程式!
Try to use for loop to complete the program!
答案 Answer↓↓
這關要用上兩個for循環。先用“for c in crocodiles”之後用“for i in islands”來完成程式吧!
We need to use 2 times of “for loop” in this challenge. Use “for c in crocodiles” then use “for i in islands” to complete the program.
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓
這關要用上兩個for循環。先用“for c in crocodiles”之後用“for b in bananas”來完成程式吧!
We need to use 2 times of “for loop” in this challenge. Use “for c in crocodiles” then use “for b in bananas” to complete the program.
答案 Answer↓↓
這關要在一個循環裏面使用另一個循環,這叫個「巢狀循環(nested loop)」。在“for b in bananas”裏面使用一個“for c in crocodiles”。而“for c in crocodiles”要寫在“turnTo b”之前。試試能不能做到!
We need to write a loop inside a loop, it calls “Nested Loop” (a loop exists inside the body of another loop). Write a “for c in crocodiles” inside “for b in bananas”. “for c in crocodiles” should run before “turnTo b”. Let try!
看看程式是如何運行的:
Let see how the codes run:
答案 Answer↓↓