Handy Board Code

to dragon

when [head] [forward

openwings

openmouth

pourwater

wait 100

closemouth

backward

closewings]

end

 

to forward

feet thatway onfor 50

end

 

to backward

feet thisway onfor 50

end

 

to pourwater

water setpower 5

water thatway onfor 5

water setpower 5

water thisway onfor 25

end

 

to openwings

wings setpower 7

wings thatway onfor 70

end

 

to closewings

wings setpower 5

wings thisway onfor 60

end

 

to openmouth

mouth setpower 8

mouth thatway onfor 30

end

 

to closemouth

mouth setpower 6

mouth thisway onfor 30

end

 

to head

output switch 7

end

 

to wings

a,

end

 

to mouth

b,

end

 

to water

c,

end

 

to feet

d,

end

 

 back . home

 

 

Cricket Code

 

to follow

loop [

if (leftsensor > 100) [lookleft]

if (rightsensor > 100) [lookright]

]

end

 

to eyes

a,

end

 

to lookleft

eyes thatway onfor 4

eyes rd onfor 2

end

 

to lookright

eyes thisway onfor 4

eyes rd onfor 2

end

 

to leftsensor

output sensora

end

 

to rightsensor

output sensorb

end

 

 back . home