urbit/try/bin/fib.hoon

10 lines
146 B
Plaintext
Raw Normal View History

2013-09-29 00:21:18 +04:00
!:
:: /=try=/bin/fib/hoon
2013-09-29 00:21:18 +04:00
::
|= *
|= [num=@ud ~]
:_ ~ :_ ~
:- %$
!> %. num
|=(x=@ ?:((lth x 2) 1 (add $(x (dec x)) $(x (sub x 2)))))