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 | 9 |
2 files changed, 4 insertions, 6 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..7fa90b5 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; /** @@ -27,11 +29,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); } } |