Re: A92: random number


[Prev][Next][Index][Thread]

Re: A92: random number




HI,
  I have no idea how to code a random number generator in the Fargo code you
guys are writting. I learned alot about random numbers in my C classes. Last
semester I wrote a CPU simulation program where all of the variables were
randomly generated.  This turned out to be kinda difficult to debug because I
never had the same answer twice. I took an average of an average of the
results to obtain consistent data -- just to figure out I had the program
specification slightly wrong!!! I eventually learned to seed the generator
correctly.
Well, it was correct but I figured out how to keep it constant. This random
number generation is quite intresting. Just how randomly are those numbers
being generatated on those video poker games at the casino??? Well, the random
number generator I have used is only a psuedo-random number generator. It puts
out an even distribution within the target range. The way it scales the
numbers is with a mod operator. It utilizes the remainder from an integer
divison. So, it gives you a number between
 0 and target_range - 1. It isn't all that totally simple, there is more to
it, but that is the jist of it. If you would like I can try to scan the page
from the book and send it to you. I will have access to a scanner on Wed and
Fri. let me know. sorry I talked your ear off
Brian