From: Martin DeMello Date: 2008-07-28T15:09:23+09:00 Subject: Re: deaf grandma. On Sun, Jul 27, 2008 at 2:32 PM, houston barnett-gearhart wrote: > thank you, martin, for your reply. i took your advice & wrote an > algorithm & it's been helping me along quite well. but, i've a few > questions that arose while i was writing the program. before i get > started, here's the program thus far: http://pastie.org/242167. i > realize that the code is a mess & i probably did much more than was > necessary, but like i said, i'm fairly new to ruby, let alone > programming. by all means, please suggest how i could clean it up a bit. I looked at your code, and it looks like you're taking an inside-out approach to the problem; that is, you're concentrating on the little bits and then trying to fit them into some sort of overall structure. Particularly since you're learning to code, I'd strongly recommend leaving that code alone, and starting from scratch using a more top-down approach. Specifically, get the *structure* of your program correct first, then slowly fill in that structure to have all the features you need. Go back and check out the iterative approach I suggested in my last post, where you build up the code feature by feature starting with the basic question-answer-question-answer.... loop. After you've been at it a while, this will become second nature to you, and you'll be able to keep the structure of the program in your head and fill in details even before you have the whole skeleton mapped out, but that takes experience, and unnecessarily complicates matters at this stage. Also, when you come to chapter 8 in the tutorial you'll learn about methods, which are a powerful way to keep your program well-structured throughout its development. martin