特技关卡 11-1for b in bananas
until tiger.sleeping() and bear.sleeping()
wait()
goto b
//封装为函数
waitFor=()->
until tiger.sleeping() and bear.sleeping()
wait()
for b in bananas
waitFor()
goto b
特技关卡 11-2for b in bananas
until tiger.sleeping() and bear.sleeping()
wait() #在这里增加编码
if b.frozen()
goat.goto b
goat.hit()
until tiger.sleeping() and bear.sleeping()
wait()
goto b
//封装为函数
waitFor=()->
until tiger.sleeping() and bear.sleeping()
wait()
for b in bananas
waitFor() #在这里增加编码
if b.frozen()
goat.goto b
goat.hit()
waitFor()
goto b
特技关卡 11-3
x = 02.times ->
until bears[x].sleeping() and tigers[x].sleeping()
wait()
goto bananas[x]
x = x + 1//========================================================================================
waitFor=(obj1, obj2) ->
until obj1.sleeping() and obj2.sleeping()
wait()
x = 02.times ->
waitFOr(bears[x], tigers[x])
goto bananas[x]
x = x + 1
特技关卡 11-4
until tiger.sleeping() and bear.sleeping()
wait()
for b in bananas
goto b
特技关卡 11-5for b in bananas
until bear.sleeping() or bear.playing()
wait()
if b.green()
goat.goto b
else
monkey.goto b
特技关卡 11-6for b in bananas
if b.green()
until tiger.sleeping() or tiger.playing()
wait()
goat.goto b
else
until bear.sleeping() or bear.playing()
wait()
goto b
//--------------------------------------------------------------------------------
waitFor = (obj) ->
until obj.sleeping() or obj.playing()
wait()
for b in bananas
if b.green()
waitFor(tigger)
goat.goto b
else
waitFor(bear)
goto b
特技关卡 11-7
x = 23.times ->
until bears[x].sleeping() or bears[x].playing()
wait()
#我们最好等待熊睡觉或是玩耍
goto bananas[x]
x = x - 1//----------------------------------------------------------------------------
waitFor = (obj) ->
until obj.sleeping() or obj.playing()
wait()
x = 23.times ->
waitFor(bears[x])
goto bananas[x]
x = x - 1
特技关卡 11-8
until tiger.sleeping() or tiger.playing()
wait()
goat.goto bridges[0]
until tiger.sleeping() or tiger.playing()
wait()
monkey.goto bridges[1]
for b in bananas
if b.frozen()
goat.goto(b)
goat.hit()
monkey.goto b
特技关卡 11-9for b in bananas
if b.green() or b.frozen()
if b.frozen()
goat.goto b
goat.hit()
goat.goto b
goto bananas[3]
特技关卡 11-10for b in bananas
if b.green() or b.frozen()
if b.frozen()
goat.goto b
goat.hit()
goat.goto b
2.times ->
step 20
turn left
特技关卡 11-11
chaser = bear
2.times ->
say chaser
until chaser.sleeping() or chaser.playing()
wait()
step 10
chaser= tiger
特技关卡 11-12
chaser = tiger
mover = monkey
for b in bananas
if b.green()
#完成我:
chaser = bear
mover = goat
else
#和我:
chaser = tiger
mover = monkey
until chaser.sleeping() or chaser.playing()
wait()
mover.goto b
特技关卡 11-13
x = 03.times ->
for stepper in [monkey,goat]
until tigers[x].sleeping() and bears[x].sleeping()
wait()
stepper.step 10
x = x + 1
特技关卡 11-14
waitFor = (b) ->
until b.sleeping() or b.playing()
wait()
x = 02.times ->
waitFor(bears[x])
goto bananas[x]
waitFor(bears[x])
goto turtle
turtle.step 10
x = x + 1
特技关卡 11-15
until (tiger.playing() or tiger.sleeping()) and (bear.playing() or bear.sleeping())
wait()
goto banana
特技关卡 11-16for b in bananas
until ( bear.playing() or bear.sleeping() ) and ( tiger.playing() or tiger.sleeping() )
wait()
goto b
特技关卡 11-1#提示:你应该等待直到什么时候?for b in bananas until tiger.sleeping() and bear.sleeping() wait() goto b特技关卡 11-2for b in bananas until tiger.sleeping() and bear.sleeping(...