Skip to content

Instantly share code, notes, and snippets.

Created March 28, 2013 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5267731 to your computer and use it in GitHub Desktop.
Save anonymous/5267731 to your computer and use it in GitHub Desktop.
what a spew this is
def pascal(c: Int, r: Int): Int = {
if (r < 1 || c < 1 || (c == r)) 1 // handles top of the triangle, and the sides
else pascal(c - 1, r - 1) + pascal(c, r - 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment