bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] I still have a small problem with the dice generator.


From: Øystein Johansen
Subject: [Bug-gnubg] I still have a small problem with the dice generator.
Date: Mon, 03 May 2004 13:19:05 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all!

The first game I start, this happens in the code:
NewGame() calls RollDice().

RollDice() in dice.c line 1047 calls genrand_int32().

in genrand_int32() in mt19937ar.c line 123:

~    if (*mti == N+1)   /* if init_genrand() has not been called, */
~        init_genrand(5489UL,mt); /* a default initial seed is used */

The above condition comes TRUE, and the dice seed is set to 5489.
This makes every first game of a match/session exactly the same. Starts
with 51, 66, 61, 62 ....

The strange thing is that the condition becomes TRUE, because
init_genrand() is called earlier in the in the code (even several times).

Can someone explain? Can someone with the right knowledge fix?

- -Øystein

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAliqp6kDTFPhwyqYRAjtKAJ9fLitx8VF00K8clhlr8OjDvtU27wCdHy+O
J66QbESDTjlKjUEceRGjdn4=
=GfT6
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]