S
Scott Andrechek
I'm trying to make a program that gets you to input words and when you
press enter with nothing typed it sorts them alphabetically. My code
right now is:
words=[]
while words!=''
words.push gets
end
if words==''
words.sort
end
It runs and asks for words. I assume that it is pushing them into the
array but it isn't stopping and sorting them when there is nothing
inputted by the user. Hope I gave enough information.
As always thanks in advance,
Scott Andrechek
press enter with nothing typed it sorts them alphabetically. My code
right now is:
words=[]
while words!=''
words.push gets
end
if words==''
words.sort
end
It runs and asks for words. I assume that it is pushing them into the
array but it isn't stopping and sorting them when there is nothing
inputted by the user. Hope I gave enough information.
As always thanks in advance,
Scott Andrechek