3 # Ack by Leopold Toetsch
4 # Fib and Tak by Joshua Isom
5 # modified default value to n=3. Karl Forner
12 unless argc == 2 goto argsok
17 $P0.'recursion_limit'(100000)
20 array = new .FixedFloatArray
40 $I0 = TakInt($I0, $I1, n)
46 $N0 = TakNum(3.0, 2.0, 1.0)
49 $S0 = sprintf <<"END", array
54 Tak(3.0,2.0,1.0): %.1f
79 unless n < 2 goto endif
93 unless n < 2 goto endif
109 unless y >= x goto endif
114 $N0 = TakNum(tmp, y, z)
116 $N1 = TakNum(tmp, z, x)
118 $N2 = TakNum(tmp, x, y)
119 .return TakNum($N0, $N1, $N2)
126 unless y >= x goto endif
131 $I0 = TakInt(tmp, y, z)
133 $I1 = TakInt(tmp, z, x)
135 $I2 = TakInt(tmp, x, y)
136 .return TakInt($I0, $I1, $I2)
144 # vim: expandtab shiftwidth=4: