Exemplo n.º 1
0
 public void earlyNearbyCows() throws GameActionException {
   target = null;
   double numCows = -1.0;
   for (int x = -8; x <= 8; x++) {
     for (int y = -8; y <= 8; y++) {
       MapLocation lookat = currentLocation.add(x, y);
       if (lookat.distanceSquaredTo(ALLY_PASTR_COUNT > 0 ? ALLY_PASTR_LOCS[0] : currentLocation)
               <= 5
           || !RC.canSenseSquare(lookat)) continue;
       double t = RC.senseCowsAtLocation(lookat);
       if (t > numCows) {
         numCows = t;
         target = lookat;
       }
     }
   }
   System.out.println("target" + target + "  numcows " + numCows);
 }