<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Intrepid Blog &#187; fibonacci</title>
	<atom:link href="http://blog.affien.com/archives/tag/fibonacci/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 23 Jan 2012 08:47:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Code Golf 1: Fibonacci</title>
		<link>http://blog.affien.com/archives/2005/11/01/code-golf-1-fibonacci/</link>
		<comments>http://blog.affien.com/archives/2005/11/01/code-golf-1-fibonacci/#comments</comments>
		<pubDate>Tue, 01 Nov 2005 18:23:55 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Code Golf]]></category>
		<category><![CDATA[fibonacci]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/11/01/code-golf-1-fibonacci/</guid>
		<description><![CDATA[Code Golf.  As with the real sport the goal is to reduc [...]]]></description>
			<content:encoded><![CDATA[<p>Code Golf.  As with the real sport the goal is to reduce the number of strokes that it takes to complete a particular objective, although with Code Golf &#8220;strokes&#8221; refers to keystrokes rather than swings of a golf club.</p>
<p>You may compete using any language.<sup>1</sup></p>
<p><strong>Create an algorithm that prints the 30 first fibonacci number to the screen, each followed by a newline.</strong></p>
<p>An algorithm which could do this would be (148 bytes):</p>
<pre>my $a = 1;
my $b = 0;
my $c;

my $limit = 30;
my $i = 0;

while ($i &lt; $limit) {
        $i += 1;
        $c = $a + $b;
        $a = $b;
        $b = $c;
        print $c . "\n";
}</pre>
<p>But that can be written way shorter.</p>
<p><strong>My first</strong>: <br /> <br />
<code>$a=1;for((0..29)){$c=$a+$b;$a=$b;$b=$c;print"$c\n"}</code></p>
<p><strong>My second</strong>:<br />
<code>$a=1;$c=$a+$b,$a=$b,$b=$c,print"$c\n"for 0..29</code></p>
<p><strong>Noud&#8217;s reponse</strong>:<br />
<code>$i=1;print$i+=$a,"\n",$a+=$i,"\n"while$i&lt;317811</code></p>
<p><strong>My revenge</strong>:<br />
<code>$a=1;$c=$a+$b,$a=$b,$b=$c,print"$c\n"for 0..29</code></p>
<p><strong>Noud was 30 seconds later with</strong>:<br />
<code>$a=1;print$a+=$b,"\n",$b+=$a,"\n"for 1..15</code></p>
<p><strong>My latest one</strong>: <ins>partially by Bram too</ins><br />
<code>print$a+=$b,"\n",$b+=$a,"\n"for$a++..14</code></p>
<p><ins>Update:</ins><strong>Twan</strong>:<br />
<code>print$a+=$b,$/,$b+=$a,$/for$a++..14</code></p>
<p><small>1. a language that implements <code>fib</code> returning mysteriously the first 30 fibonacci numbers isn&#8217;t allowed.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/11/01/code-golf-1-fibonacci/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

