From: JBM Date: Sun, 7 Jun 2020 13:36:14 +0000 (+0200) Subject: Increase cheating reserve bots' variety X-Git-Url: https://troll.desast.re/troll.git/commitdiff_plain/87034448efb74251e5d8939273a69a1f6a7d3355?ds=inline Increase cheating reserve bots' variety --- diff --git a/src/test/java/Main.java b/src/test/java/Main.java index 1488dee..cbb15e8 100644 --- a/src/test/java/Main.java +++ b/src/test/java/Main.java @@ -12,7 +12,7 @@ public class Main { gameRunner.setGameParameters(props); gameRunner.addAgent(Player1.class); - gameRunner.addAgent(PlayerRand.class); + gameRunner.addAgent(PlayerCheatSmart.class); // gameRunner.addAgent("python3 /home/user/player.py"); diff --git a/src/test/java/PlayerCheat.java b/src/test/java/PlayerCheatPure.java similarity index 94% rename from src/test/java/PlayerCheat.java rename to src/test/java/PlayerCheatPure.java index 555f2a4..0809385 100644 --- a/src/test/java/PlayerCheat.java +++ b/src/test/java/PlayerCheatPure.java @@ -1,7 +1,7 @@ import java.util.Random; import java.util.Scanner; -public class PlayerCheat { +public class PlayerCheatPure { public static void main(String[] args) { Scanner in = new Scanner(System.in); Random random = new Random(); diff --git a/src/test/java/PlayerCheatSmart.java b/src/test/java/PlayerCheatSmart.java new file mode 100644 index 0000000..97a5167 --- /dev/null +++ b/src/test/java/PlayerCheatSmart.java @@ -0,0 +1,24 @@ +import java.util.Random; +import java.util.Scanner; + +public class PlayerCheatSmart { + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + Random random = new Random(); + + int roadLength = in.nextInt(); + int initialStones = in.nextInt(); + in.nextLine(); + + while (true) { + int trollDistance = in.nextInt(); + int stones = in.nextInt(); + int opponentStones = in.nextInt(); + + int wantThrow = (roadLength - trollDistance + stones - 1) / stones; + int actualThrow = wantThrow > stones ? Integer.MIN_VALUE + 1 + : wantThrow; + System.out.println(actualThrow); + } + } +}