I need help to create a fractal tree program

Hello I am a beginner in programming, and I would like to make a program that generates a tree fractal like this scratch program below https://scratch.mit.edu/projects/10070653/editor/
I first tried without help of internet but I did not succeed, either I had an infinite function, or I had a tree that a series of branch, in the end I said to myself that I was going to be inspired by a scratch program but these 2 languages resemble each other but only in appearance, I tried to translate the block with the pencil by using "drawline" and the block rotation by expressing in trigonometric form the coordinates (my program . aia program is available) and once again the application spits after a while probably because of a function that includes itself to infinity, if you can tell me what I should do or even redo the program, it would help me a lot.
PS: It's for a school project so I can't use JS, python or other.
Newgenerator.aia (10.6 KB)

This might help (although you would need to convert python to blocks....

1 Like

As I said I am a beginner in programming and I am having a difficult time figuring out from line 21 how to go back to the right place and continue the branches on the other side.Can you explain this to me in natural language or which app inventor blocks to use please.

At the core of any infinite fractal program, you need a Clock Timer and a list to act as a work queue for the frontier of your fractal growth.

Here is an example I had in stock, the Sierpinski Triangle, which builds a triangle by clipping off the upper corners of rectangles




Clock Timer:



Sierpinski.aia (5.2 KB)

1 Like

Thank you that helps me a lot, indeed I had forgotten the importance of Clock, I found this site there https://www.rosettacode.org/wiki/Fractal_tree, there are finally several different methods.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.