]> ruin.nu Git - icfp05.git/blobdiff - copsrc/cop.cpp
initial change to new version
[icfp05.git] / copsrc / cop.cpp
index fd40792bfc10151d5416a7360d33beb2a131a3a4..aed3aeb2b963d9aa6120370dcaa7ee84f56ed34e 100644 (file)
@@ -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<string>(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<pair<int,string> > players;
-       for (hash_map<string,int>::const_iterator player = _winningPlans.begin();
-                       player != _winningPlans.end(); ++player){
-               players.push(pair<int,string>(-player->second, player->first));
-       }
-       while (players.size() > 0){
-               const pair<int,string>& 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(){