From: H.G. Muller Date: Wed, 8 Jun 2011 15:11:31 +0000 (+0200) Subject: Fix round-robin schedule X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0fd972d551d13b21ee43524c2e6d36691710b7ba;p=xboard.git 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. --- 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) {