From 0fd972d551d13b21ee43524c2e6d36691710b7ba Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 8 Jun 2011 17:11:31 +0200 Subject: [PATCH] Fix round-robin schedule The first round was played twice, and the formulas used to derive the pairing were not even-odd resistant anyway. Both even and odd number of participants should work now. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 6645db1..d04fd3d 100644 --- a/backend.c +++ b/backend.c @@ -9746,9 +9746,9 @@ Pairing(int nr, int nPlayers, int *whitePlayer, int *blackPlayer, int *syncInter *whitePlayer = curRound; *blackPlayer = nPlayers - 1; // this is the 'bye' when nPlayer is odd } else { - *whitePlayer = curRound - pairingsPerRound + curPairing; + *whitePlayer = curRound - (nPlayers-1)/2 + curPairing; if(*whitePlayer < 0) *whitePlayer += nPlayers-1+(nPlayers&1); - *blackPlayer = curRound + pairingsPerRound - curPairing; + *blackPlayer = curRound + (nPlayers-1)/2 - curPairing; if(*blackPlayer >= nPlayers-1+(nPlayers&1)) *blackPlayer -= nPlayers-1+(nPlayers&1); } } else if(appData.tourneyType > 0) { -- 1.7.0.4