repo.or.cz
/
jruby.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix for JRUBY-2882. Handle error messages related to constructors better
[jruby.git]
/
bench
/
shootout
/
fibo.ruby
blob
c0d56ea9fc5c7d9b141e4bf415614fc91bb84cfb
1
#!/usr/bin/ruby
2
# -*- mode: ruby -*-
3
# $Id: fibo.ruby,v 1.3 2005-04-25 19:01:38 igouy-guest Exp $
4
# http://www.bagley.org/~doug/shootout/
5
6
def
fib
(
n
)
7
if
n
<
2
then
8
1
9
else
10
fib
(
n-2
) +
fib
(
n-1
)
11
end
12
end
13
14
N
=
Integer
(
ARGV
.
shift
||
1
)
15
puts
fib
(
N
)