[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [SOLUTION] Ruby Quiz #14 LCD Numbers

email55555 email55555

1/9/2005 2:44:00 PM

OK, Thank you for your suggestion.
I would like replace my program last 3 lines by:

key, size = ARGV.slice!(ARGV.index('-s'), 2) if ARGV.include?('-s')
if ARGV.empty? || /^\d+$/ !~ ARGV.first
puts "Usage: #$0 [-s size] number"
else
LCD.new(ARGV.first, size).each_line { |line| puts line }
end

I think it should be better in this way.

Enjoy!