diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/fib.nxs | 4 | ||||
-rw-r--r-- | doc/main.nxs | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/doc/fib.nxs b/doc/fib.nxs new file mode 100644 index 0000000..130f99d --- /dev/null +++ b/doc/fib.nxs @@ -0,0 +1,4 @@ +;; Author: Andrei S +(bind fib (lambda (x) ;; xth fib number +(if (< x 2) x (+ (fib (- x 1)) (fib (- x 2)))))) +(fib 7) diff --git a/doc/main.nxs b/doc/main.nxs index 274067c..212f098 100644 --- a/doc/main.nxs +++ b/doc/main.nxs @@ -1,5 +1,6 @@ + (bind factorial (lambda (n) (if (= n 0) 1 (* n (factorial (- n 1)))))) -(* (factorial 4) 24) +(+ (factorial 5) 10) "hello world!" |