Skip to content

Commit

Permalink
master Example 2 -> Example 3
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenbush-wf committed Oct 13, 2015
1 parent 57fbb79 commit a0c486d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public static void run(RobotController rc) {
Direction dir = rc.getLocation().directionTo(rc.senseEnemyHQLocation()); // Get the direction to the enemy Base
MapLocation spawnLocation = rc.getLocation().add(dir); // Get me the next adjacent location in that direction

while ( rc.senseMine(spawnLocation) != null) { // Check to see if there's a mine at that location
// Check to see if there's a mine OR another robot at that location
while ( rc.senseMine(spawnLocation) != null || rc.senseObjectAtLocation(spawnLocation) != null ) {
dir = dir.rotateLeft(); // If so, rotate until we find a direction with no mines
spawnLocation = rc.getLocation().add(dir);
}
Expand Down

0 comments on commit a0c486d

Please sign in to comment.