[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Colors in recursive graphics



Hello everybody,

Several times our expert Yehuda suggested to use colors for better 
understanding recursion. Now I'd like to add my voice there. I'm 
teaching recursion to advanced group of young students and this trick 
is of really great help, let alone the joy the kids are getting 
watching the process. Indexed colors make now all this thing easy to 
implement in MSWLogo.  My lessons are based on the Yehuda's ones and 
the example I'm showing is near to those you have already seen.

All the best,
Olga.
----------------------------
to rec1.main 
;Recursive images, based on polygons
;Inspired by Yehuda's lessons 
cs ht
pr [Input number of the sides]
rec1.draw rw
end

to rec1.draw :n
pr [Input side size and recursion level]
rec1.do rw rw
end

to rec1.do :a :level
if :level<1 [stop]
repeat :n[rec1.shape :a rt 360/:n]
rec1.paint :level
end

to rec1.shape :a
fd 3*:a/4 rt 180 rec1.do :a/2 :level-1
rt 180 fd :a/4 
end

to rec1.paint :level
setfc :level pu rt 30 fd 5 fill bk 5 lt 30 pd
end

---------------------------
Try -  4 128 5  - and enjoy!

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  squares.gif
     Date:  25 Feb 1998, 10:36
     Size:  7328 bytes.
     Type:  GIF-image

squares.gif



Global SchoolNet Foundation - Linking Kids Around the World!
Copyright GSN - All Rights Reserved - Comments & Questions
Visit GSN's Global Schoolhouse for more exciting learning resources!
Search our Site - Home