Lotto checking script
Feb 12
2008
2008
Comments Off
The idea comes from http://www.waider.ie/hacks/workshop/perl/lotto.pl script.
Should I be so wasteful? No:
irb
my_numbers = [1,2,3,4,5,6] winning_numbers = [1,2,3,41,42,43] result = 6 - (winning_numbers - my_numbers).size puts "#{result} " + if not result.eql? 0 "hits" else "hit" end