ELI5: Explain Like I'm 5

Course-of-values recursion

Okay kiddo, do you remember what recursion is? It's when a function calls itself over and over again until it reaches a stopping point. Well, course-of-values recursion is when a function that is recursive depends not just on its previous output, but also on all its previous inputs.

Let's pretend you are building a tower with blocks, and each block has a different weight. You want to make sure the tower stays balanced as you add more blocks, so you need to keep track of the total weight of the tower. To do this, you use course-of-values recursion.

Each time you add a new block, you not only add it to the tower, but you also update the total weight of the tower by adding the weight of the new block to the previous total weight. So even though you are still using recursion, you are also keeping track of all the previous weights to make sure the tower stays balanced.

Does that make sense, kiddo?