sub han { if (my $l = pop) { han(@_[0,2,1],$l-1); print "Move disc $l from $_[0] to $_[2]\n"; han(@_[1,0,2],$l-1); } }
In reply to Re^2: Recursion: the Towers of Hanoi problem
by Jasper
in thread Recursion: The Towers of Hanoi problem
by DigitalKitty
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |