Skip to content

Instantly share code, notes, and snippets.

@jithusunny
Created September 26, 2011 06:28
Show Gist options
  • Save jithusunny/1241715 to your computer and use it in GitHub Desktop.
Save jithusunny/1241715 to your computer and use it in GitHub Desktop.
Pascal lisp
(defun element_at (row position)
"Finds out the position'th element in the row'th row in Pascal's triangle"
(if (or (= position 0) (= row position))
1
(+ (element_at (- row 1) (- position 1)) (element_at (- row 1) position))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment