I made a powerball program that do the numbers. No duplicates. I tried to copy the whole program in here wit the quicksor, printout, time stamp files and the whole nine yards but was to big to fit. If you want it, send me an e-mail and I will send you the file.
[email protected]. Works great by the way. Have won a couple of times. Pure luck. Ha Ha. Here is the randomizing part of it with no duplicates generated.
void CreateRandom(void)
{
/* Setup a random seed number from computer time */
srand(time(NULL));
/* Get random number */
do {
uiSame = 0;
/* Fill buffer with random numbers between 1 and 59 */
for (uiCnt = 0; uiCnt < 5; uiCnt++) {
uiBufNumber[uiCnt] = (1 + rand()) % 60;
}
/* Test for any numbers are the same. Redo if numbers are the same. */
for (uiCntA = 4; uiCntA > 0; uiCntA--) {
for (uiCnt = 0; uiCnt < uiCntA; uiCnt++) {
if (uiBufNumber[uiCnt] == uiBufNumber[uiCntA]) {
uiSame = 1;
}
}
}
} while (uiSame != 0);
}
I don't know why it don't do the indent. They are all spaces. Weird.