Babuino Project is powered by Creative Minds.

September 07, 2009

The code for the last post


global [rot]

to main
setrot 1

a, thisway off
setpower 1

repeat 100
[

send sensora
; send rot

if sensora > 100
[
setrot not rot
if rot = 1
[
thisway
]
if rot = 0
[
thatway
]
on
setpower 1
wait 5
setpower 2
wait 5
setpower 3
wait 5
setpower 4
wait 5
]

if sensora < 100
[
setpower 4
wait 5
setpower 3
wait 5
setpower 2
wait 5
setpower 1
wait 5
off
]

wait 10
]

off

end


No comments:

Post a Comment