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

LOGO-L> Carpet



Hi,

I think that a few lines of code might be in place :-)

I found the following image in a new beautiful Logo book:

    Learning by Developing by Blaho & Kalas, Logotron (1998)
 
 

The code provided there (p.238) uses multiple turtles.

Here's my solution for it, with a single turtle (in MSWLogo).

To run it say: draw 243 3

to draw :size :level
if :level<1[stop]
repeat 4[shape rt 90]
end

to shape
draw :size/3 :level-1
fd :size/3 square
fd 2*:size/3
end

to square
repeat 4[fd :size/3 rt 90]
pu rt 45 fd :size/6 fill
bk :size/6 lt 45 pd
end


Regards,

Yehuda

    _/    _/     _/ _/_/_/_/_/ _/_/_/_/
   _/   _/     _/_/    _/          _/
  _/_/_/     _/  _/   _/        _/
 _/   _/   _/_/_/_/  _/      _/
_/     _/_/      _/ _/     _/_/_/_/

http://www.geocities.com/CollegePark/lab/2276/
e-mail: yehuka@softhome.net
 

GIF image



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