logo animation
logo linethick = 0.5
logo backcolor = "black"

repeat untilbreak [
  clear
  pointlist clearall

  // generate some random points..
  logo linecolor = "black"
  pointlist startcapture
  set npts = (calc 3 + (random 10))
  repeat :npts [
    moveto (calc 100 + (random 500)) (calc 100 + (random 500))
    pd
    ]
  pointlist endcapture

  // generate a curve to fit the points..
  pointlist startcapture
  pointlist curvefill
  pointlist endcapture

  // do a dotfill to even things out
  pointlist startcapture
  pointlist dotfill 10 
  pointlist endcapture

  // now at each point, draw a small ellipse
  // rotated relative to the current turtle direction..
  set npts = pointlist size
  decr npts by 2   // omit 1st and last pts 
  set i = 1
  logo linecolor = "brightgreen"
  repeat :npts [
    pu; moveto point :i; pd
    logo circrotate turtledir
    ellipse 30 12
    incr i by 1
    wait 1
    ]
  set k = buttonchoice "Tubes.." "Go again|Quit"
  if :k = "Quit" [ break ]
  ]

