Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Logo > Re: Logo progra...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1436 of 1605
Post > Topic >>

Re: Logo program to draw 'tree' & 'random angle tree'

by "John St. Clair" <jstclair@[EMAIL PROTECTED] > May 11, 2007 at 01:37 PM

The message below is being cross-posted from the LogoForum.  Please 
reply here at comp.lang.logo and it will be crossposted back to the 
LogoForum.  The original author of this message is "jotape1960" 
<jotape1960@[EMAIL PROTECTED]
>.


--- In LogoForum@[EMAIL PROTECTED]
 "Peter Eric WILLIAMS" <pewtas@[EMAIL PROTECTED]
>
wrote:
>
>
> G'day Wonderful LOGO ppl,
>
> I like the idea of LOGO, however I have trouble learning it.
>
> Many weeks ago I was asking for the logo program which draw
a 'tree' and
> a 'random angle tree'.
>
> Some time later I discovered that I had saved the Borland Delphi 5
> source code to do it.
>
> Below is pasted the Borland Delphi 5 (I think) source code for
drawing a
> 'tree' and a 'random angle tree'. Don't ask me how it works!!!!!!!
I
> have good memories of watching the program draw
beautiful "rangtrees" I
> called them (eg random-angle-trees).
>
> I'm now no longer using Mirco$oft Windows XP Home Edition. I'm
using
> Linux UBUNTU 6.10 LTS (available from www.ubuntu.com) and the more
I use
> it the more I love it.
>
> Also, UBUNTU has what is called "KTurtle" -- I don't know anything
about
> it but it looks really cute... & I've got a shortcut to it on my
> desktop.
>
> Yours Sincerely,
> pew { poet }
>
> The following is the Borland Delphi 5 (I think) source code for
drawing
> 'tree' and 'rangtree'
> (eg RANdom ANGle TREE)
>
> I cannot remember how to use it -- but I remember that it worked!!!
>
> ----------------------------------
>
> to tree :size
> if :size >= 5
> begin
> fd :size
> lt 30 tree :size * 0.7
> rt 60 tree :size * 0.7
> lt 30 bk :size
> end
> end
>
> tree 50
>
>
> to rangtree :size
> if :size >= 5
> begin
> fd :size
> lt 30 rangtree :size * (((random 5)+5)/10)
> rt 60 rangtree :size * (((random 5)+5)/10)
> lt 30 bk :size
> end
> end
>
>
> to rangtree2 :size
> if :size >= 5
> begin
> fd :size
> lt random(25)+5 rangtree :size * (((random 5)+5)/10)
> rt random(55)+5 rangtree :size * (((random 5)+5)/10)
> lt random(25)+5 bk :size
> end
> end
> --------------------------------
>
> Yours Sincerely and With Best Wishes,
> pew { poet }
>

To MSWLogo the code must have some minimal changes and it's:

to rangtree :size
if or :size<5 :size=5 [stop]
lt 30 rangtree :size * (((random 5)+5)/10)
rt 60 rangtree :size * (((random 5)+5)/10)
lt 30 bk :size
end

to rangtree2 :size
if or :size<5 :size=5 [stop]
fd :size
lt random(25)+5 rangtree :size * (((random 5)+5)/10)
rt random(55)+5 rangtree :size * (((random 5)+5)/10)
lt random(25)+5 bk :size
end

to tree :size
if or :size<5 :size=5 [stop]
fd :size
lt 30 tree :size * 0.7
rt 60 tree :size * 0.7
lt 30 bk :size
end

But I think there is some "mistake" or "losing thing" to rangtree,
I'm not sure.

GOD BLESS YOU ALL!!!!!!!

Juan J. Paredes G.
From Curicó, Chile, South America, with love
 




 1 Posts in Topic:
Re: Logo program to draw 'tree' & 'random angle tree'
"John St. Clair"  2007-05-11 13:37:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 16:05:29 CDT 2008.