I am not sure if your comment: “that was helpful” was meant to be
sarcastic
or if you really found the link helpful.
However, if you if you still needs help, see below:
I am no Ruby expert but I re-arranged your code and it works:
def arange
arr = []
word = gets.chomp
while word != “”
arr << word
word = gets.chomp
end
puts arr.sort.join(’, ')
end
arange
ruby mypgm.rb
orange
banana
Apple
Banana
Cherries
mango
Apple, Banana, Cherries, banana, mango, orange
IM CONFUSED WITH THAT!!! any body can give me a little hint on how to
start?
thx