]> git.draconx.ca Git - rrace.git/commit
Mix in PID with initial seed.
authorNick Bowler <nbowler@draconx.ca>
Fri, 13 Jan 2023 03:46:24 +0000 (22:46 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 13 Jan 2023 03:46:24 +0000 (22:46 -0500)
commit5ba271c9a2d679094dc69dd4e9eff33122022ea0
treeb3806b9bbcda44a701367d74b37f73ed7d13e4bd
parentb4b5688edd332e17591ca7bc1cdd64c296abe1c5
Mix in PID with initial seed.

This may give slightly better results if the game timer is not
too precise, by avoiding a scenario where two instances of the
game started very close together have very similar initial states.

In reality this may be an extremely rare or even impossible scenario
with the current implementation, as the (im)precision of system time
functions is often related to system scheduler behaviour.  But it
shouldn't hurt, and the plan is to alter how the timers work and
this will become needed.

To this end, split out the timekeeping functions which allows them
to be easily stubbed out in test cases, and a new test case checks
that (with the nonfunctional timer) we still get different results
on different runs.
Makefile.am
src/game.c
src/time.c [new file with mode: 0644]
t/.gitignore
t/boardmove.c
t/checkgoal.c
t/game-notime.h [new file with mode: 0644]
t/initboard.c [new file with mode: 0644]
t/rng-test.c
tests/game.at