]> ruin.nu Git - icfp05.git/commitdiff
initial robber done
authorMichael Andreen <harv@ruin.nu>
Sat, 9 Jul 2005 16:54:13 +0000 (16:54 +0000)
committerMichael Andreen <harv@ruin.nu>
Sat, 9 Jul 2005 16:54:13 +0000 (16:54 +0000)
robbersrc/robber.cpp
robbersrc/robber.h

index abf638b1c1f0c9f4107d3e3f415207bcd5d391b6..9bead891761960fd61654568996c0d043cdba3f3 100644 (file)
@@ -8,6 +8,12 @@ using namespace std;
 using namespace __gnu_cxx;
 
 string Robber::turn(){
 using namespace __gnu_cxx;
 
 string Robber::turn(){
+
+       //Ignore bribing for now
+       cout << "nobribe:" << endl;
+       string input;
+       getline(cin,input);
+
        hash_map<string,double> streets;
        Intersection& inter = _intersections[_location];
        for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
        hash_map<string,double> streets;
        Intersection& inter = _intersections[_location];
        for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
@@ -112,6 +118,12 @@ string Robber::turn(){
        return destination;
        
 }
        return destination;
        
 }
+void Robber::move(std::string location){
+       cout << "rmov\\" << endl;
+       Bot::move(location);
+       cout << "nobribe:" << endl;
+       cout << "rmov/" << endl;
+}
 
 int main(){
        Robber robber("harv-robber");
 
 int main(){
        Robber robber("harv-robber");
index 3ba087131bab24e56a281d6eae75dae645063b6b..b4f3e12326270d1175c94711d65106d4b45b287f 100644 (file)
@@ -12,5 +12,6 @@ class Robber : public Bot {
        protected:
                std::string _oldLocation;
                std::string _maybeNextLocation;
        protected:
                std::string _oldLocation;
                std::string _maybeNextLocation;
+               virtual void move(std::string location);
 };
 #endif
 };
 #endif