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.
This is currently accomplished by having the server perform a Fisher-Yates shuffle on an array of integers representing the current
Position
of eachSeat
withTableIdentifier
zero. thePosition
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
withPosition
1 would be updated to havePosition
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.