# Main Command: Go 7 # Pursuit by Guy Walker # www.logoarts.co.uk to new # set default screen, pen and turtle ResetAll SetScreenSize [400 400] HideTurtle SetSC Black SetPC Green SetPS 1 PenUp end to init :n If :N <2 [Print [Need more than one turtle!] Stop] Repeat :N [ SetTurtle RepCount Make "Angle RepCount*360/:N SetPC Hue :Angle PenUp Make "Dist 190 If :N=4 [Make "Dist 260] If :N=8 [Make "Dist 200] Left 180/:N +:Angle Back :Dist PenDown] end To Hue :Theta # Output RGB hue list from angle :Theta Make "Red Round 127.5*(1+Sin :Theta) Make "Green Round 127.5*(1+Sin (:Theta+120)) Make "Blue Round 127.5*(1+Sin (:Theta+240)) Output (List :Red :Green :Blue) End to go :n New SetTurtlesMax :N+1 Init :N Make "Count 0 While [(Distance [0 0]) >2] [ Repeat :N [ SetTurtle RepCount Make "myPos Pos If RepCount+1 >:N [SetTurtle 1] [SetTurtle RepCount+1] If :Count=Integer :Count [Make "thisPos Pos SetPos :myPos SetPos :thisPos] [SetH Towards :myPos Forward 2 Wait1] ] Make "Count :Count+0.1] end