Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Fractal Tree
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
arnoct




PostPosted: Sun May 01, 2005 4:31 pm   Post subject: Fractal Tree

code:
proc fractal (x, y : int, angle, len : real)
    var lengthchange := .75
    if len > 1 then
        var xnew := x + round (len * cosd (angle))
        var ynew := y + round (len * sind (angle))
        drawline (x, y, xnew, ynew, green)
        fractal (xnew, ynew, angle + 45, len * lengthchange)
        fractal (xnew, ynew, angle - 45, len * lengthchange)
    end if
end fractal
fractal(maxx div 2,0,90,100)


Attached the code with comments if you want them.



fractal.t
 Description:
Code with comments.

Download
 Filename:  fractal.t
 Filesize:  1.13 KB
 Downloaded:  310 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
zylum




PostPosted: Sun May 01, 2005 4:55 pm   Post subject: (No subject)

nice. here's one i did a while back

http://www.compsci.ca/v2/viewtopic.php?t=4137&highlight=fractal

+ 25 bits
dann_west




PostPosted: Mon May 02, 2005 2:04 pm   Post subject: Re: Fractal Tree

Pretty trippy!
Keep up the good designs!
dann_west




PostPosted: Mon May 02, 2005 2:10 pm   Post subject: Re: Fractal Tree

Interesting.
Could use some sprucing up though.
Twisted Evil
Delos




PostPosted: Mon May 02, 2005 6:07 pm   Post subject: (No subject)

@dann_west
Why on Earth did you double post, 6 minutes apart, when you simply could've editted your last post if you were that intent on adding to it?

@arnoct
Nice work. Suggestion: add lengthchange and fractal colour to your parameters. Just adds a little more customizability to the whole thing...

+ bits
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: