Comment on Why does the for loop repeat in this recursion?
milon@lemm.ee 10 months agoYes - I finally caught that part about n as it’s just moving in reverse so it gets decremented. Now I’m not sure about i. In the debugger when the program gets to the for loop both n and i are equal to 1. The n I understand but i?
dneaves@lemmy.world 10 months ago
i starts at 0, checks if i is less than n (the first time it will be, no matter what), prints a “#”, then increments i by 1 and loops