Revolucent icon

nacci.hoon

Revolucent | PRO | 04/13/21 01:56:45 AM UTC (Edited) | 0 ⭐ | 857 👁️ | Never ⏰ | []
text |

500 B

|

None

|

0 👍

/

0 👎

:: nacho.hoon
:: Nacci in Hoon
:: The first 1,000 Tribaonacci numbers:
:: +nacci 1.000, ~[0 0 1]
 !:
:-  %say
|=  [* [end=@ud ~] [fibs=(list @ud) limit=@f ~]]
:-  %noun
=/  count  (lent fibs)
=.  fibs   (flop fibs)
|^
     ?:  =(0 (lent fibs))
        $(fibs ~[1 0])
    ?:  should-exit
        (flop fibs)
    $(fibs (weld ~[n] fibs))
     ++  n  (reel (scag count fibs) add)
     ++  should-exit
        ?:  limit
            (gte (lent fibs) end)
        (gth n end)
 --
 

Comments