Subject: Re: ruby beats them all
From: "Andrew Backer" <awbacker gmail.com>
Date: Thu, 15 Dec 2005 15:42:40 +0900
References: 170676170699170736
In-reply-to: 170736
def calc_iterative(n)
a = [0,1,0]
for i in 2..n
a[k] = a[k-1] + a[k-2]
end
return a[n%3]
end
I like this one, since it uses array wrapping. So many ways to write
it that are all *slightly* different... But this was to show someone,
so :)