首页 > 编程知识 正文

CodeMonkey过关学习笔记系列86100关 until循环,教学笔记系列丛书

时间:2023-05-06 13:32:37 阅读:226793 作者:2848

CodeMonkey过关学习笔记系列:86-95关

•“直到”沙地 ( THE SANDS OF UNTIL )86~100


第 86 关挑战//"直到"沙地//接下来要介绍的是 直到 until 这个循环指令 !//这个和71关是一样的。这里用到了until和near。until near match step 1grab()until near pile step 1drop()

第 87 关挑战//接近 near 这个指令会返回给你 - 肯定的 yes 或 否定的 no 的结果//这个和71,86关是一样的。这里用到了until和near。until near match step 1grab()until near pile step 1drop()

第 88 关挑战//如果你不好好使用的话 , 直到 until 这个循环指令将会永无止尽的继续下去.//介绍了死循环until near match step 1grab()turnTo pileuntil near pile step 1drop()

第 89 关挑战接下来你需要好好利用 直到 until 这个循环指令哦.until near match step 1grab()turnTo pilestep distanceTo piledrop()

第 90 关挑战turn leftuntil near match step 1grab()turnTo pilestep distanceTo piledrop()

第 91 关挑战until near match step 1grab()turnTo pilestep distanceTo piledrop()

第 92 关挑战until turtle.near bridge turtle.step 1grab()step distanceTo piledrop()

第 93 关挑战until near match turnTo match step 1grab()turnTo pilestep distanceTo piledrop()

第 94 关挑战希望你没有忘了函数,也就是 functions !chase = (m) -> until near m turnTo m step 1chase matchgrab()chase piledrop()

第 95 关挑战chase = (m) -> until near m turnTo m step 1#这段代码是正常的:for m in matches chase m grab() chase pile drop()

CodeMonkey过关学习笔记系列:96-100关

•“直到”沙地 ( THE SANDS OF UNTIL )86~100


第 96 关挑战goto = (t) -> turnTo t step distanceTo tcollect = (t) -> goto t grab() goto pile drop()#如果猫还醒着,千万别走过去!until cat.sleeping() wait()collect matchstep 15

第 97 关挑战用 wait 指令来静待猫咪睡觉吧...goto = (t) -> turnTo t step distanceTo tcollect = (t) -> goto t grab() goto pile drop()for m in matches until cat.sleeping() wait() collect m

第 98 关挑战goto = (t) -> turnTo t step distanceTo t#让这个函数能够收集t collect t#并且不要被吃掉或掉到水里哦safeCollect = (t) -> until cat.sleeping() wait() #就在那儿! goto bridge goto t grab() goto bridge goto pile drop()for m in matches safeCollect m

第 99 关挑战chase = (t) -> #实现这里! turnTo t step distanceTo tsafeCollect = (m) -> until cat.sleeping() wait() #完成这里! until near m chase m grab() chase pile drop()safeCollect match

第 100 关挑战chase = (t) -> turnTo t step distanceTo tsafeCollect = (m) -> until cat.sleeping() wait() until near m chase m grab() chase pile drop()for m in matches safeCollect m

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。