CodeMonkey过关学习笔记系列:86-95关
第 86 关挑战
until near match
step 1
grab()
until near pile
step 1
drop()
第 87 关挑战
until near match
step 1
grab()
until near pile
step 1
drop()
第 88 关挑战
until near match
step 1
grab()
turnTo pile
until near pile
step 1
drop()
第 89 关挑战
接下来你需要好好利用 直到 until 这个循环指令哦.
until near match
step 1
grab()
turnTo pile
step distanceTo pile
drop()
第 90 关挑战
turn left
until near match
step 1
grab()
turnTo pile
step distanceTo pile
drop()
第 91 关挑战
until near match
step 1
grab()
turnTo pile
step distanceTo pile
drop()
第 92 关挑战
until turtle.near bridge
turtle.step 1
grab()
step distanceTo pile
drop()
第 93 关挑战
until near match
turnTo match
step 1
grab()
turnTo pile
step distanceTo pile
drop()
第 94 关挑战
希望你没有忘了函数,也就是 functions !
chase = (m) ->
until near m
turnTo m
step 1
chase match
grab()
chase pile
drop()
第 95 关挑战
chase = (m) ->
until near m
turnTo m
step 1
#这段代码是正常的:
for m in matches
chase m
grab()
chase pile
drop()