What do you mean when you say "it doesn't work"? You have to be more specific than that.

Have you stepped through this with a debugger, or at least added some print statements, to figure out what's going on?

PS- I added highlight tags for you this time. Don't forget them in the future.

May 11th, 2011, 12:06 AM

courtenay

Re: Towers of Hanoi Algorithm Error once i get to 3 disks??

Thank you for your comments, I have managed to solve the issue in the meantime, it turns out I had messed up elsewhere in my Stack class. Instead of returning 0 when a stack was empty i had it returning a error which caused my if statements to fall over somehow.