<?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[Sierpinski &amp; Koch]]></title><type><![CDATA[link]]></type><html><![CDATA[<header class="entry-header">
<h1 class="entry-title"></h1>
</header>
<div class="entry-content">
<p>Two of the most famous fractals are the Sierpinski Triangle and the Koch Snowflake.</p>
<p><strong>A Sierpinski Triangle in Plain English</strong></p>
<p>This is a Plain English description of how to draw a Sierpinski Triangle:</p>
<p><span style="color:#00ccff;">To draw a Sierpinski Triangle starting with a size:</span><br />
<span style="color:#00ccff;"> If the size is less than 1/8 inch, exit.</span><br />
<span style="color:#00ccff;"> Draw another Sierpinski Triangle starting with the size divided by 2.</span><br />
<span style="color:#00ccff;"> Draw a line using the size for the length.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</span><br />
<span style="color:#00ccff;"> Turn right 1/3 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 3, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p>If we call the above routine from this top-level routine…</p>
<p><span style="color:#00ccff;">To run:</span><br />
<span style="color:#00ccff;"> Start up.</span><br />
<span style="color:#00ccff;"> Clear the screen with the tan color. Use the dark brown pen.</span><br />
<span style="color:#00ccff;"> Start 4 inches to the left and 3-1/2 inches down from the screen&#8217;s center.</span><br />
<span style="color:#00ccff;"> Turn right 1/12 of the way around.</span><br />
<span style="color:#00ccff;"> Draw a Sierpinski Triangle starting with 8 inches.</span><br />
<span style="color:#00ccff;"> Wait for the escape key.</span><br />
<span style="color:#00ccff;"> Shut down.</span></p>
<p>…this is what we get on the screen:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-334311" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/sierpinski-triangle-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Triangles within triangles within triangles. Nifty.</p>
<p><strong>A Koch Snowflake in Plain English</strong></p>
<p>Now these are the Plain English routines we need to draw a Koch Snowflake:</p>
<p><span style="color:#00ccff;">To draw a Koch Snowflake given a size and a depth:</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Draw a Koch Curve with 3 inches and the depth.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</span><br />
<span style="color:#00ccff;"> Turn left 1/3 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 3, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p><span style="color:#00ccff;">To draw a Koch Curve given a size and a depth:</span><br />
<span style="color:#00ccff;"> If the depth is 0, draw a line using the size for the length; exit.</span><br />
<span style="color:#00ccff;"> Put the size divided by 3 into a new size.</span><br />
<span style="color:#00ccff;"> Draw the Koch Curve given the new size and the depth minus 1.</span><br />
<span style="color:#00ccff;"> Turn right 1/6 of the way.</span><br />
<span style="color:#00ccff;"> Draw a second Koch Curve given the new size and the depth minus 1.</span><br />
<span style="color:#00ccff;"> Turn left 2/6 of the way.</span><br />
<span style="color:#00ccff;"> Draw a third Koch Curve given the new size and the depth minus 1.</span><br />
<span style="color:#00ccff;"> Turn right 1/6 of the way.</span><br />
<span style="color:#00ccff;"> Draw a fourth Koch Curve given the new size and the depth minus 1.</span></p>
<p>If we position ourselves properly on the screen and call the first routine above four times, increasing the depth by one each time, we get this on the screen:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-334373" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/koch-snowflake-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>1. At the top-left, we see that our snowflake, at depth zero, is just a simple triangle.</p>
<p>2. At the top-right, one level deeper, we see that each of the sides of the triangle has been divided into three parts, the middle part being replaced with a “peak”.</p>
<p>3. Continuing clockwise around the screen, at the bottom-right, we see that at the next level down, each of the sides of preceding figure is again divided into thirds, with the middle third being replaced by a peak of the appropriate size.</p>
<p>4. Finally, at the bottom-left, yet another level down, we see the finished snowflake. I say “finished” even though we could go deeper and deeper if our screen had the resolution to display it clearly.</p>
<p><strong>A Koch Triangle in Plain English</strong></p>
<p>Something curious happens if, when we’re drawing a Koch Snowflake, we turn right instead of left at each of the original vertices (the revised routine is shown below, with the modified word in all uppercase letters).</p>
<p><span style="color:#00ccff;">To draw a Koch Snowflake given a size and a depth:</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Draw a Koch Curve with 3 inches and the depth.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</span><br />
<span style="color:#00ccff;"> Turn RIGHT 1/3 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 3, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p>The result is an “inside-out” snowflake, or what I call, a Koch Triangle:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-334392" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/koch-triangle-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Comparing the top-right figure with the finished bottom-left figure, perhaps a better name would be “The Mitsubishi Logo on Steroids.”</p>
<p>Another curious thing happens when we tile some Koch Snowflakes; we get the flakes and the triangle together. Here’s the main routine…</p>
<p><span style="color:#00ccff;">To run:</span><br />
<span style="color:#00ccff;"> Start up.</span><br />
<span style="color:#00ccff;"> Clear the screen with the tan color. Use the dark brown pen.</span><br />
<span style="color:#00ccff;"> Turn right 7/12 of the way around. Move up 1/2 inch.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Draw a Koch Snowflake given 4 inches and 3.</span><br />
<span style="color:#00ccff;"> Turn right 1/3 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 3, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span><br />
<span style="color:#00ccff;"> Wait for the escape key.</span><br />
<span style="color:#00ccff;"> Shut down.</span></p>
<p>…and here’s the result:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-334458" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/koch-tiles-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>We can get other interesting results if we base our snowflakes on, say, a hexagon rather than a triangle. Here’s a main routine that does that (by turning 1/6 instead of 1/3 of the way around), with some tiling as well:</p>
<p><span style="color:#00ccff;">To run:</span><br />
<span style="color:#00ccff;"> Start up.</span><br />
<span style="color:#00ccff;"> Clear the screen with the tan color. Use the dark brown pen.</span><br />
<span style="color:#00ccff;"> Turn right 7/12 of the way around.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Draw a Koch Snowflake given 3 inches and 3.</span><br />
<span style="color:#00ccff;"> Turn right 1/6 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 6, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span><br />
<span style="color:#00ccff;"> Wait for the escape key.</span><br />
<span style="color:#00ccff;"> Shut down.</span></p>
<p>And here’s what the screen looks like when we run that:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-334470" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/koch-tiles-2-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Well, I could go on all day with this kind of thing, but I’m sure you get the idea. More fun and interesting programs written entirely in Plain English.</p>
</div>
]]></html><thumbnail_url><![CDATA[https://i2.wp.com/cdncontribute.geeksforgeeks.org/wp-content/uploads/sierpinski-triangle-1024x819.jpg?fit=440%2C330&ssl=1]]></thumbnail_url><thumbnail_width><![CDATA[413]]></thumbnail_width><thumbnail_height><![CDATA[330]]></thumbnail_height></oembed>