#!/usr/local/bin/tclsh # $Id: fibo.tcl,v 1.4 2000/12/30 17:35:51 doug Exp $ # http://www.bagley.org/~doug/shootout/ # with help from: Kristoffer Lawson proc fib {n} { if {$n < 2} { return 1 } else { return [expr {[fib [expr {$n-2}]] + [fib [expr {$n-1}]]}] } } set N [lindex $argv 0] if {$N < 1} { set N 1 } puts [fib $N]