aboutsummaryrefslogtreecommitdiff
path: root/pattern.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-04 12:52:51 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-04 12:52:51 +0000
commit38c1f9b7028c4405e1e8145bc6639e33ffce147b (patch)
treeabe353c036ade327d6dfc290cea75c702bbde4fa /pattern.c
parent1c77e0df94e40f741934c9c4852136d6c2f32ced (diff)
downloadpuzzles-38c1f9b7028c4405e1e8145bc6639e33ffce147b.zip
puzzles-38c1f9b7028c4405e1e8145bc6639e33ffce147b.tar.gz
puzzles-38c1f9b7028c4405e1e8145bc6639e33ffce147b.tar.bz2
puzzles-38c1f9b7028c4405e1e8145bc6639e33ffce147b.tar.xz
The Twiddle shuffling algorithm was theoretically parity-unbalanced:
it performed a fixed number of shuffling moves, and on each one it had a 2/3 chance of flipping the permutation parity and a 1/3 chance of keeping it the same. Markov analysis shows that over a run of 1500-odd shuffle moves this will end up being an undetectably small actual bias in the parity of the generated grid, but it offends my sense of pedantry nonetheless so here's a small change to make the number of shuffling moves itself have randomly chosen parity. The parity of generated grids should now be _exactly_ 50:50. [originally from svn r5742]
Diffstat (limited to 'pattern.c')
0 files changed, 0 insertions, 0 deletions