cuadue / 2048_game

Sliding tile puzzle game in the terminal
GNU General Public License v3.0
27 stars 13 forks source link

[minor] tests are glibc specific #9

Open loreb opened 8 years ago

loreb commented 8 years ago

In case anyone is running this anywhere else (*BSD, mac, distros using musl/...) the tests will fail because srandom() can be (and is) implemented as the authors of the C library wish.

Simplest solutions:

cuadue commented 8 years ago

Good call. Might as well just drop in a simple linear feedback shift register and eschew srandom and random altogether.

loreb commented 8 years ago

If you're looking to include a generator, http://xoroshiro.di.unimi.it/ has a nice collection, with explanations (or links to them), comparisons & implementations (mostly GPLv3)

ISAAC (http://burtleburtle.net/bob/rand/isaac.html) is public domain

Knuth (https://cs.stanford.edu/~knuth/news02.html#rng) is public domain as long as you make no changes