IHG FEDCBA
IHG FEDCBA
IHG FEDCBA
Here's the code that I typed out at first which works but I did get a warning message within Aptana Studio...
print "Type any sentence: " sent = gets.chomp print "Type a whole number: " num = gets.chomp.to_i puts "here are your sentences backwards times the number you keyed in..." puts (sent.reverse + "\n") * num
The warning message was...
(...) interpreted as grouped expression
After doing a google search, I came across a post that read...
"...This warning is emitted when Ruby thinks that you want an argument list but wrote a grouped expression instead. The most common cause is whitespace between the name of the message and the argument list in a message..."
...which made a lot of sense. I don't like warnings in anything I'm coding out so I changed the code on line 7 to read...
After the change was made, the warning in Aptana went away.
(...) interpreted as grouped expression
After doing a google search, I came across a post that read...
"...This warning is emitted when Ruby thinks that you want an argument list but wrote a grouped expression instead. The most common cause is whitespace between the name of the message and the argument list in a message..."
...which made a lot of sense. I don't like warnings in anything I'm coding out so I changed the code on line 7 to read...
puts "#{sent.reverse}\n" * num
After the change was made, the warning in Aptana went away.
No comments:
Post a Comment