Our Code

 

global [points]

 

to mole

setpoints 0

a, on

b, on

c, on

forever [

a, waituntil [or (switch 6) (switch 8)] off

wait (random 8)

a, rd

a, on

]

forever [

b, waituntil [or (switch 5) (switch 7)] off

wait (random 8)

b, rd

b, on

]

forever [

c, waituntil [or (switch 11) (switch 4)] off

wait (random 8)

c, rd

c, on

]

when [or zero-or-one? two-through-five?]

[setpoints (points + 1) print points]

wait 600

stoprules

a, off

b, off

c, off

end

 

to zero-or-one?

output or (switch 2) (switch 15)

end

 

to two-through-five?

output or two-or-three? four-or-five?

end

 

to two-or-three?

output or (switch 1) (switch 12)

end

 

to four-or-five?

output or (switch 0) (switch 14)

end