From 13955b7b29d1c65157b12c4ab6e6ffbe940cc40b Mon Sep 17 00:00:00 2001 From: Your Average Code <138674451+UrAvgCode@users.noreply.github.com> Date: Thu, 25 Jan 2024 19:16:42 +0100 Subject: [PATCH] RumbleBot random turn --- src/RumbleBot.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/RumbleBot.java b/src/RumbleBot.java index fada332..fd1c7be 100644 --- a/src/RumbleBot.java +++ b/src/RumbleBot.java @@ -108,7 +108,10 @@ public class RumbleBot extends Bot { protected char walkAround(char[][] grid) { if (steps == 0) { steps = random.nextInt(20); - return '>'; + if(random.nextBoolean()) + return '<'; + else + return '>'; } else { steps--; return safeMove(grid);