Code for the Kids' Running Behavior

 

to escape-bully

when hit-something [ab, thatway onfor 30 a, onfor 10]

go-ahead

escape-bully

end

 

 

 

to go-ahead

ab, thisway onfor 30

ifelse flip [a, onfor 30]

[b, onfor 30]

end

 

to flip

output random < 16385

end

 

to run-away

ab, thatway

ab, onfor 40

a, onfor 30

ab, onfor 20

end

 

to hit-something

output switchb

 

end