diff --git a/src/EscapeBot.java b/src/EscapeBot.java index 3c3d4e6..67be7ae 100644 --- a/src/EscapeBot.java +++ b/src/EscapeBot.java @@ -3,7 +3,7 @@ public class EscapeBot extends Bot { boolean foundShip = false; boolean offByOne = true; int currentStepCount = 0; - int steps = 0; + int steps = 10; public static void main(String[] args) { Bot bot = new EscapeBot(args); @@ -16,15 +16,20 @@ public class EscapeBot extends Bot { @Override protected char nextMove(View view) throws Exception { + System.out.println(); if (view.data.contains("o")) { int index = view.data.indexOf('o'); - if(index > view.width * 2) { + if (index < view.width * 2 && !(index > view.width * 3)) { return '^'; + } else if (index % 5 < 2) { + return '<'; + } else if (index % 5 > 2) { + return '>'; } - } - if (steps == 0) { + return ' '; + } else if (steps == 0) { currentStepCount += 1; - if(offByOne) { + if (offByOne) { currentStepCount += 1; } offByOne = !offByOne; diff --git a/src/ManualBot.java b/src/ManualBot.java index 5f301c2..17b2e72 100644 --- a/src/ManualBot.java +++ b/src/ManualBot.java @@ -1,5 +1,3 @@ -import net.bytebuddy.implementation.bytecode.Throw; - import java.util.Scanner; public class ManualBot extends Bot {