From: JBM Date: Thu, 4 Jun 2020 14:35:13 +0000 (+0200) Subject: Roll back to constant game parameters count for @BlaiseEbuth, as most languages stubs... X-Git-Url: https://troll.desast.re/troll.git/commitdiff_plain/b327ce8704f1585747bbb5b206cc357b6fbfef51?hp=734e04c8106926949ce97c993e065c98f0fd25ed Roll back to constant game parameters count for @BlaiseEbuth, as most languages stubs don't support variable --- diff --git a/config/statement_en.html b/config/statement_en.html index a63199a..f6afd2d 100644 --- a/config/statement_en.html +++ b/config/statement_en.html @@ -111,11 +111,17 @@
Map Input

- Your first line of input contains space-separated + This section's HTML gets messed up somewhere in the SDK + pipeline. I reported it there; and there + you'll be able to find a readable representation of this + block. Sorry about the inconvenience… +

+

+ Your first line of input contains five space-separated parameters: roadLength initialStones gameSeed gameSide - reserved1reservedN + reserved

roadLength
@@ -144,9 +150,9 @@ (reproducible) random that doesn't mecessarily draw when it plays against itself. -
reservedN
+
reserved
- one or more parameters, reserved for future use + reserved for future use, ignore for now
diff --git a/src/main/java/com/codingame/game/Player.java b/src/main/java/com/codingame/game/Player.java index cb5bb4a..936a3f5 100644 --- a/src/main/java/com/codingame/game/Player.java +++ b/src/main/java/com/codingame/game/Player.java @@ -16,7 +16,6 @@ import com.codingame.gameengine.module.entities.Sprite; public class Player extends AbstractMultiplayerPlayer { Model.Player model; View.Player view; - Random random = new Random(); @Override public int getExpectedOutputLines() { @@ -25,12 +24,9 @@ public class Player extends AbstractMultiplayerPlayer { // same-typed positional parameters… a disaster waiting to happen void gameInit(int roadLength, int initialStones, long seed) { - int nReserved = random.nextInt(5); - String reserved = ""; - while (nReserved --> 0) reserved += " 0"; - sendInputLine(String.format("%d %d %d %d%s", + sendInputLine(String.format("%d %d %d %d 0", roadLength, initialStones, seed, - model.getMultiplier(), reserved)); + model.getMultiplier())); } void sendGameTurn() {