From: Daniel Waite Date: 2007-05-12T03:53:51+09:00 Subject: Re: Object-oriented solution to Tower of Hanoi darren kirby wrote: > Very interesting. I find myself in exactly the same boat. I fell into my > love of computers/programming late in life (ie: after college), and I also > have a very weak background in math. I have found it had held me back a great > deal. Everytime I try to improve my math skills, I find myself having to > backtrack more and more because I am coming across concepts I just don't > understand until I find myself all the way back at the high school > level. Yup, I feel you there. I've got a geometry book at home waiting eagerly awaiting to be cracked open. > You can see this manifested in all my submissions to the Ruby Quiz, > which always run waaaaaaaay slower than everyone else's ;) At least you're submitting to Ruby Quiz! I tried a few of them and they're pretty tough. So good work! Robert Klemme wrote: > While it is certainly a good thing to improve your knowledge of algebra, > I suggest you also read a decent book on data structures and algorithms > (Knut, Sedgewick or the like). It's not so much mathematics you will > learn from them but to analyze problems and find proper algorithms and > data structures. You'll learn why it is more efficient to use a Hash > for lookups than traversing an array with key value pairs. Things like > that. Hope that helps. Actually, that does help. A lot. Thanks Robert. I shall seek and find on Amazon, and into my wish list shall those books go. Thanks for the (extensive) response Mark, I appreciate it. Yes, you're absolutely right about understanding the nature of the problem before trying to solve it. I think I do a pretty good job of that -- I just have to remind myself that, eventually, I have to stop pondering and start writing. I started laughing when I read your comment about my Hand object. My first iteration didn't have the Hand object, and it worked fine, but I knew I wanted to include it before I started the project, so in it went. It makes more sense to me that way. I've always been into writing (fiction, mostly) and I gather my brain just "works that way," whereby stories make more sense than numbers. I think I score okay on your first two skills for the ToH, but the third, recursion, has always been difficult for me, except when it's not. I understand iteration and nested iterations and when and how to use them, but I trip up when a method calls itself repeatedly. Anywho, thanks for the awesome replies everyone -- you guys are great! :) - Daniel -- Posted via http://www.ruby-forum.com/.