Skip to content

Instantly share code, notes, and snippets.

@TakashiNakagawa
Created November 6, 2012 23:10
Show Gist options
  • Save TakashiNakagawa/4028329 to your computer and use it in GitHub Desktop.
Save TakashiNakagawa/4028329 to your computer and use it in GitHub Desktop.
;1.12 pascal's triangle
(define (func n m)
(cond ((= n 1) 1)
((= m 1) (func (- n 1) m))
((= m n) (func (- n 1) (- m 1)))
(else (+ (func (- n 1) (- m 1) ) (func (- n 1) m)))))
(print (func 5 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment