Friday, March 4, 2011

Polygon

This is a simple script drawing polygons. Note how as the number of lines in the polygon increases the shape looks more and more like a circle.
reset

penup
turnleft 180
forward 150
turnright 90
pendown

for $x = 2 to 50 {
 repeat $x {
  forward 20
  turnright 360 / $x
}

No comments:

Post a Comment