Skip to content

Instantly share code, notes, and snippets.

@ara-ta3
Created September 21, 2014 08:27
Show Gist options
  • Save ara-ta3/e4460577c2ab0ae6e91b to your computer and use it in GitHub Desktop.
Save ara-ta3/e4460577c2ab0ae6e91b to your computer and use it in GitHub Desktop.
schemeで遊ぼうと思った
(define (fib n)
(if (> n 0)
(+ (fib (- n 1)) (fib (- n 2)))
1
))
(print (fib 5) )
(print (fib 1) )
(print (fib 2) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment