Codes for Chase Spirals


to main :vfox :vhare
cs ht
spi.chase [0 0] [-100 0] 99.9 100
end

to spi.chase :fox :hare :new_dist :old_dist
if not :new_dist<:old_dist[stop]
pu setpos :fox pd
setpc 0 move_fox  pu setpos :hare pd
setpc 4 move_hare pu setpos :fox  pd
spi.chase :fox :hare distance :hare :new_dist
end

to move_fox
seth towards :hare fd :vfox
make "fox pos
end

to move_hare
rt 90 fd :vhare
make "hare pos
end