I thought I would write a lottery number generator since I have not had
luck winning the big jackpot - http://megamillions.com/. So far, after
1.2 million tries, I still have not hit all the numbers from yesterday:
17, 22, 32, 51, 35 (last one is the mega ball).
Fun little project that and I thought others would be interested. Let me
know if you have a cleaner implementation in mind.
while @a.length <=4
@a << rand(56)+1
@mega = rand(46)+1
@outPut = @a.sort.push(@mega).join(’, ')
ps. The next step is to calculate what my winnings would be based on
payout table - for non-jackpot winners.