Computer Chess Club Archives


Search

Terms

Messages

Subject: Crafty 19.12 SE

Author: Mike Byrne

Date: 21:53:15 04/15/04


not quite ready ....but one the neat little options added to Crafty 19.12 Se is
a state of the art random number generator - activated by typing "random <low>
<high> <number>"

with the display on - >

random 1 6 10000

will give this type of display
....(9960 random numbers not shown)
          3          1          5          1          4
          1          3          5          2          3
          1          5          4          5          5
          4          1          5          4          1
          4          2          3          3          6
          5          4          6          4          3
          1          4          4          1          2
          6          1          5          1          5


one's       =      1658
two's       =      1656
three's     =      1648
four's      =      1683
five's      =      1660
six's       =      1695

Total Random Numbers Generated (RNG)  =  10000
Raw RNG per second: 10870

White(1): SE on - turns the display off -- and speed up the RNG engine by a
factor of 600x
thus on my slow P4 1.7 Ghz it will crank out 100,000,000 RNs in about 18 seconds
thus typing  "rand 1 6 100000000" will generate output that look like this:

White(1): rand 1 6 100000000


one's       =      16667825
two's       =      16662861
three's     =      16665900
four's      =      16662002
five's      =      16669195
six's       =      16672217

Total Random Numbers Generated (RNG)  =  100000000
Raw RNG per second: 5727377

White(1):

=============================================

The RNG engine is based on the renowned work of Makoto Matsumoto and Takuji
Nishimura.  The name of their RNG engine is the the "Mersenne Twister"
(originally knowns as the named "Primitive Twisted Generalized Feedback Shift
Register Sequence" quite a mouthful - thus the Mersenne Twister was born (Since
it uses Mersenne primes, and it shows that it has its ancestor "Twisted GFSR"
and it conveniently hides the intials of the inventors).

more to read here: http://www.math.keio.ac.jp/~matumoto/emt.html

The code I am using is based on Shawn Cokus optimized source:

http://www.math.keio.ac.jp/~matumoto/ver980409.html

here is his source - licensing is governed by this GNU Library General Public
License:

// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Library General Public License as published by
// the Free Software Foundation (either version 2 of the License or, at your
// option, any later version).

http://www.math.keio.ac.jp/~matumoto/cokus.c

now why all this in Crafty ...

My next phase was to increase variabilty in play based on random number
generation and the first step - was to get a good quality random number
generator installed ...I sort of like having the RNG at the command prompt while
in the Crafty console mode - so I might leave it their.  The RNG is
autoamatically seeded based on CPU clock time so you will gety different results
everytime:

White(1): rand 1 6 100000000

one's       =      16673673
two's       =      16665422
three's     =      16668874
four's      =      16661999
five's      =      16666060
six's       =      16663972

Total Random Numbers Generated (RNG)  =  100000000
Raw RNG per second: 5824112

White(1):



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.