#!/usr/local/bin/ruby # -*- mode: ruby -*- # $Id: fibo.ruby,v 1.2 2003/12/30 01:25:05 davidw Exp $ # http://www.bagley.org/~doug/shootout/ # END COMMENT def fib(n) if n < 2 then 1 else fib(n-2) + fib(n-1) end end N = Integer(ARGV.shift || 1) puts fib(N)