<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[The Osmosian Order of Plain English Programmers Welcomes You]]></provider_name><provider_url><![CDATA[http://osmosianplainenglishprogramming.blog]]></provider_url><author_name><![CDATA[gerryrzeppa]]></author_name><author_url><![CDATA[https://osmosianplainenglishprogramming.blog/author/gerryrzeppa/]]></author_url><title><![CDATA[Fractal Forests]]></title><type><![CDATA[link]]></type><html><![CDATA[<header class="entry-header">
<h1 class="entry-title"></h1>
</header>
<div class="entry-content">
<p>A fractal is a shape made up of progressively smaller versions of the same shape. A simple tree, for example, can be drawn by connecting progressively smaller “Y” shapes to each other, like so:</p>
<p><img loading="lazy" class="alignnone size-full wp-image-313254" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/simple-tree.jpg" alt="" width="786" height="273" /></p>
<p>Real life trees, however, are rarely so regular. To make a more realistic tree, we need to vary the width and length of the branches. And the angles between the branches, as well. It also helps if we color the lines representing the trunk and branches brown, and the smaller lines that represent the leaves in greenish hues. Here are some Plain English sentences that do the job:</p>
<p><span style="color:#00ccff;">To draw a forest tree given a size:</span><br />
<span style="color:#00ccff;"> If the size is less than 1/32 inch, exit.</span><br />
<span style="color:#00ccff;"> Put the size divided by 1/4 inch into the pen size.</span><br />
<span style="color:#00ccff;"> If the size is less than 1/4 inch, pick a greenish color.</span><br />
<span style="color:#00ccff;"> Remember where we are.</span><br />
<span style="color:#00ccff;"> Pick a number between 1 and 3.</span><br />
<span style="color:#00ccff;"> Draw a line using the size divided by the number for the length.</span><br />
<span style="color:#00ccff;"> Pick a ratio between 1/32 and 1/24.</span><br />
<span style="color:#00ccff;"> Turn left the ratio. Draw another forest tree given the size times 2/3. Turn right the ratio.</span><br />
<span style="color:#00ccff;"> Turn right the ratio. Draw a third forest tree given the size times 2/3. Turn left the ratio.</span><br />
<span style="color:#00ccff;"> Go back to where we were.</span></p>
<p>When we run the above routine, we get something along these lines (pun intended):</p>
<p><img loading="lazy" class="alignnone size-full wp-image-313269" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/tree-1.jpg" alt="" width="430" height="532" /></p>
<p>And if we add a little housekeeping and a loop, like this…</p>
<p><span style="color:#00ccff;">To run:</span><br />
<span style="color:#00ccff;"> Start up.</span><br />
<span style="color:#00ccff;"> Draw a fractal forest.</span><br />
<span style="color:#00ccff;"> Wait for the escape key.</span><br />
<span style="color:#00ccff;"> Shut down.</span></p>
<p><span style="color:#00ccff;">To draw a fractal forest:</span><br />
<span style="color:#00ccff;"> Erase the screen using the tan color.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Start within 3 inches of the screen&#8217;s bottom line.</span><br />
<span style="color:#00ccff;"> Pick a size between 3 and 6 inches.</span><br />
<span style="color:#00ccff;"> Pick a brownish color.</span><br />
<span style="color:#00ccff;"> Draw a forest tree with the size.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 32, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</span></p>
<p>…we can draw a whole forest, like this one:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-313274" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/forest-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Ta da!</p>
</div>
]]></html><thumbnail_url><![CDATA[https://i1.wp.com/cdncontribute.geeksforgeeks.org/wp-content/uploads/simple-tree.jpg?fit=440%2C330&ssl=1]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[153]]></thumbnail_height></oembed>