diff --git a/backendcloud/botrunningsystem/src/main/java/com/kob/botrunningsystem/utils/Bot.java b/backendcloud/botrunningsystem/src/main/java/com/kob/botrunningsystem/utils/Bot.java index 2819a6b..435ccd4 100644 --- a/backendcloud/botrunningsystem/src/main/java/com/kob/botrunningsystem/utils/Bot.java +++ b/backendcloud/botrunningsystem/src/main/java/com/kob/botrunningsystem/utils/Bot.java @@ -41,9 +41,11 @@ public class Bot implements com.kob.botrunningsystem.utils.BotInterface { @Override public Integer nextMove(String input) { String[] strs = input.split("#"); - int[][] g = new int[13][14]; - for (int i = 0, k = 0; i < 13; i ++ ) { - for (int j = 0; j < 14; j ++, k ++ ) { + int rows = 18; + int cols = 19; + int[][] g = new int[rows][cols]; + for (int i = 0, k = 0; i < rows; i ++ ) { + for (int j = 0; j < cols; j ++, k ++ ) { if (strs[0].charAt(k) == '1') { g[i][j] = 1; } @@ -63,7 +65,7 @@ public class Bot implements com.kob.botrunningsystem.utils.BotInterface { for (int i = 0; i < 4; i ++ ) { int x = aCells.get(aCells.size() - 1).x + dx[i]; int y = aCells.get(aCells.size() - 1).y + dy[i]; - if (x >= 0 && x < 13 && y >= 0 && y < 14 && g[x][y] == 0) { + if (x >= 0 && x < rows && y >= 0 && y < cols && g[x][y] == 0) { return i; } }