B
Bruce Wayner
Hi, I'm only a newbie on ruby could someone help me with my code:
Here's: I'm writing a program which will ask the user to input a word or
typed goodbye to quit the program. The first part is done the problems
is that how can i find the longest word?
example:
Type a word (or goodbye to quit): Hello
Type a word (or goodbye to quit): Hello Hello
Type a word (or goodbye to quit): goodbye
The longest word is “Hello Helloâ€
can someone help me with my simple program?
Code:
loop do
puts "Type a word ( or goodbye to quit):"
$_ = gets.chomp
break if $_ == "goodbye"
end
Attachments:
http://www.ruby-forum.com/attachment/4923/test.rb
Here's: I'm writing a program which will ask the user to input a word or
typed goodbye to quit the program. The first part is done the problems
is that how can i find the longest word?
example:
Type a word (or goodbye to quit): Hello
Type a word (or goodbye to quit): Hello Hello
Type a word (or goodbye to quit): goodbye
The longest word is “Hello Helloâ€
can someone help me with my simple program?
Code:
loop do
puts "Type a word ( or goodbye to quit):"
$_ = gets.chomp
break if $_ == "goodbye"
end
Attachments:
http://www.ruby-forum.com/attachment/4923/test.rb