// logo wrapedges 
logo linecolor = "darkblue"

message "Doodler.. some 'randomness' is added\nto the circles..." "Stop"

// start in the middle.. set some parameters randomly
pu; moveto middle pd 
logo turtledir = random 360
set edgesize = random 10
set turnamount = random 20

repeat untilbreak [
  if keypress = 1 [ break ]
  fd (calc :edgesize + random 5)
  set dir = turtledir

  // when line is headed in certain directions, add a bit 
  // so we don't end up just doing perfect circles..
  if :dir > 80 and :dir < 100 [ fd :edgesize ]
  if :dir > 20 and :dir < 40 [ fd :edgesize ]

  rt (calc :turnamount + random 10)
  wait 0.5

  // at random times, wait a bit then reset parameters randomly..
  if irandom 200 = 100 [ 
    // fillshape
    wait 80
    pu; moveto (random winwide) (random winhigh); pd
    logo turtledir = random 360
    set edgesize = random 10
    set turnamount = random 20
    ]
  ]
