From: Harold Hausman Date: 2006-12-02T17:56:15+09:00 Subject: Re: [QUIZ] Turtle Graphics (#104) On 12/2/06, Morton Goldberg wrote: > On Dec 1, 2006, at 10:42 AM, Harold Hausman wrote: > > > Ironically, I very recently implemented a turtle graphics system using > > GTK and Ruby. > > Why ironic? I's say you have a head start on solving the quiz. I look > forward to seeing your submission. > I guess 'coincidentally' would have been a better word. :P Unfortunately, I have scant time for Ruby Quiz. The one (possibly two?) submission I made was a total fluke. :(( > > Here are some images that came from it to whet your appetite: > > http://www.danceliquid.com/images/LS/ > > > > It used cairo for the anti-aliased line drawing. > > Nice images. The design you call Penrose, I call Hilbert. That and > several other classic turtle designs (both the turtle code and the > graphic output) are included with the quiz for participants to test > against their Turtle class. The turtle code is in the samples folder > and the graphics (.tiff files) are in the designs folder. Also, > compare tree.tiff to your tree.png -- fairly similar. > My implementation includes an L-system exploration library which can feed instructions directly to the pen. (which is abstracted from the turtle in my code) The turtle (which is implemented using eval in a very straight forward manner), and the L-system library, can both produce strings of instructions for the pen. (the pen is capable of both cairo and gtk::drawingarea drawing) I pulled most of the L-systems I was drawing from fractint, actually, because the my L-system library is nearly interface compatible with it. So credit goes out to the crazy wizards who contributed L-systems to fractint. There's even the option of having the turtle generate a string of instructions, which can then be further iterated on by the L-systems, an option that has yet to be properly exploited. With that said, the code is a dirty, voracious, sub-optimal, tightly coupled, borderline embarrassing, pile of hack. (As most of my one weekend personal projects are.) But maybe it would be interesting to you or others. I've put it online, feel free to grab it: http://www.danceliquid.com/docs/turtlegraphics.zip But no cheating on the quiz with it... ;) Regards, -Harold