summaryrefslogtreecommitdiff
path: root/sample/fib.scm
blob: 5c2b86e656cd50b846f7f72d479cd7d056a04e00 (plain)
1
2
3
4
5
6
7
8
(define (fib n)
  (if (< n 2)
      n
      (+ (fib (- n 2)) (fib (- n 1)))))

(display (fib 20))
(newline)