View Single Post
  #5   Spotlight this post!  
Unread 23-06-2008, 11:24
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Fibonacci Sequence

Python can do it in 1:

Code:
for z in range(N-1): print vars().setdefault('a',[1,1]) and a.append(a.pop(0)+a[0]) or a[0][0]
Stolen shamelessly from Bengt Richter. Put your term in place of N.

That being shown, this is the antithesis of the language and good coding practice. As one who has had to work with tools coded in Perl, all I will say is that obfuscation isn't nearly as cool as perlers think it is. I'd rather work with something written in a hundred lines of python than in 5 lines of perl.
Reply With Quote