]> ruin.nu Git - icfp05.git/commitdiff
bugfix
authorMichael Andreen <harv@ruin.nu>
Sat, 25 Jun 2005 21:38:56 +0000 (21:38 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 25 Jun 2005 21:38:56 +0000 (21:38 +0000)
bot/bot.cpp
cop/cop.cpp

index 6a486025c77ef869315e0e4f86e971e56e91bf9c..181b423d44c82e714aca3f84a82c882d78c77604 100644 (file)
@@ -72,15 +72,15 @@ void Bot::play(){
 
        //robber and 5 cops
        getline(cin, input);
-       _players[value<string>(input)];
+       _players[value<string>(input)].type = robber;
        getline(cin, input);
-       _players[value<string>(input)];
+       _players[value<string>(input)].type = cop_foot;
        getline(cin, input);
-       _players[value<string>(input)];
+       _players[value<string>(input)].type = cop_foot;
        getline(cin, input);
-       _players[value<string>(input)];
+       _players[value<string>(input)].type = cop_foot;
        getline(cin, input);
-       _players[value<string>(input)];
+       _players[value<string>(input)].type = cop_foot;
 
        cerr << "Got players, building graph." << endl;
        getline(cin, input);
index 3db7d419e329f0571946e93d7587f17112b8f251..76215630ad1d2e946c6455256980bd9545f8ad18 100644 (file)
@@ -7,7 +7,39 @@ using namespace std;
 using namespace __gnu_cxx;
 
 string Cop::turn(){
-       
+       cout << "inf\\" << endl;
+       cout << "inf/" << endl;
+
+       string input;
+
+       //ignore From-inform
+       do{
+               getline(cin,input);
+       }while(input != "from/");
+
+       cout << "plan\\" << endl;
+       //cout << "plan: " << _name << endl;
+       cout << "plan/" << endl;
+
+       //ignore From-plan
+       do{
+               getline(cin,input);
+       }while(input != "from/");
+
+       cout << "vote\\" << endl;
+       cout << "vote: " << _name << endl;
+       for (hash_map<string,Player>::const_iterator player = _players.begin();
+                       player != _players.end(); ++player){
+               if (player->second.type != robber && player->first != _name){
+                       cout << "vote: " << player->first << endl;
+                       cerr << "voted for " << player->first << " of type: " << player->second.type << endl;
+               }
+       }
+       cout << "vote/" << endl;
+
+       //Ignore vote
+       getline(cin,input);
+
        return _location;
 }