From 725e4fff7b81933d18b1eb50f213ac526045aabc Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 5 Aug 2019 14:08:12 -0600 Subject: show collision in grid with X --- src/Q9/Robot.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Q9/Robot.java') 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 += "| "; } -- cgit v1.2.3