<?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[Fibonacci Fables]]></title><type><![CDATA[link]]></type><html><![CDATA[<header class="entry-header">
<h1 class="entry-title"></h1>
</header>
<div class="entry-content">
<p>The Fibonacci Sequence is a sequence of numbers where each number equals the sum of the two preceding numbers. Except, of course, for the second number in the series, because it only has one number preceding it. So we cheat a little at the start, putting two ones there to get the thing going.</p>
<p>This is a Plain English program that lists all the Fibonacci Numbers less than 1000:</p>
<p><span style="color:#00ccff;">To run:</span><br />
<span style="color:#00ccff;"> Start up.</span><br />
<span style="color:#00ccff;"> Put 1 into a first number. Write the first on the console.</span><br />
<span style="color:#00ccff;"> Put 1 into a second number. Write the second on the console.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Add the first to the second giving a third number.</span><br />
<span style="color:#00ccff;"> If the third is greater than 1000, break.</span><br />
<span style="color:#00ccff;"> Write the third on the console.</span><br />
<span style="color:#00ccff;"> Put the second into the first.</span><br />
<span style="color:#00ccff;"> Put the third into the second.</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>These are the numbers we get when we run that:</p>
<p><span style="color:#00ccff;">1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987</span></p>
<p>Now here’s a little program that does something interesting with the first few of those numbers:</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.</span><br />
<span style="color:#00ccff;"> Start in the middle of the screen facing south.</span><br />
<span style="color:#00ccff;"> Move 1-3/4 inches right and 1 inch down.</span><br />
<span style="color:#00ccff;"> Draw some fibonacci squares starting with 1/4 inch.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</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 some fibonacci squares starting with a length:</span><br />
<span style="color:#00ccff;"> Use the brown pen.</span><br />
<span style="color:#00ccff;"> Put the length into a first length. Draw a fibonacci square using the first length.</span><br />
<span style="color:#00ccff;"> Put the length into a second length. Draw the fibonacci square using the second length.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Add the first length to the second length giving a third length.</span><br />
<span style="color:#00ccff;"> Draw the fibonacci square using the third length.</span><br />
<span style="color:#00ccff;"> If the third length is greater than 4 inches, break.</span><br />
<span style="color:#00ccff;"> Put the second length into the first length.</span><br />
<span style="color:#00ccff;"> Put the third length into the second length.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p><span style="color:#00ccff;">To draw a fibonacci square given a length:</span><br />
<span style="color:#00ccff;"> Stroke the length. Turn left.</span><br />
<span style="color:#00ccff;"> Stroke the length. Turn left.</span><br />
<span style="color:#00ccff;"> Stroke the length. Turn left.</span><br />
<span style="color:#00ccff;"> Stroke the length. Turn left.</span><br />
<span style="color:#00ccff;"> Move the length. Turn left. Move the length.</span></p>
<p>The result on the screen looks like this:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-324680" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/finbonacci-squares-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>You can see that once we get rolling, each square mates with the two squares that came before it.</p>
<p>And with just two more routines, we can lay a Fibonacci Spiral on top of those Fibonacci Squares. Here are the additional routines:</p>
<p><span style="color:#00ccff;">To draw a fibonacci spiral starting with a length:</span><br />
<span style="color:#00ccff;"> Use the fat black pen.</span><br />
<span style="color:#00ccff;"> Put the length into a first length.</span><br />
<span style="color:#00ccff;"> Draw a quarter circle the first length times 2 wide (backwards).</span><br />
<span style="color:#00ccff;"> Put the length into a second length.</span><br />
<span style="color:#00ccff;"> Draw the quarter circle the second length times 2 wide (backwards).</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Add the first length to the second length giving a third length.</span><br />
<span style="color:#00ccff;"> Draw the quarter circle the third length times 2 wide (backwards).</span><br />
<span style="color:#00ccff;"> If the third length is greater than 4 inches, break.</span><br />
<span style="color:#00ccff;"> Put the second length into the first length.</span><br />
<span style="color:#00ccff;"> Put the third length into the second length.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p><span style="color:#00ccff;">To draw a quarter circle a width wide (backwards):</span><br />
<span style="color:#00ccff;"> Put the width times 355/113 divided by 96 into a segment length.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Turn left 1/96 of the way.</span><br />
<span style="color:#00ccff;"> Stroke the segment length.</span><br />
<span style="color:#00ccff;"> Add 1 to a count.</span><br />
<span style="color:#00ccff;"> If the count is 24, exit.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p>When we run that, the nifty result we get looks like this:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-324682" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/fibonacci-spiral-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>You probably noticed that I had to use an approximation for <em>pi </em>(355/113) because Plain English is a whole-number-only language. I wasn’t entirely happy with that, so I got into our built-in wysiwyg page editor to see if I could get to a Fibonacci Spiral without using <em>pi</em>, or an approximation of <em>pi</em>, at all. I started by drawing the Fibonacci Squares, by hand:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-324693" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/fibonacci-page-1-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>It was easy because our editor has a handy snap-to-grid feature. Then I colored that “grid” light blue and drew a simple polygon on top of it in black:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-324694" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/fibonacci-page-2-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Finally, I smoothed that polygon three times. Et voila! An almost-Fibonacci Spiral:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-324695" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/fibonacci-page-3-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>Our all-integer smoothing technique is described in another article I’ve posted on this blog.</p>
<p>I admit the two spirals aren’t <em>exactly </em>the same, but then neither are all the supposed Fibonacci Spirals in the real world. It is nearly (if not entirely) impossible, for example, to fit a Fibonacci Spiral to a real-life Nautilus shell. Check it out. Look closely at all those overlaid images on Google and you’ll see that the supposed correspondence is just one more mathemagical myth; a Fibonacci Fable, we might say.</p>
<p>But I don’t want to leave this article on a negative note, so let’s have a little fun with a simpler kind of spiral that is drawn with this routine:</p>
<p><span style="color:#00ccff;">To draw a spiral starting with some twips;</span><br />
<span style="color:#00ccff;"> To draw a spiral given a size:</span><br />
<span style="color:#00ccff;"> Privatize the size.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Draw a half circle given the size.</span><br />
<span style="color:#00ccff;"> Divide the size by 2.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 5, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span></p>
<p>But let’s not just draw one; let’s draw lot’s of ’em:</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.</span><br />
<span style="color:#00ccff;"> Start in the middle of the screen facing north.</span><br />
<span style="color:#00ccff;"> Move 2 inches left and 1 inch down.</span><br />
<span style="color:#00ccff;"> Loop.</span><br />
<span style="color:#00ccff;"> Use the brown pen. Use the fat pen.</span><br />
<span style="color:#00ccff;"> Draw a spiral starting with 6 inches.</span><br />
<span style="color:#00ccff;"> Turn 1/10 of the way around.</span><br />
<span style="color:#00ccff;"> Add 1 to a count. If the count is 5, break.</span><br />
<span style="color:#00ccff;"> Repeat.</span><br />
<span style="color:#00ccff;"> Refresh the screen.</span><br />
<span style="color:#00ccff;"> Wait for the escape key.</span><br />
<span style="color:#00ccff;"> Shut down.</span></p>
<p>Here’s the result:</p>
<p><img loading="lazy" class="alignnone size-large wp-image-325157" src="https://cdncontribute.geeksforgeeks.org/wp-content/uploads/non-fibonacci-spirals-2-1024x819.jpg" alt="" width="665" height="532" /></p>
<p>As Israel Kamakawiwo’ole used to sing, “What a Wonderful World!” It’s cool that we have the privilege, as Johannes Kepler put it, “of thinking God’s thoughts after Him.” Credit where credit is due. I suspect that when we finally figure out exactly what makes a Nautilus shell what it is, we’ll find it’s more like an algorithm than an equation.</p>
</div>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/cdncontribute.geeksforgeeks.org/wp-content/uploads/finbonacci-squares-1-1024x819.jpg?fit=440%2C330&ssl=1]]></thumbnail_url><thumbnail_width><![CDATA[413]]></thumbnail_width><thumbnail_height><![CDATA[330]]></thumbnail_height></oembed>