X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=robbersrc%2Frobber.cpp;h=5f36f475177f2a32072c62312ae445b93fbb5bb5;hb=311cc01a3137b22c5617305245588cef6ef48ba9;hp=abf638b1c1f0c9f4107d3e3f415207bcd5d391b6;hpb=42e51f90d84089aa6ecf4b84939bd57b89fe125e;p=icfp05.git diff --git a/robbersrc/robber.cpp b/robbersrc/robber.cpp index abf638b..5f36f47 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(); @@ -16,26 +22,29 @@ string Robber::turn(){ //cerr << "Discarding: " << street->first << " since car is needed" << endl; continue; } - double goodness = 0; + //cerr << "Looking at street: " << street->first << endl; Intersection& conInter = _intersections[street->first]; + double goodness = conInter.connections.size()*5; list closestFootCop = shortestPath(street->first, cop_foot, FindPlayer(_players, cop_foot, 6), true); unsigned int closestCop = closestFootCop.size(); - //cerr << "Cop on fot " << closestCop << " intersections away." << endl; bool copInCar = false; - list closestCarCop = shortestPath(street->first, cop_car, FindPlayer(_players, cop_car, closestCop > 0 ? closestCop : 5), true); - //cerr << "Cop in car " << closestCarCop.size() << " intersections away." << endl; + //cerr << "Cop on fot " << closestCop << " intersections away." << endl; + if (closestCop > 0 && closestCop < 3) + continue; + + list closestCarCop = shortestPath(street->first, cop_car, FindPlayer(_players, cop_car, closestCop - 1 > 0 ? closestCop : 5), true); + //cerr << "Cop in car " << closestCarCop.size() << " intersections away." << endl; if (closestCarCop.size() > 0){ closestCop = closestCarCop.size(); copInCar = true; } - if (closestCop > 0 && closestCop < 3){ - //cerr << "Cop " << closestCop << " intersections away." << endl; + //cerr << "Cop " << closestCop << " intersections away." << endl; + if (closestCop > 0 && closestCop < 3) continue; - } priority_queue banks; for(hash_map::const_iterator bank = _banks.begin(); @@ -112,6 +121,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");