siemdejong / shit-happens

Create your own Shit Happens playing cards!
GNU General Public License v3.0
4 stars 2 forks source link

Efficient sorting #29

Open siemdejong opened 1 year ago

siemdejong commented 1 year ago

Is your feature request related to a problem? Please describe. With 200 cards, sorting becomes a very labour intensive with the currently implemented round-robin format. 100 comparisons need to be made to only divide the set in 2...

Describe the solution you'd like An acceptable solution would be where sorting takes 1 minute per card maximum, but possibly quicker. Simple insertion sort would take about 1 minute.

Describe alternatives you've considered

Preseed: Categorize every situation into 9 score groups. Random seed for situations per score group. (10s per card)

Monrad Swiss system:

  1. In every score group r1 is paired with r2 and r3 with r4, etc. (10s per comparison, effectively 5s per card.)
  2. Winners get one point, losers none.
  3. Recalculate score groups. Rank determined by score and previous rank as tiebreaker.
  4. Repeat N times (in total 5xNs per card) The complete procedure takes approx. 1 minute per card for N=9. Tiebreaker: sum of all opponent's scores (Bucholz chess rating)

Rules:

Additional context https://en.wikipedia.org/wiki/Swiss-system_tournament