public Direction fleeClosest(Robot[] en) throws GameActionException {
   MapLocation min = rc.senseLocationOf(en[0]);
   int minDist = min.distanceSquaredTo(cur);
   for (int i = 1; i < en.length; i++) {
     MapLocation next = rc.senseLocationOf(en[i]);
     int dist = next.distanceSquaredTo(cur);
     if (minDist < dist) {
       min = next;
       minDist = dist;
     }
   }
   Direction desired = cur.directionTo(min);
   return m.moveInDir(desired);
 }
  public Direction fleeWeighted(Robot[] en) throws GameActionException {
    Robot[] allies = sensor.getBots(Sensor.SENSE_RANGE_ALLIES);
    int yDir = 0;
    int xDir = 0;
    int numEnemies = en.length;
    int numAllies = allies.length;

    for (Robot e : en) {
      MapLocation eLoc = rc.senseRobotInfo(e).location;
      xDir -= eLoc.x;
      yDir -= eLoc.y;
    }
    for (Robot a : allies) {
      MapLocation aLoc = rc.senseRobotInfo(a).location;
      xDir += aLoc.x;
      yDir += aLoc.y;
    }
    xDir += numEnemies * cur.x - numAllies * cur.x;
    yDir += numEnemies * cur.y - numAllies * cur.y;

    Direction desired = cur.directionTo(cur.add(xDir, yDir));

    return m.smartMove(desired);
  }