Comment on Why does the for loop repeat in this recursion?

<- View Parent
Merwyn@sh.itjust.works ⁨9⁩ ⁨months⁩ ago

Yes, as I wrote when the method draw(n=1) finish the for loop that print one “#”, this call of the method draw return. Then the process start again from the after the line draw(n-1) of the method draw(n=2), which execute the for loop to print “##” and return. Then again you come back to after the line draw(n-1) of inside the method draw(n=3), ect.

source
Sort:hotnewtop