Skip to content

Instantly share code, notes, and snippets.

@joshthecoder
Created March 10, 2010 03:06
Show Gist options
  • Save joshthecoder/327472 to your computer and use it in GitHub Desktop.
Save joshthecoder/327472 to your computer and use it in GitHub Desktop.
factorial: func(n: Int) -> Double {
result: Double = 1
while(n != 0) {
result *= n
n -= 1
}
return result
}
main: func {
factorial(42) toString() println()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment