code: public ScanResult scan(Robot robot, int dist) {
  	Point space = getReferenceField(robot, dist);
  	Robot inPosition = getRobotAt(space);
  	ScanResult ret = null;
  	if (inPosition == null) {
  	    ret = new ScanResult(Found.EMPTY, dist);
  	} else {
  	    if (robot.getData().getTeamId() == inPosition.getData().getTeamId()) {
  		ret = new ScanResult(Found.FRIEND, dist);
  	    } else {
  		ret = new ScanResult(Found.ENEMY, dist);
  	    }
  	}
  
  	return ret;
      }
docs: Scans up to a number of fields in front of the robot, stopping on the first field that
  contains a robot
  
  @param robot scanning robot
  @param dist maximum distance
  @return a container of information about the scan
  @see ScanResult