summaryrefslogtreecommitdiff
path: root/src/Q9/Robot.java
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2019-08-05 14:08:12 -0600
committermo khan <mo@mokhan.ca>2019-08-05 14:08:12 -0600
commit725e4fff7b81933d18b1eb50f213ac526045aabc (patch)
treecbf97fb1a669fd7e552044361ae1e78307a3659c /src/Q9/Robot.java
parent223504b53a19484e39ee5256fb83ff0bf3e0ba7f (diff)
show collision in grid with X
Diffstat (limited to 'src/Q9/Robot.java')
-rw-r--r--src/Q9/Robot.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Q9/Robot.java b/src/Q9/Robot.java
index 638b581..ed0c28c 100644
--- a/src/Q9/Robot.java
+++ b/src/Q9/Robot.java
@@ -54,7 +54,8 @@ public class Robot {
boolean r1InCell = r1.atPosition(row, column);
boolean r2InCell = r2.atPosition(row, column);
- if (r1InCell) grid += "|1";
+ if (r1InCell && r2InCell) grid += "|X";
+ else if (r1InCell) grid += "|1";
else if (r2InCell) grid += "|2";
else grid += "| ";
}