# Main Command: Go # Fields 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 drawtile SetPos [-190 -190] PenDown Repeat 4 [Forward 380 Right 90] PenUp Home Fill end to crack Make "Point RandomPoint SetPos :Point If 0=(Item 2 FindColor Pos) [Make "OnLine :OnLine+1 Stop] Make "PosList NESW Make "DistV (Item 1 :PosList) + (Item 3 :PosList) Make "DistH (Item 2 :PosList) + (Item 4 :PosList) If (:DistV < :DistH) [ If And ((Item 2 :PosList) > 6) ((Item 4 :PosList) > 6) [LineV]] [ If And ((Item 1 :PosList) > 6) ((Item 3 :PosList) > 6) [LineH]] end to nesw #Return North East South and West distances Make "PosList [] For [N 0 3] [ Make "Dist 0 SetPos :Point SetH :N*90 While [255=(Item 1 FindColor Pos)] [ Make "Dist :Dist + 1 Forward 1] Make "PosList LPut :Dist :PosList] Output :PosList end to randompoint Output List (Random 360)-180 (Random 360)-180 end to lineh SetPos :Point SetH 90 Forward (Item 2 :PosList)-1 SetPW Integer :DistH/32 PenDown Back :DistH-2 PenUp end to linev SetPos :Point SetH 0 Forward (Item 1 :PosList)-1 SetPW Integer :DistV/32 PenDown Back :DistV-2 PenUp end to colorize Repeat 64 [ SetPos RandomPoint If 255=(Item 1 FindColor Pos) [ SetPC (List (Integer 100 + Random 127) 127 0) Fill] ] end to go New SetPC Orange DrawTile Make "OnLine 0 SetPC Black While [:OnLine < 64] [Crack] Colorize end