I am using a C# implementation of Mersenne Twister I downloaded from CenterSpace. I have two problems with it:
new Point(number % _canvasWidth, number % _canvasHeight)
. As you may guess, the visual result depends on the form's width and height, and this is a disasterous result.Here is a few ways I tried to seed the algorithm:
new Guid().GetHashCode()
What am I missing here? How should I seed the algorithm? How can I get it pass the DieHard?
While I cannot speak to your first point, the second problem has to do with how you are computing the points to draw on. Specifically,
x = number % _canvasWidth;
y = number % _canvasHeight;
will give you a "pattern" that corresponds somewhat to the aspect ratio of the window you are drawing to. For example, if _canvasWidth
and _canvasHeight
were equal, you would always draw on a single diagonal line as x
and y
would always be the same. This graphical representation wouldn't be appropriate in this case, then.
What about taking the N bits of the RNG output and using half for the x coordinate and the other half for the y coordinate? For those bits that fall out of the bounds of your window you might want to consider two options:
Either option should give you a more representative picture of the bits you are getting our of your random number generator. Good luck!