Program Tree2
-
This program draws repeating pictures by recursion.
-
The method draw() is recursively called
with a set of parametes specifying a tree branch,
Each call of this method is processed as follows.
-
If the lenght of the branch is not less than 1/3 of LeaveSize,
a branch is drawn.
-
If the lenght of the branch is less than LeaveSize
a leave is drawn.
-
If the current branch is not too small,
branch() is called recursively for the next left and right
branches of reduced sizes.
-
The sizes and orientations of branches are randomized.
Source Code of the Tree2 Program
(Graphical)
Back
Home