Programs — LOGO last changed 29 May 2008 |
Our first assignment was to make polygons. The number of sides and the size are up to the user. It quickly became obvious that the size of the screen has an impact on how our pictures will look... when the turtle reaches the edge of the screen, it wraps around to the opposite side. Neat in some cases, annoying in others.
In addition to the motions of the turtle, Ngon introduced abstraction and state transparency. Abstraction was demonstrated by the development of the program. We began with a triangle, each side 60 units long. Then a square and a hexagon, each side 60 units long. Then we replaced the number of sides with :n and the side length with :side.
The importance of state transparency was evident when we omitted the final turn, which gave us a complete picture but left the turtle facing a different direction at the beginning of the next execution.
Two modifications of Ngon set up the remaining workshops by creating CNgon. The first is centering the Ngon on the starting point; the other is to specify a radius instead of a side length. The effect of these two changes is to make it much easier to predict the size of CNgon.
Applying the principles of CNgon to Spingon yields a torus–shaped SpinCNgon. The CNgons don't share any vertices in this case, but they share their centerpoint.
The next evolutionary leap of CNgon is to tile SpinCNgons next to each other in various patterns. So that's what we did.
Based on the idea of a small pipe rolling around on a large pipe, Pipegons and variations employ simple CNgons to create intricate and interesting diagrams.
CNgon is based on the idea of circumscribed polygons. INgon develops this idea by creating subsequent polygons circumscribed by circles which fit within the original polygon.
Expanding on Tilegon to create tapestries which resemble larger and far more complicated tiles.
The final incarnation of CNgon is Fractalgon, which replaces each side of the polygon with fractal lines.
Over the course of the quarter, we've had a couple of ideas for nifty things. Relevance is not guaranteed.
Combining Spingon's pretty pictures with the technical control introduced by CNgon, we obtain CSpingon... a centered Spingon governed by an input radius. Hardly revolutionary, but nevertheless an improvement over Spingon.
Early in the quarter, we were instructed to come up with a stopping mechanism for Spingon. The assignment was to stop drawing Ngons after one full revolution, which was as simple as repeat 360 / :angle. A most elegant way to achieve this, however, would be to use the Least Common Multiple of 360 and the input angle to ensure a "complete picture" without having to draw 360 revolutions. Unfortunately, Starlogo does not have an LCM command. So Joel attempted to write one.