LOGO-L>Please Recursion in MSW-LOGO 
Author Message
 LOGO-L>Please Recursion in MSW-LOGO

> Date - Sat, 13 Jun 1998 08:28:55 +0200

> Hi there!
> I'd like to have same examples for recursion, such like the Koch-curve.
> Could any send me in MSW-LOGO
> Please
> Thanx
> Rope

Hi Peter,

On the page


you may find rather interesting program FRACTREE with the lot of
examples on recursion graphics, though I'm not sure it's easy to
translate the formal descriptions presented there into Logo (for me,
it turned to be a hard problem). But, I think,  you'll get a lot of
pleasure working with it.

As to real codes, may be these ones will suit you.

The first two programs were designed according to Yehuda's wonderful
lessons, which he made for me and my students. You might want to test
other parameters.

The third program is called "AntiSnowflake" and if you compare it
with the Koch snowflake, it'll be clear where the name comes from.

The fourth program was designed by my young student. We were studying
the page on fractals  
http://www.*-*-*.com/ ~mconnors/fractal/fractal.html
and discussing the question how to draw a fractal using
initiator/generator and he just invented his own generator.


-------------- 1 --------------------------
to main1 ; Example for square shapes
cs ht   ; plain cosmetics
setsc 0
setpc 4
pu setxy -70 -70 seth 0 pd
shape1 4 140 .45 6

to shape1 :sides :size :fract :level
if :level<1 [stop] ; every recursive program needs a stop rule
repeat :sides[shape :sides :size*:fract :fract :level-1 fd :size rt
360/:sides] end

------------------ 2 -----------------------------
to main2 ; An example for pentagonal shape
cs ht setsc 0
setpc 3
pu setxy -25 -30 seth -18 pd
draw2 5 50 .33 4

to draw2 :sides :size :fract :level
if :level<1[stop]
repeat :sides[shape2 :size :fract rt 360/:sides]

to shape2 :size :fract
fd .5*:size*(1+:fract) rt 180
draw :sides :size*:fract :fract :level-1
rt 180 fd .5*:size*(1-:fract)

------------------------ 3-------------------

to main ; AntiSnowflake
cs ht
pu setxy -100 -85 seth 30 pd
draw 200 3

to draw :size :level
repeat 3[side :size :level rt 120]

to side :size :level
if :level<1[fd :size stop]
side :size/3 :level-1
rt  60 side :size/3 :level-1
lt 120 side :size/3 :level-1
rt  60 side :size/3 :level-1

------------------------- 4 ------------------
to main ; Cross
cs ht
pu setxy  -22 -22  pd
do 45 3

to do :size :level
repeat 4[shape :size :level rt 90]

to shape :size :level
if :level<1[fd :size stop]
shape :size/3 :level-1 lt 90
shape :size/3 :level-1 lt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 lt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 lt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 rt 90
shape :size/3 :level-1 lt 90
shape :size/3 :level-1 lt 90
shape :size/3 :level-1

Fri, 01 Dec 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. LOGO-L> Apple logo/MSW Logo

2. Please Recursion in MSW-LOGO

3. LOGO-L> PC-LOGO syntax in MSWLogo

4. LOGO-L> Re: MSW LOGO hardcopy

5. LOGO-L> msw logo: turtling

6. LOGO-L> RE: MSW Logo and Interfacing

7. LOGO-L> MSW-logo and values

8. LOGO-L> Re: MSW Logo


10. LOGO-L> Reseach Machines Logo (RM LOGO)

11. Different behaviour - UCBLOGO, MSW-LOGO, TKTS-LOGO

12. Different behaviour - UCBLOGO, MSW-LOGO, TKTS-LOGO


Powered by phpBB® Forum Software