Author |
Message |
Viper
|
Posted: Thu Oct 06, 2005 8:05 am Post subject: Tree |
|
|
i have 2 make a tree using recursion we have to start with the trunk n make branches on it(branch=limb with 2 half lenght limbs on it..prog stops when length of limb<=10)but i have no idea where to start could someone point me in right direction plz n thx
p.s recursion tutorial didnt help so dont like me 2 it |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Thu Oct 06, 2005 8:45 am Post subject: (No subject) |
|
|
have a function that draws a single branch. Then after drawing it, call the same function twice for each additional limb, specifying that its length is half. Stop calling functions when the length gets to be too small. |
|
|
|
|
|
Viper
|
Posted: Thu Oct 06, 2005 5:27 pm Post subject: (No subject) |
|
|
yeah i know but how do i have it see where to put the branches n how do i make it look and see if it has to make more branches on a limb or to move on to put 2 on a smaller limb |
|
|
|
|
|
zylum
|
Posted: Thu Oct 06, 2005 5:59 pm Post subject: (No subject) |
|
|
did you read the whole tutorial? theres a large section of it devoted to trees and even has 4 different examples... |
|
|
|
|
|
|