From: Phrogz Date: 2007-05-16T01:40:05+09:00 Subject: Re: Object-oriented solution to Tower of Hanoi On May 10, 6:34 pm, Daniel Waite wrote: > Anyway, here's my (long) object-oriented version of the ToH. Tell me > what you think. Oh, and if you have suggestions on where someone NOT > interested in going to college can do to learn the math necessary to > start programming "for real," please share! Thanks! Many days later, I finally wrote up my own version of ToH (without looking at anyone else's code). Thought I'd share it just for fun: http://pastie.caboo.se/61781 The move_stack method could be made a little cleaner by checking for num_rings > 0 (since lines 44 and 47 are the same, and the 46 and 48 are just recursive calls)...but for some reason I prefer this slightly- less-dry version. It just matches my mental model of the solution better.