(Jan-07-2017, 04:18 AM)ichabod801 Wrote: First of all, I think it would be much better to rewrite this as a loop rather than recursion.
Second, the reason it doesn't return anything if it recuses is that you don't return anything from the recursive call. Instead ofhey_pc()
, you wantreturn hey_pc()
. That way the return value of one will be passed up the recursion chain to the initial call at the bottom of the program.
Thanks for the reply. I will test out your suggestion.
As for your loop suggestion, are you suggesting a WHILE loop? I will think about it see if I can come up with something.
Edit: Thanks seems to be working once I replace the two hey_pc to return hey_pc. I will play around with it some more.