View Single Post
Old Mar 1st, 2008, 3:11 PM   #8
dimlyBright
Newbie
 
dimlyBright's Avatar
 
Join Date: Mar 2008
Posts: 10
Rep Power: 0 dimlyBright is on a distinguished road
Re: Patterned returns with Math.random()

I don't think I need a "truly random" generator. I am not looking to get thousands of unique sets just <=20. I am stuck with 11 unique sets now (not including the power ball)

let me describe my madness. The file src.zip is my program given in the original post. Imagine you selected a random number from a bin I will call 'a', looked at it and then returned it to 'a'. You wrote the number on a card and placed that card in a bin I will call 'b'. Again select randomly from bin 'a', write it on a card and return it. Now compare it to every card in 'b'. If it is the same as another card in 'b', destroy it and repeat the drawing process again from 'a'. Do this process over and over until you have numbers in 'b' equal to one less than the numbers in 'a'. Whatever number is missing from 'b' is the final product! That is the first lotto number you use in the selection process. for every number made this way you place it in an array and call a recursive algorithm to compare every new number to every preexisting element in the set. Do this five times with 'a' and 'b' and then a unique sixth number is made using numbers 1-42 from new sets 'c' and 'd' for the power ball number.

Why? WHY!? Well because I am resigned to believe that I will never select even one number that matches the lotto numbers so this way the numbers given are all numbers that were never selected! MWAHAHAHAHAHAAAA!!!!!

ahem... sorry. the program compiles and just requires an argument. If you fail to give an argument, fear not for it will ask for and input.
dimlyBright is offline   Reply With Quote