Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ public static RobotType chooseRobotType() {
if(Math.random()*3>1) {
return RobotType.SCOUT;
}
if(almostSurrounded()){
return RobotType.SCOUT;
}
if(numberOfRobotsInRadiusAndThoseRobots(RobotType.GUARD,3,ourTeam).first == 7){
return RobotType.SCOUT;
}
Expand All @@ -765,7 +768,18 @@ public static RobotType chooseRobotType() {
}
return RobotType.GUARD;
}

/**
* boolean almostSurrounded
* @return a boolean on whether or not robot is almost surrounded
*
*/
public static boolean almostSurrounded(){
RobotInfo[] robots = rc.senseNearbyRobots(3);
if(robots != null && robots.length == 7){
return true;
}
return false;
}
/**
* Returns the number of robots within a given radius squared
* @param type the type of robot to look for
Expand Down