X-Git-Url: http://winboard.nl/cgi-bin?p=capablanca.git;a=blobdiff_plain;f=lasker-2.2.3%2Fbots%2Fmamer%2FTourney.cc;h=c2e3a8763f04bca52d9d5905f81264c00c71f76b;hp=0532f44fe531b681553adae56520059fe30aa885;hb=0ff5591bb1fcb56b4ebf451eb30fb3c413eaad2d;hpb=76f1e81b3426b94e1d80c9daa309f78045e5335b diff --git a/lasker-2.2.3/bots/mamer/Tourney.cc b/lasker-2.2.3/bots/mamer/Tourney.cc index 0532f44..c2e3a87 100644 --- a/lasker-2.2.3/bots/mamer/Tourney.cc +++ b/lasker-2.2.3/bots/mamer/Tourney.cc @@ -3,17 +3,13 @@ // // Matthew E. Moses // -// $Revision: 1.12 $ -// $Date: 2002/07/02 00:02:40 $ +// $Revision: 1.11 $ +// $Date: 1998/09/10 19:57:17 $ // -// $Author: tridge $ +// $Author: mlong $ // $Locker: $ // // $Log: Tourney.cc,v $ -// Revision 1.12 2002/07/02 00:02:40 tridge -// - fixed compile on g++ 2.96 -// - updated for lasker 'rmatch' -// // Revision 1.11 1998/09/10 19:57:17 mlong // lots of little bug fixes and a few new features // @@ -43,7 +39,7 @@ // //-------------------------------------------------------------------------- -//static char RCSid[] = "$Id: Tourney.cc,v 1.12 2002/07/02 00:02:40 tridge Exp $"; +//static char RCSid[] = "$Id: Tourney.cc,v 1.11 1998/09/10 19:57:17 mlong Exp $"; #include "Tourney.hh" #include "Mamer.hh" @@ -233,8 +229,8 @@ void Tourney::SortPlayers() { i=0; while((tp = playerIter.Next())) { (tp->activeFlag) ? tp->sortValue = (tp->score + tp->rating/10000.0) : tp->sortValue = -1.0; - tp->ClearWhites(); - tp->ClearBlacks(); + // tp->ClearWhites(); + // tp->ClearBlacks(); if((status == OPEN) && (i < (GetPlayerCount()/2))) (i % 2) ? tp->AddWhite() : tp->AddBlack(); i++; @@ -399,9 +395,12 @@ void Tourney::SetEndDate() { //- CloseAndStart ---------------------------------------------------------- void Tourney::CloseAndStart(void) { + TourneyPlayers *tp = NULL; status = CLOSED; params.currentRound = 0; + LinkListIter playerIter(playerList); + startDate = time(0); cout << "tourney started at: " << ctime(&startDate) << endl; @@ -423,6 +422,14 @@ void Tourney::CloseAndStart(void) { // this is to stop a 4 player tourney from having 2 rounds params.rounds = (params.rounds < MINIMUM_ROUNDS) ? MINIMUM_ROUNDS : params.rounds; + playerIter.Reset(); // [HGM] this code moved here from SortPlayers + while((tp = playerIter.Next())) { + tp->ClearWhites(); + tp->ClearBlacks(); + tp->ClearTotalWhites(); + tp->ClearTotalBlacks(); + } + MakeAssignments(); TellThemWhoTheyPlay(); // tell them who they play } @@ -712,6 +719,10 @@ void Tourney::AssignColors(TourneyPlayers *p1, TourneyPlayers *p2) { Game *g = NULL; Player *opp1 = NULL, *opp2 = NULL; + cerr << "P1: " << p1->name << " due=" << p1->ColorDue() << " total=" << p1->GetTotalWhites() << "/" << p1->GetTotalBlacks() + << " consecutive=" << p1->GetConsecutiveWhites() << "/" << p1->GetConsecutiveBlacks() << endl; + cerr << "P2: " << p2->name << " due=" << p2->ColorDue() << " total=" << p2->GetTotalWhites() << "/" << p2->GetTotalBlacks() + << " consecutive=" << p2->GetConsecutiveWhites() << "/" << p2->GetConsecutiveBlacks() << endl; if(params.mode != 'r') { rated = 0; } if(intcmp(p1->ColorDue(), p2->ColorDue()) != 0) { if(p1->ColorDue()) { p1Color = 1; } @@ -764,6 +775,7 @@ void Tourney::AssignColors(TourneyPlayers *p1, TourneyPlayers *p2) { while((opp2 = opponentIter2.Next())) { if(!strcasecmp(opp2->name, p1->name)) { break; } } + cerr << "assigned color = " << p1Color << endl; if(p1Color) { p1->AddWhite(); p2->AddBlack(); opp1->value = 1;