Im trying to make a program that generates all the verses of the song "The Twelve Days of Christmas" using recursion (its homework). Ive read what the book says several times, researched online, etc etc. Im not looking for anyone to do the homework for me...I just need some guidance. Im really lost on this and any help would be appreciated.
I cant use for loops or while loops.
I can only have lines from each verse appear only once in the code.
I'm surprised that ANY teacher would give you homework to do that uses recursion.
I recommend that you create a function that takes a counter from outside the function (it's irrelevant how you do this, so long as the counter isn't reset per recursion and you can increment it). Have a chain of if statements (depending on how you do this, it's critical that you use no else statements, do you see why?) that each print one verse, and one final if statement that if true calls the function from within itself (again, do you see why we need an if statement around the recursion bit?). I'll leave you to determine the conditions for the if chain. Hint: the last one should use a less than operator.