From e408032f5d3f3b07559c70e0813c0c0fed218f01 Mon Sep 17 00:00:00 2001 From: Your Average Code <138674451+UrAvgCode@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:05:13 +0100 Subject: [PATCH] SnakeBot reformat --- src/SnakeBot.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/SnakeBot.java b/src/SnakeBot.java index 6a61eca..b3df2d2 100644 --- a/src/SnakeBot.java +++ b/src/SnakeBot.java @@ -8,8 +8,8 @@ public class SnakeBot extends Bot { protected int steps = 0; public static void main(String[] args) { - Bot bot = new SnakeBot(args); - bot.run(); + Bot bot = new SnakeBot(args); + bot.run(); } protected SnakeBot(String[] args) { @@ -72,10 +72,8 @@ public class SnakeBot extends Bot { int rightStars = 0; for (int x = 0; x < size / 2; x++) { for (int y = 0; y < size; y++) { - if (grid[x][y] == '*') - leftStars++; - if (grid[size - x - 1][y] == '*') - rightStars++; + if (grid[x][y] == '*') leftStars++; + if (grid[size - x - 1][y] == '*') rightStars++; } }