#!/usr/bin/ruby

#
## http://rosettacode.org/wiki/Fibonacci_sequence
#

func fib_iter(n) {
    var fib = [1, 1];
    (n - fib.len).times {
        fib = [fib[-1], fib[-2] + fib[-1]]
    };
    return fib[-1];
}

say fib_iter(12);
