]> ruin.nu Git - icfp05.git/blobdiff - robber/robber.cpp
initial commit
[icfp05.git] / robber / robber.cpp
diff --git a/robber/robber.cpp b/robber/robber.cpp
new file mode 100644 (file)
index 0000000..c888362
--- /dev/null
@@ -0,0 +1,30 @@
+#include "robber.h"
+#include <iostream>
+
+using namespace std;
+using namespace __gnu_cxx;
+
+string Robber::turn(){
+
+       Intersection& inter = _intersections[_location];
+       
+       cerr << "Number of connecting streets: " << inter.connections.size() << endl;
+
+       for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
+               street != inter.connections.end(); ++street){
+               cerr << "Checking: " << street->first << endl;
+               if (street->second != car){
+                       cerr << "Moving to: " << street->first << endl;
+                       return street->first;
+               }
+       }
+       return _location;
+       
+}
+
+int main(){
+       Robber robber("robber");
+       robber.play();
+
+       return 0;
+}