Created
May 2, 2017 22:58
Star
You must be signed in to star a gist
Pascal's Triangle Solution in Scheme Lisp
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
; Numering rows and indices starting at 1 | |
(define (cell-value row index) | |
(if (or (= row 1) | |
(= index 1) | |
(= index row)) | |
1 | |
(+ (cell-value (- row 1) (- index 1)) | |
(cell-value (- row 1) index)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment