TecKnow / muster-tools

A package for assigning players to tables at multi-table, walk-in gaming events.
GNU General Public License v3.0
0 stars 0 forks source link

Add shuffle action to seats slice #10

Closed TecKnow closed 3 years ago

TecKnow commented 3 years ago

This is currently accomplished by having the server perform a Fisher-Yates shuffle on an array of integers representing the current Position of each Seat with TableIdentifier zero. the Position values are then updated to match the index of their original value in the shuffled array.

Fore example, if the integer 1 was in position 3 in the shuffled array, then the Seat with Position 1 would be updated to have Position 3.

The array of shuffled indexes is then broadcast in a Redux action to all clients, so they can update their local data accordingly.

Because shuffling is both so important and so difficult, there should probably be an integration test performing a chi-squared test against the uniform distribution.