From: "Peña, Botp" Date: 2008-04-16T15:51:32+09:00 Subject: Re: Noob Questions [arrays] From: calderson [mailto:chadalderson@gmail.com] # alphalist = [''] # alphalist.each do |item| # puts 'type words one at a time and I will alphabetize them for you.' # alphalist.push gets.chomp you run gets here ^^^^ # if gets == '' and here ^^^ that will execute gets twice the gets == '' will never be true so the ff line is never run # puts alphalist.sort # end # end # # ... it prints a gets value twice, then starts again with "type words # one at a time and I will alphabetize them for you." # If i hit enter it just puts a blank line. how about trying something simple alphalist = [] loop do puts 'type words one at a time and I will sort them for you.' input = gets.strip exit if input.empty? puts "-----o-----" puts alphalist.push(input).sort end kind regards -botp