From: "Jan E." Date: 2012-07-30T17:49:26+09:00 Subject: Re: Help with exercise from Chris Pine's Ruby Book: Sort without using .sort Hi, Using a dummy object as a workaround and keeping it throughout the whole program is also not that pretty. Why not initialize the word with gets.chomp? This also allows you to get rid of the somewhat redundant "if word == ''": word = gets.chomp until word.empty? words.push word word = gets.chomp end And of course there are also one-liners for this. What I also would like to note: These low level sorting algorithms are certainly interesting and teach you a lot about general programming, but they have very little to do with "the Ruby way" of doing things. I mean, with all that "for" and "while" loops and counters, the code looks almost like good old BASIC. Ruby generally tries to avoid this low level stuff in favor of a more abstract, more "intelligent" approach (which is hardly possible in this case). Just so that you know that Ruby is not just some kind of prettified BASIC. ;-) -- Posted via http://www.ruby-forum.com/.