annotate samples/fib.tp @ 253:697c2c562af2

Fix infinite loop in hash dict
author Michael Pavone <pavone@retrodev.com>
date Sat, 31 May 2014 21:27:03 -0700
parents 3a169ebb3224
children
rev   line source
pavone@10 1 #{
pavone@10 2 fib <- :n {
pavone@10 3 if: n < 2 {
pavone@10 4 1
pavone@10 5 } else: {
pavone@10 6 (fib: n-1) + (fib: n-2)
pavone@10 7 }
pavone@10 8 }
pavone@10 9
pavone@10 10 main <- {
pavone@44 11 print: (string: (fib: 30)) . "\n"
pavone@10 12 }
pavone@10 13
pavone@10 14 }