Edward & U-Zyn's EE2007 Log

Thursday, October 20, 2005

Randomizer

Spent a lot of time trying to generate 4 random digits from 0-5.

As the program only gets a single seed to generate the nubmers from, I had to figure out how to generate the digits fairly and independently.

Finally settled with:

RTC = current time
digit1 = RTC % 6
RTC = RTC / 6
digit2 = RTC % 6
RTC = RTC / 6
...

They should be fair and independent. Aren't they?

0 Comments:

Post a Comment

<< Home