megalodon-chess / megalodon

Chess engine with the UCI protocol
https://megalodon-chess.github.io/megalodon/
GNU General Public License v3.0
14 stars 0 forks source link

Pseudo random gen #83

Closed ArjunSahlot closed 3 years ago

ArjunSahlot commented 3 years ago

Describe changes

Add a pseudo-random number generator. Random numbers are mainly needed for hashing, and they don't have to be very good. They just need to cover a wide range and have a roughly even distribution. Fixes #79

Testing info

Builtin C++ rand(): Multiple collisions at 1M random number generations. New Random::random(): No collisions at 100M random number generations.

More testing details here.

phuang1024 commented 3 years ago

Please do a ELO test between this branch and v1.0.0

ArjunSahlot commented 3 years ago

Out of 102 games, v1.0.0 won 35, this branch won 33, and they drew 34, resulting in this branch having an ELO of 7.8 less than v1.0.0. But, I think they are roughly the same because there might have not been enough test data and the random move done at the beginning of every game might have worsened one of the engines' chance of winning.