Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -1,8 +1,5 @@
(define (fibonacci n)
(let (a 0 b 1 c n i 2)
(while (<= i n)
(setq c (+ a b)
a b
b c)
(++ i))
c))
(let (L '(0 1))
(dotimes (i n)
(setq L (list (L 1) (apply + L))))
(L 1)) )

View file

@ -1,4 +1,4 @@
(define (fibonacci n)
(if (< n 2) 1
(+ (fibonacci (- n 1)) (fibonacci (- n 2)))))
(print(fibonacci 10)) ;;89
(+ (fibonacci (- n 1))
(fibonacci (- n 2)))))

View file

@ -0,0 +1,7 @@
(define (fibonacci n)
(letn (f '((0 1) (1 1)) fib f)
(dotimes (i n)
(set 'fib (multiply fib f)))
(fib 0 1)) )
(print(fibonacci 10)) ;;89