From a0c486dc8ab641c84ba79ea756755c444a90291e Mon Sep 17 00:00:00 2001 From: Stephen Bush Date: Tue, 13 Oct 2015 13:54:03 -0600 Subject: [PATCH] master Example 2 -> Example 3 --- Example.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Example.java b/Example.java index 4ffb5f0..31dd50a 100644 --- a/Example.java +++ b/Example.java @@ -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); }