-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Fibonacci example and added functions to the default environment
- Loading branch information
mambo
committed
Jun 22, 2016
1 parent
cce235b
commit 8e5424b
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Suite de Fibonacci | ||
*/ | ||
|
||
// n-ième terme de la suite de Fibonacci | ||
(define fib (lambda (n) | ||
(if (< n 2) | ||
n | ||
(+ (fib (- n 1)) (fib (- n 2))) | ||
) | ||
)) | ||
|
||
// Suite de Fibonacci jusqu'au n-ième terme | ||
(define fibSeq (lambda (n) | ||
(map fib (range 0 n)) | ||
)) |