From: Michael Andreen Date: Sat, 9 Jul 2005 16:54:13 +0000 (+0000) Subject: initial robber done X-Git-Url: https://ruin.nu/git/?p=icfp05.git;a=commitdiff_plain;h=524573fae3ea0c8a1bb01a2b4fd848bff0bb04d1 initial robber done --- diff --git a/robbersrc/robber.cpp b/robbersrc/robber.cpp index abf638b..9bead89 100644 --- a/robbersrc/robber.cpp +++ b/robbersrc/robber.cpp @@ -8,6 +8,12 @@ using namespace std; using namespace __gnu_cxx; string Robber::turn(){ + + //Ignore bribing for now + cout << "nobribe:" << endl; + string input; + getline(cin,input); + hash_map streets; Intersection& inter = _intersections[_location]; for (hash_map::const_iterator street = inter.connections.begin(); @@ -112,6 +118,12 @@ string Robber::turn(){ 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"); diff --git a/robbersrc/robber.h b/robbersrc/robber.h index 3ba0871..b4f3e12 100644 --- a/robbersrc/robber.h +++ b/robbersrc/robber.h @@ -12,5 +12,6 @@ class Robber : public Bot { protected: std::string _oldLocation; std::string _maybeNextLocation; + virtual void move(std::string location); }; #endif