Roll back to constant game parameters count for @BlaiseEbuth, as most languages stubs...
authorJBM <jbm@codingame.com>
Thu, 4 Jun 2020 14:35:13 +0000 (16:35 +0200)
committerJBM <jbm@codingame.com>
Thu, 4 Jun 2020 14:35:13 +0000 (16:35 +0200)
config/statement_en.html
src/main/java/com/codingame/game/Player.java

index a63199a..f6afd2d 100644 (file)
          <div class="title">Map Input</div>
          <div class="text">
            <p>
-             Your first line of input contains space-separated
+             This section's HTML gets messed up somewhere in the SDK
+             pipeline.  <a href="https://forum.codingame.com/t/misleading-html-in-the-sdk-skeleton/184828/8?u=jbm">I reported it there;</a> and there
+             you'll be able to find a readable representation of this
+             block.  Sorry about the inconvenience&hellip;
+           </p>
+           <p>
+             Your first line of input contains five space-separated
              parameters:
              <var>roadLength</var> <var>initialStones</var>
              <var>gameSeed</var> <var>gameSide</var>
-             <var>reserved1</var> &hellip; <var>reservedN</var>
+             <var>reserved</var>
            </p>
            <dl style="margin: 1em;">
              <dt>roadLength</dt>
                (reproducible) random that doesn't mecessarily draw
                when it plays against itself.
              </dd>
-             <dt>reserved<em>N</em></dt>
+             <dt>reserved</dt>
              <dd style="margin-left: 6em;">
-               one or more parameters, reserved for future use
+               reserved for future use, ignore for now
              </dd>
            </dl>
          </div>
index cb5bb4a..936a3f5 100644 (file)
@@ -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() {