Help

okay, so in the book im reading it wanted me to do 2 things

  1. wanted me to make a method for sorting a list of words

this is what i got now

def arange
arr = []
puts arr.sort.join(’, ')
word = gets.chomp
while word != “”
arr << word
word = gets.chomp
end
end

arange

why isnt it working?

  1. It wants me to make and “old school roman numerals” thing

so if i put a number it, it would return it in roman numerals, but NOT
subtraction
so like 4 would be IIII , not IV

IM CONFUSED WITH THAT!!! any body can give me a little hint on how to
start?
thx

On Thu, Aug 21, 2008 at 7:27 AM, Daniel K. [email protected]
wrote:

IM CONFUSED WITH THAT!!! any body can give me a little hint on how to start?

start here http://pine.fm/LearnToProgram/

botp wrote:

On Thu, Aug 21, 2008 at 7:27 AM, Daniel K. [email protected]
wrote:

IM CONFUSED WITH THAT!!! any body can give me a little hint on how to start?

start here http://pine.fm/LearnToProgram/

that was helpful

On Wed, Aug 20, 2008 at 7:27 PM, Daniel K. [email protected]
wrote:

puts arr.sort.join(', ')

Daniel,

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

Posted via http://www.ruby-forum.com/.

For your second question I also find it confusing. But you can find many
examples on the web, google, about playing with roman numerals.