[Q] recursion

karl karl.ramberg at chello.se
Fri Nov 24 17:33:24 UTC 2006


David Faught skrev:
> This is really a Smalltalk/Squeak language question, although it may
> not sound like it at first.  There is a limited Squeak programming
> environment in the MockTurtle turtle graphics package for Croquet,
> essentially like a WorkSpace where the code is dynamically compiled
> and executed like a DoIt, and not retained as a method in the turtle
> class.
>
> Since many turtle graphics examples use recursion to do interesting
> things, I'm wondering if there is a way to do recursion in this kind
> of environment, maybe using named blocks?
>
> Thanks for any input you may have.  Simple examples would be much 
> appreciated!
>
>
I have been doing some stuff like this with the etoys and found that 
recursion did limited help
in drawing. This is because the patterns repeated would not change, so 
you would just get
drawings like stairs or squares drawn 100 times on top of each other 
etc. I implemented simple a L-System to get  interesting results.
And if a L-System is simple enough to be implemented in etoys so it 
should not be hard in Smalltalk :-)
Here is the page I used:
http://instruct1.cit.cornell.edu/Courses/bionb441/LSystem/index.html
I see that there is some 3D stuff on that page as well.

Karl



More information about the Squeak-dev mailing list