Annotation of 43BSD/contrib/icon/port/pret2.icn, revision 1.1.1.1

1.1       root        1: #  This program tests lib/pret.s.
                      2: 
                      3: procedure main()
                      4:    write(fib(10))
                      5:    write(fib(20))
                      6: end
                      7: 
                      8: procedure fib(i)
                      9:    static fibmem
                     10:    local j
                     11:    initial {
                     12:       fibmem := table()
                     13:       fibmem[1] := fibmem[2] := 1
                     14:       }
                     15:    if j := \fibmem[i] then return j
                     16:    else return fibmem[i] := fib(i - 1) + fib(i - 2)
                     17: end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.