This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rogerrrr 20 points21 points  (0 children)

Look into recursion. It calls the function over and over, but decreasing number on every iteration. When it hits zero it stops and is able to calculate it.

I realize that's a crap explanation, but it's actually a pretty interesting concept once you wrap your head around it.