diff options
-rw-r--r-- | backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotParser.java | 1 | ||||
-rw-r--r-- | backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotStarter.java | 14 |
2 files changed, 4 insertions, 11 deletions
diff --git a/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotParser.java b/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotParser.java index c1fab26..0413837 100644 --- a/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotParser.java +++ b/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotParser.java @@ -50,7 +50,6 @@ public class BotParser { state.setState(BotState.STATE_GUESS); Move move = bot.getMove(state); System.out.println(move.toString()); - System.out.flush(); } else if (parts[0].equals("Finish")) { // Are we finished? state.setState(BotState.STATE_FINISH); if (parts[1].equals("win")) { // What is the result? diff --git a/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotStarter.java b/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotStarter.java index a641400..dd65f7e 100644 --- a/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotStarter.java +++ b/backyard/java-bot/trunk/src/nl/camilstaps/botleagues/bot/BotStarter.java @@ -1,5 +1,7 @@ package nl.camilstaps.botleagues.bot; +import java.util.Random; + import nl.camilstaps.botleagues.game.Move; /** @@ -10,11 +12,6 @@ import nl.camilstaps.botleagues.game.Move; public class BotStarter implements Bot { /** - * Keep track of the number of guess calls we received - */ - private int nr_calls = 0; - - /** * Start up a parser * Command-line parameters are ignored * @@ -27,11 +24,8 @@ public class BotStarter implements Bot { @Override public Move getMove(BotState state) { - if (nr_calls++ % 2 == 0) { - return new Move(nr_calls * 2); - } else { - return new Move(nr_calls * nr_calls); - } + Random rand = new Random(); + return new Move(rand.nextInt(100) + 1); } } |