Skip to content

Instantly share code, notes, and snippets.

@mahmoudhossam
Created January 31, 2013 13:07
Show Gist options
  • Save mahmoudhossam/4682727 to your computer and use it in GitHub Desktop.
Save mahmoudhossam/4682727 to your computer and use it in GitHub Desktop.
Pascal Triangle in scala.
def pascal(c: Int, r: Int): Int = {
if(c == 0 || c == r) 1 else pascal(c, r-1) + pascal(c-1, r-1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment