Skip to content
Turbo Scratch
Fractal Tree

Fractal Tree

by johnm

  • 👁 9,395
  • ❤️ 347
  • ⭐ 265
  • 🔄 70
  • Created: Feb 1, 2012
  • Last modified: Feb 1, 2012
  • Shared:

Description

This uses the new "Make a Block" feature to draw a tree-like picture. If you were going to tell someone to draw the simplest possible tree, you might say: to draw a tree: draw a straight trunk draw a branch to the left draw a branch to the right But wait! The branches themselves branch, so they actually just a smaller trees. So you could say: to draw a tree: draw a straight trunk draw a smaller tree to the left draw a smaller tree to the right That's how this program works. The parameter "h" determines the size ("height") of the tree, and each time it draws a branch it makes "h" be little smaller. To make it prettier, I also made it change color each time it branches. But hold on -- won't this program keep making smaller and smaller trees forever? That's what the "if" is for -- to make sure that it stops when the branches get too small.

Project Details

Visibility
Visible
Comments
Enabled