Random Numbers

H. Chen, Nick Jacobs chen at acf4.UUCP
Mon Jul 22 23:44:00 AEST 1985


Recently a friend and I needed some random numbers for a game (sigh) program.
Since we just wanted to generate a small range of values, we simply made an
array with the range of values in it. Since we knew that the user's "access"
to these psuedo-random values would be semi-random in itself; we simply creat-
ed a mini Turing machine algorithm (sort of) where the value returned would be 
dependent on the state of the algorithm from a prior call. (It was like a Turing
machine in that we moved up and down the array depending upon the previous state
of the algorithm.) 

We haven't had a chance to test this algorithm heavily, but the game (for the
PC) was like pong in which the ball's movement is already semi-random due to
the fact that most people cannot control the ball that well.

					Nicholas Jacobs
					chen at acf4 (just for the summer)
					...cmcl2!acf4!chen



More information about the Comp.lang.c mailing list