]> ruin.nu Git - icfp05.git/blob - cop/cop.cpp
bugfix
[icfp05.git] / cop / cop.cpp
1 #include "cop.h"
2 #include <iostream>
3 #include <iterator>
4 #include <cmath>
5
6 using namespace std;
7 using namespace __gnu_cxx;
8
9 string Cop::turn(){
10         cout << "inf\\" << endl;
11         cout << "inf/" << endl;
12
13         string input;
14
15         //ignore From-inform
16         do{
17                 getline(cin,input);
18         }while(input != "from/");
19
20         cout << "plan\\" << endl;
21         //cout << "plan: " << _name << endl;
22         cout << "plan/" << endl;
23
24         //ignore From-plan
25         do{
26                 getline(cin,input);
27         }while(input != "from/");
28
29         cout << "vote\\" << endl;
30         cout << "vote: " << _name << endl;
31         for (hash_map<string,Player>::const_iterator player = _players.begin();
32                         player != _players.end(); ++player){
33                 if (player->second.type != robber && player->first != _name){
34                         cout << "vote: " << player->first << endl;
35                         cerr << "voted for " << player->first << " of type: " << player->second.type << endl;
36                 }
37         }
38         cout << "vote/" << endl;
39
40         //Ignore vote
41         getline(cin,input);
42
43         return _location;
44 }
45
46 int main(){
47         Cop cop("cop");
48         cop.play();
49
50         return 0;
51 }