nested for loops to recursion – c++


I have a function that I was able to get working the way I want it with triple nested for loops. If I can figure out how to translate that into a recursive function, then I think I will be on the right track, conceptually.

I’ve searched this site and the internet, but the issue I’m having is it being hard to follow some of these examples (usually due to variable naming, lack of comments – especially since I’m someone who likes to explicitly see where things are coming from. i.e., it trips me up when I see a random variable passed in that isn’t referenced anywhere else. I know that it’s probably from another part of their program they are working on, but ya know, it still makes it hard to follow if you aren’t there conceptually yet). I’ve seen some other examples, like factorials, and those are understandable. It’s when you have more possible paths that trips me up.

So, if anyone has any tips, examples, or what not, it would greatly be appreciated. Thanks!