X-Git-Url: https://ruin.nu/git/?p=icfp05.git;a=blobdiff_plain;f=copsrc%2Fcop.cpp;fp=copsrc%2Fcop.cpp;h=aed3aeb2b963d9aa6120370dcaa7ee84f56ed34e;hp=fd40792bfc10151d5416a7360d33beb2a131a3a4;hb=f0bca5d0e69c0d1035c6b32b7d2c27e671f7060b;hpb=42e51f90d84089aa6ecf4b84939bd57b89fe125e diff --git a/copsrc/cop.cpp b/copsrc/cop.cpp index fd40792..aed3aeb 100644 --- a/copsrc/cop.cpp +++ b/copsrc/cop.cpp @@ -8,29 +8,6 @@ using namespace std; using namespace __gnu_cxx; -string Cop::turn(){ - //cerr << "New turn" << endl; - string input; - - sendInformation(); - //cerr << "Getting information " << endl; - getInformation(); - - sendPlan(); - getPlans(); - - vote(); - - getline(cin,input); - if (input != "nowinner:"){ - string winner = value(input); - if (winner != _name) - ++_winningPlans[winner]; - } - - return _location; -} - void Cop::preGamePreparations(){ //cerr << "Preparing.." << endl; _copTargets[_name].first = _robberLocation; @@ -148,6 +125,7 @@ void Cop::sendInformation(){ location != maybeRobber.end(); ++location){ if (location->second > 0) location->second /= possibilities; + cerr << "World: " << _world << endl;; cout << "inf: " << _robber << " " << location->first << " " << _playerTypeNames[robber] << " " << _world << " " << location->second << endl; } @@ -296,33 +274,15 @@ void Cop::sendPlan(){ cout << "plan/" << endl; } -void Cop::getPlans(){ - string input; - - - //ignore From-plan - do{ - getline(cin,input); - }while(input != "from/"); - - -} - -void Cop::vote(){ - cout << "vote\\" << endl; - cout << "vote: " << _name << endl; - priority_queue > players; - for (hash_map::const_iterator player = _winningPlans.begin(); - player != _winningPlans.end(); ++player){ - players.push(pair(-player->second, player->first)); - } - while (players.size() > 0){ - const pair& player = players.top(); - cout << "vote: " << player.second << endl; - //cerr << "voted for " << player.second << " with " << player.first << " previously won plans" << endl; - players.pop(); - } - cout << "vote/" << endl; +void Cop::move(std::string location){ + cout << "cmov\\" << endl; + cout << "straight-arrow:" << endl; + cout << "mov\\" << endl; + Bot::move(location); + cout << "mov/" << endl; + cout << "acc\\" << endl; + cout << "acc/" << endl; + cout << "cmov/" << endl; } int main(){