From: Jeff Patterson Date: 2008-03-25T04:22:31+09:00 Subject: Re: Beginner's question Good job. One thought though, as you are learning to program always keep in mind what is actually happening as your code is executed with an eye towards minimizing decision points, each of which which take time. For example, in your loop each time through two checks are made in a row: while bottles != 0 if bottles != 1 If instead you did: while bottles != 1 non-special code goes here.. bottles=bottles -1 end # note bottles = 1 here #print out special case verse See how we've eliminated the unnecessary decision point? Such optimizations are especially important inside loops where the interior code gets executed over and over. Cheers Jeff -- Posted via http://www.ruby-forum.com/.