Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
well that's easy, the last 2 statements get executed when the algorithm is "rolling back" the loop. I mean: the last time the first movedisks statement is executed in the loop, it will start executing the last 2 statements from back to front (read: go over the loop from back to front)... that's what recursion is all about ;-) -- to ask a question is a moment of shame to remain ignorant is a lifelong shame In reply to Re^2: Recursion: the Towers of Hanoi problem
by insaniac
|
|