B
This commit is contained in:
parent
e5e8880e41
commit
518da4a923
1019 changed files with 15877 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
PRINT FNfib(10)
|
||||
END
|
||||
|
||||
DEF FNfib(n%) IF n%<0 THEN ERROR 100, "Must not be negative"
|
||||
LOCAL P% : P% = !384 + LEN$!384 + 4 : REM Function pointer
|
||||
(n%) IF n%<2 THEN = n% ELSE = FN(^P%)(n%-1) + FN(^P%)(n%-2)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
( (
|
||||
=
|
||||
. !arg:#:~<0
|
||||
& ( (=.!arg$!arg)
|
||||
$ (
|
||||
=
|
||||
.
|
||||
' (
|
||||
. !arg:<2
|
||||
| (($arg)$($arg))$(!arg+-2)
|
||||
+ (($arg)$($arg))$(!arg+-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
$ !arg
|
||||
)
|
||||
$ 30
|
||||
)
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
( /(
|
||||
' ( x
|
||||
. $x:#:~<0
|
||||
& ( /('(f.($f)$($f)))
|
||||
$ /(
|
||||
' ( r
|
||||
. /(
|
||||
' ( n
|
||||
. $n:<2
|
||||
| (($r)$($r))$($n+-2)
|
||||
+ (($r)$($r))$($n+-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
$ ($x)
|
||||
)
|
||||
)
|
||||
$ 30
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue