Advertisement
Guest User

JBM-patchset.mbox

a guest
Mar 29th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 45.88 KB | None | 0 0
  1. From 0e71e6a63b0ccb4871467bebeaaaebefea09abbd Mon Sep 17 00:00:00 2001
  2. From: JBM <jbm@codingame.com>
  3. Date: Sun, 29 Mar 2020 13:39:59 +0200
  4. Subject: [PATCH 1/4] Formatting, style and language.
  5.  
  6. I've reworded what I could according to my current level of understanding.
  7. I'd need a quick back-and-forth chat with the creators for the
  8. next patch: clearing out the illegal/invalid actions' situation.
  9.  
  10. I've also re-enabled the power list in the Move section to be visible
  11. after Bronze.
  12. ---
  13. config/statement_en.html.tpl | 240 +++++++++++++++++++----------------
  14.  1 file changed, 130 insertions(+), 110 deletions(-)
  15.  
  16. diff --git a/config/statement_en.html.tpl b/config/statement_en.html.tpl
  17. index 59d3998..68fd140 100644
  18. --- a/config/statement_en.html.tpl
  19. +++ b/config/statement_en.html.tpl
  20. @@ -13,7 +13,7 @@
  21.      </div>
  22.      <p style="text-align: center; font-weight: 700; margin-bottom: 6px;">
  23.        <!-- BEGIN level1 -->
  24. -      This is a <b>league based</b> challenge.
  25. +      This is a <b>league-based</b> challenge.
  26.        <!-- END -->
  27.        <!-- BEGIN level2 -->
  28.        Welcome to the Wood1 league!
  29. @@ -44,10 +44,10 @@
  30.              <span>The Goal</span>
  31.          </h2>
  32.          <div class="statement-goal-content">
  33. -            This game is based on the board game Captain Sonar. <br>
  34. -            You pilot a submarine and you know that an enemy is present near you because you are listening to its radio frequency communication.
  35. -            You don't know exactly where it is but you can hear all its orders.
  36. -            You and your opponent have <const>6</const> hit points. When a player's hit points reach <const>0</const>, the player loses.
  37. +            This is a two-player game based on the board game Captain Sonar. <br>
  38. +            You pilot a submarine.  You know that an enemy is present nearby because you are listening to its radio frequency communication.
  39. +            You don't know exactly where it is but you can hear all of its orders.<br>
  40. +            You and your opponent start with <const>6</const> hit points. When a player's hit points reach <const>0</const>, that player loses.
  41.          </div>
  42.      </div>
  43.      <!-- RULES -->
  44. @@ -57,139 +57,148 @@
  45.              <span>Rules</span>
  46.          </h2>
  47.          <div><div class="statement-rules-content">
  48. -            <h2>Definitions</h2>
  49. +            <h2>Environment</h2>
  50.              <p>
  51.              <ul>
  52. -                <li>Submarines move on a map constituted of water and islands. They can only move on cells with water. They can share the same cell without colliding.</li>
  53. -                <li>The map is <const>15</const> cells in width and <const>15</const> cells in height. Coordinates start at (0,0) which is the top left cell of the map.</li>
  54. -                <li>The map is split in <const>9</const> sectors, which contain <const>25</const> cells each (5x5 blocks of cells). The top left sector is <const>1</const>. The bottom right sector is <const>9</const>.</li>
  55. +                <li>The <b>map</b> is a square tiling: <const>15</const> cells wide and <const>15</const> cells high.  The NW corner is <const>(0,0)</const>; the SW corner is <const>(0,14).</li>
  56. +                <li>Each map cell is either open <b>water</b> or an <b>island</b>.  Islands are obstacles.  Submarines cannot move to or through islands.  Nor can torpedoes<!-- BEGIN level3 level4 --> or mines<!-- END -->.</li>
  57. +                <li><b>Submarines</b> move on the open water cells of the map. Each player controls one submarine; both submarines move independently.  They can share the same water cell without colliding.</li>
  58. +                <li>The map is split in <const>9</const> <b>sectors</b>.  Each sector encompasses a <const>5×5</const> block of <const>25</const> cells.  You can find the sectors' numbering in the viewer; the top left sector is number <const>1</const> and the bottom right sector is number <const>9</const>.</li>
  59.              </ul>
  60.              </p>
  61.  
  62. -            <h2>Beginning of the game</h2>
  63. +            <h2>Game start</h2>
  64.              <p>
  65. -                At the beginning of the game, you'll receive a map (15x15 cells) that indicates the position of islands.
  66. -                Islands are obstacles. You cannot move or fire through islands. Then, you will decide where you want to place your submarine by indicating a coordinate (x,y).
  67. +                At the beginning of the game, you'll receive a full 15×15 map that indicates the position of the islands.
  68. +                You will then decide and reply where you want your submarine's <b>starting position</b> to be. <!-- actual format is *not even* (x,y), just let player read the I/O section or stub -->
  69.              </p>
  70.  
  71. -
  72. -            <h2> Each turn</h2>
  73. -            <p>This is a turn based game which means that each player plays a turn one after the other. The player with the id 0 begins.
  74. -                During your turn, thankfully to your radio frequency analysis, you will receive an indication of what your opponent has done.
  75. -                For example, you can receive that it moved to the north. It's up to you to use this valuable information to detect where it is. Then, you must perform at least one action.
  76. +            <h2>Turns</h2>
  77. +            <p>This is a turn-based game: each player plays a turn one after the other. The whole game lasts <const>299</const> turns per player. The player with id <const>0</const> begins.</p>
  78. +            <p>During your turn, thanks to your radio frequency analysis, you will receive an indication of what your opponent has done.
  79. +                For example, you can receive that it moved to the north. It's up to you to use this valuable information to detect where the opponent actually is.
  80. +            </p>
  81. +            <p>
  82. +               During your turn, you must perform <b>at least one action</b>.
  83.              </p>
  84. -
  85.              <h2>Actions</h2>
  86.              <p>
  87. -                Each turn you must perform at least one action. You can do several actions by chaining them using the pipe <const>|</const>.
  88. -                But you can use each type of action only once per turn (you can move one time per turn, no more).
  89. -                If you fail to output a valid action, you will SURFACE in that turn.
  90. +                Actions are your turn's output.  They are provided sequentially, on a single line.  You can chain several of them using a pipe symbol <const>|</const>.</p>
  91. +            <p>But you can use each type of action only <b>once per turn</b>.  For example you can <const>MOVE</const> once per turn, and no more.
  92. +               If you fail to output a valid action, your action will be forced to <const>SURFACE</const>.
  93.              </p>
  94. -
  95. +            <br>
  96.              <p><strong>Move</strong></p>
  97. -            A move action moves your submarine <const>1</const> cell in a given direction (north, east, south, west) and charges a power of your choice.
  98. -            When you move, you must respect the following rules:
  99. -            <ul><li> You cannot move through islands</li>
  100. -                <li>You cannot move on a cell you already visited before</li>
  101. +            <p>A move action:
  102. +              <ul>
  103. +                <li>moves your submarine by <const>1</const> cell in a chosen direction (north, east, south, west).</li>
  104. +                <li>charges a power of your choice.</li>
  105. +              </ul>
  106. +            </p>
  107. +            <p>When you move, you must respect the following rules:
  108. +            <ul><li>You cannot move through islands.</li>
  109. +                <li>You cannot move to a cell you have visited before.</li>
  110.              </ul>
  111. -            You can decide, what to charge. Different devices require a different amount of charges to be ready.
  112. +            <p>You can decide what special power to charge. Different devices require a different amount of charges to be ready. The power levels are separate per device, not shared.<br>
  113.              <!-- BEGIN level1 -->
  114.              In this league you can only charge the torpedo.
  115.              <!-- END -->
  116.              <!-- BEGIN level2 -->
  117.              In this league you can charge the torpedo, the sonar and the silence mode.
  118.              <!-- END -->
  119. -            <!-- BEGIN level3 -->
  120. +            <!-- BEGIN level3 level4 -->
  121.              You can charge the torpedo, the sonar, the silence mode and mines.
  122.              <!-- END -->
  123. +            </p>
  124. +            <br><p><strong>Surface</strong></p>
  125. +            The surface action will reset your path of visited cells, so that you can freely move to a cell that you have previously visited.
  126. +            But surfacing has major impacts: your opponent will know in which sector you are surfacing, and you will lose <const>1</const> hit point.
  127.  
  128. -            <br><br><p><strong>Surface</strong></p>
  129. -            By using surface you will reset your path of visited cells so that you can freely move to a cell that you have previously visited.
  130. -            But surfacing has a major impact: your opponent will know in which sector you are surfacing and you lose <const>1</const> hit point.
  131. -
  132. -            <br><br><p><strong>Torpedo</strong></p>
  133. -            A torpedo requires <const>3</const> charge actions to be ready.
  134. -            When fully charged, the torpedo can be fired at an arbitrary water position within a range of <const>4</const> cells.
  135. +            <br><p><strong>Torpedo</strong></p>
  136. +            The torpedo action requires a charge level of <const>3</const>.
  137. +            When fully charged, the torpedo can be fired at an arbitrary water position within a water range of <const>4</const> cells.
  138.              This allows the torpedo's path to contain corners and go around islands, but not through them.
  139. -            The damage of the explosion is <const>2</const> on the cell itself and <const>1</const> on all neighbors (including diagonal ones). You can also damage yourself with a torpedo.
  140.              The following image illustrates the range of a torpedo: <br>
  141.              <img src="https://raw.githubusercontent.com/CodinGameCommunity/ocean-of-code/master/torpedoRange.png">
  142. -
  143. +            <br><p>The damage of the explosion is <const>2</const> hit points on the cell itself and <const>1</const> on its 8 neighbor cells (this includes diagonals). You can also damage yourself with a torpedo.</p>
  144. +            <br>
  145.              <!-- BEGIN level2 -->
  146.          <div style="color: #7cc576;
  147.          background-color: rgba(124, 197, 118,.1);
  148.          padding: 2px;">
  149. -            <br><br><p><strong>Sonar</strong></p>
  150. -            Sonar requires <const>4</const> charge actions to load.
  151. -            It allows you to check, if the opponent's submarine is in a given sector. You will get the response in your next turn.
  152. -            This is in respect to the time of issuing the command, not after the opponent moved.
  153. +            <p><strong>Sonar</strong></p>
  154. +            <p>The sonar action requires a charge level of <const>4</const>.
  155. +              When fully charged, it allows you to check whether the opponent's submarine is in a chosen sector.</p>
  156. +            <p>The response will be provided to you in your next turn's input.
  157. +            Careful! Said response is in respect to the time you issued the order, so your opponent will have issued and performed orders of its own by the time you receive it.</p>
  158.  
  159. -            <br><br><p><strong>Silence</strong></p>
  160. -            Silence requires <const>6</const> charge actions to load.
  161. -            This allows you to move <const>0</const> to <const>4</const> cells in a given direction (not visiting already visited cells or islands).
  162. -            Your opponent will not know in which direction or how far you've moved.
  163. +            <br><p><strong>Silence</strong></p>
  164. +            The silence action requires a charge level of <const>6</const>.
  165. +            When fully charged, it allows you to move <const>0</const> to <const>4</const> cells in a chosen direction.  Same as with the Move action, you may not visit an island or an already visited cell, be it as a final action destination or a waypoint.<br>
  166. +            Your opponent will not know in which direction or how far you've moved.  It <i>will</i> know that you used the silence action, though.
  167.              </div>
  168.             <!-- END -->
  169.             <!-- BEGIN level3 level4 -->
  170. -             <br><br><p><strong>Sonar</strong></p>
  171. -            Sonar requires <const>4</const> charge actions to load.
  172. -            It allows you to check, if the opponent's submarine is in a given sector. You will get the response in your next turn.
  173. -            This is in respect to the time of issuing the command, not after the opponent moved.
  174. +            <p><strong>Sonar</strong></p>
  175. +            <p>The sonar action requires a charge level of <const>4</const>.
  176. +              When fully charged, it allows you to check whether the opponent's submarine is in a chosen sector.</p>
  177. +            <p>The response will be provided to you in your next turn's input.
  178. +            Careful! Said response is in respect to the time you issued the order, so the opponent will have issued and performed orders of its own by the time you receive it.</p>
  179.  
  180. -            <br><br><p><strong>Silence</strong></p>
  181. -            Silence requires <const>6</const> charge actions to load.
  182. -            This allows you to move <const>0</const> to <const>4</const> cells in a given direction (not visiting already visited cells or islands).
  183. -            Your opponent will not know in which direction or how far you've moved.
  184. +            <br><p><strong>Silence</strong></p>
  185. +            The silence action requires a charge level of <const>6</const>.
  186. +            When fully charged, it allows you to move <const>0</const> to <const>4</const> cells in a chosen direction.  Same as with the Move action, you may not visit an island or an already visited cell, be it as a final action destination or a waypoint.<br>
  187. +            Your opponent will not know in which direction or how far you've moved.  It <i>will</i> know that you used the silence action, though.<br>
  188.            <!-- END -->
  189. -
  190. +            <br>
  191.              <!-- BEGIN level3 -->
  192.              <div style="color: #7cc576;
  193.          background-color: rgba(124, 197, 118,.1);
  194.          padding: 2px;">
  195. -            <br><br><p><strong>Mine</strong></p>
  196. -            Mine requires <const>3</const> charge actions to load.
  197. -            It can be placed on any cell next to you (north, east, south, west).
  198. -            You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.
  199. -            Mines will only detonate when using the trigger command, not when moving onto them.
  200. +            <p><strong>Mine</strong></p>
  201. +            The mine action requires a charge level of <const>3</const>.
  202. +            The mine can be placed on any cell next to you (north, east, south, west).<br>
  203. +            You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.<br>
  204. +            Mines are only detonated by using the trigger action, not by a submarine moving onto them.<br>
  205.  
  206. -            <br><br><p><strong>Trigger</strong></p>
  207. -            Triggering a mine will cause an explosion. You can only trigger your own mines.
  208. -            Like for a torpedo, the explosion has a damage of <const>2</const> on the location of the mine and <const>1</const> damage to nearby cells (including diagonally).
  209. -            You can't trigger multiple mines in the same turn. You can't place and trigger a mine in the same turn. You can also damage yourself with a mine.
  210. +            <br><p><strong>Trigger</strong></p>
  211. +            The trigger action will cause a mine to explode. You can only trigger your own mines.<br>
  212. +            Like for a torpedo, the explosion has a damage of <const>2</const> on the location of the mine and <const>1</const> damage to nearby cells (including diagonally).<br>
  213. +            You can't trigger multiple mines in the same turn. You can't place a mine and trigger it during the same turn. Your mines damage your opponent's submarine and yours indiscriminately.<br>
  214.              </div>
  215.              <!-- END -->
  216.              <!-- BEGIN level4 -->
  217. -            <br><br><p><strong>Mine</strong></p>
  218. -            Mine requires <const>3</const> charge actions to load.
  219. -            It can be placed on any cell next to you (north, east, south, west).
  220. -            You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.
  221. -            Mines will only detonate when using the trigger command, not when moving onto them.
  222. +            <p><strong>Mine</strong></p>
  223. +            The mine action requires a charge level of <const>3</const>.
  224. +            The mine can be placed on any cell next to you (north, east, south, west).<br>
  225. +            You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.<br>
  226. +            Mines are only detonated by using the trigger action, not by a submarine moving onto them.<br>
  227. +
  228. +            <br><p><strong>Trigger</strong></p>
  229. +            The trigger action will cause a mine to explode. You can only trigger your own mines.<br>
  230. +            Like for a torpedo, the explosion has a damage of <const>2</const> on the location of the mine and <const>1</const> damage to nearby cells (including diagonally).<br>
  231. +            You can't trigger multiple mines in the same turn. You can't place a mine and trigger it during the same turn. Your mines damage your opponent's submarine and yours indiscriminately.<br>
  232.  
  233. -            <br><br><p><strong>Trigger</strong></p>
  234. -            Triggering a mine will cause an explosion. You can only trigger your own mines.
  235. -            Like for a torpedo, the explosion has a damage of <const>2</const> on the location of the mine and <const>1</const> damage to nearby cells (including diagonally).
  236. -            You can't trigger multiple mines in the same turn. You can't place and trigger a mine in the same turn. You can also damage yourself with a mine.
  237.              <!-- END -->
  238.  
  239. -            <br>
  240. -            <br>
  241. -            The following table shows, how different actions will be shown to your opponent:
  242. +            <br><h2>Orders' visibility</h2>
  243. +            The following table shows how different actions will be shown to your opponent:
  244.              <table>
  245. -                <tr><th>Your action</th><th>Shown to opponent</th><th>comment</th></tr>
  246. +                <tr><th>Your action</th><th>Shown to opponent</th><th>Comment</th></tr>
  247.                  <tr>
  248.                      <td><action>MOVE N TORPEDO</action></td>
  249.                      <td><action>MOVE N</action></td>
  250. -                    <td>The opponent will see the movement direction (in this case: north), but not which power is charged</td>
  251. +                    <td>The opponent will see the movement's direction (in this case: north), but not which power is charged.</td>
  252.                  </tr>
  253.                  <tr>
  254.                      <td><action>SURFACE</action></td>
  255.                      <td><action>SURFACE 3</action></td>
  256. -                    <td>The opponent will see, that you surfaced in sector 3</td>
  257. +                    <td>The opponent will see that you surfaced in sector <const>3</const></td>
  258.                  </tr>
  259.                  <tr>
  260.                      <td><action>TORPEDO 3 5</action></td>
  261.                      <td><action>TORPEDO 3 5</action></td>
  262. -                    <td>The opponent will see, that you fired a torpedo at the cell (3,5)</td>
  263. +                    <td>The opponent will see that you fired a torpedo at <const>(3,5)</const></td>
  264.                  </tr>
  265.                  <!-- BEGIN level2 -->
  266.                  <tr style="color: #7cc576;
  267. @@ -197,26 +206,26 @@
  268.          padding: 2px;">
  269.                      <td><action>SONAR 4</action></td>
  270.                      <td><action>SONAR 4</action></td>
  271. -                    <td>The opponent will see, that you used a sonar on sector 4. You will receive the sonar result (Y/N for yes/no) in the next turn.</td>
  272. +                    <td>The opponent will see that you used your sonar on sector <const>4</const>.<!-- sonar result timing isn't relevant to this table --></td>
  273.                  </tr>
  274.                  <tr style="color: #7cc576;
  275.          background-color: rgba(124, 197, 118,.1);
  276.          padding: 2px;">
  277.                      <td><action>SILENCE N 4</action></td>
  278.                      <td><action>SILENCE</action></td>
  279. -                    <td>The opponent will see, that you moved silently - but not where or how far</td>
  280. +                    <td>The opponent will see that you moved silently&mdash;but not where or how far.</td>
  281.                  </tr>
  282.                  <!-- END -->
  283.                  <!-- BEGIN level3 level4 -->
  284.                  <tr>
  285.                      <td><action>SONAR 4</action></td>
  286.                      <td><action>SONAR 4</action></td>
  287. -                    <td>The opponent will see, that you used a sonar on sector 4. You will receive the sonar result (Y/N for yes/no) in the next turn.</td>
  288. +                    <td>The opponent will see that you used your sonar on sector <const>4</const>.<!-- sonar result timing isn't relevant to this table --></td>
  289.                  </tr>
  290.                  <tr>
  291.                      <td><action>SILENCE N 4</action></td>
  292.                      <td><action>SILENCE</action></td>
  293. -                    <td>The opponent will see, that you moved silently - but not where or how far</td>
  294. +                    <td>The opponent will see that you moved silently&mdash;but not where or how far.</td>
  295.                  </tr>
  296.                  <!-- END -->
  297.                  <!-- BEGIN level3 -->
  298. @@ -225,27 +234,27 @@
  299.          padding: 2px;">
  300.                      <td><action>MINE E</action></td>
  301.                      <td><action>MINE</action></td>
  302. -                    <td>The opponent will see, that you placed a mine - but not in which direction</td>
  303. +                    <td>The opponent will see that you placed a mine&mdash;but not in which direction.</td>
  304.                  </tr>
  305.                  <tr style="color: #7cc576;
  306.          background-color: rgba(124, 197, 118,.1);
  307.          padding: 2px;">
  308.                      <td><action>TRIGGER 3 5</action></td>
  309.                      <td><action>TRIGGER 3 5</action></td>
  310. -                    <td>The opponent will see, that you trigger a mine at cell (3,5)</td>
  311. +                    <td>The opponent will see that you triggered the mine at <const>(3,5)</const>.</td>
  312.                  </tr>
  313.                  <!-- END -->
  314.                  <!-- BEGIN level4 -->
  315.                  <tr>
  316.                      <td><action>MINE E</action></td>
  317.                      <td><action>MINE</action></td>
  318. -                    <td>The opponent will see, that you placed a mine - but not in which direction</td>
  319. +                    <td>The opponent will see that you placed a mine&mdash;but not in which direction.</td>
  320.                  </tr>
  321.                  <tr>
  322.                      <td><action>TRIGGER 3 5</action></td>
  323.                      <td><action>TRIGGER 3 5</action></td>
  324. -                    <td>The opponent will see, that you trigger a mine at cell (3,5)</td>
  325. -                </tr>
  326. +                    <td>The opponent will see that you triggered the mine at <const>(3,5)</const>.</td>
  327. +                 </tr>
  328.                  <!-- END -->
  329.              </table>
  330.  
  331. @@ -255,7 +264,7 @@
  332.                  <div class="icon victory"></div>
  333.                  <div class="blk">
  334.                      <div class="title">Victory Conditions</div>
  335. -                    <div class="text">Have more lifes than your enemy at the end of the game. Each player has 300 turns including the initial placement.</div>
  336. +                    <div class="text">Have more hit points left than your enemy at the end of the game.</div>
  337.                  </div>
  338.              </div>
  339.              <!-- Lose conditions -->
  340. @@ -265,8 +274,7 @@
  341.                      <div class="title">Lose Conditions</div>
  342.                      <ul>
  343.                          <li><div class="text">Output an invalid command or don't respond in time.</div></li>
  344. -                        <li><div class="text">Reach 0 lives.</div></li>
  345. -                        <li><div class="text">Intersect your own path, move into an island or out of the map.</div></li>
  346. +                        <li><div class="text">Reach <const>0</const> hit points or lower.</div></li>
  347.                      </ul>
  348.                  </div>
  349.              </div>
  350. @@ -292,50 +300,51 @@
  351.          <!-- Protocol block -->
  352.          <div class="blk">
  353.              <div class="title">Inputs of the first turn</div>
  354. -            <div class="text"><span class="statement-lineno">Line 1: </span> a string with 3 space separated integers<br>
  355. -                <var>width</var> <var>height</var> <var>myId</var><br>
  356. -                <ul><li><var>width</var> and <var>height</var> that indicates the size of the grid in term of cells (15 15)</li>
  357. -                    <li><var>myId</var> that indicates your player ID (<const>0</const> or <const>1</const>). The player with ID <const>0</const> begins.</li>
  358. +            <div class="text"><span class="statement-lineno">Line 1: </span>
  359. +                <var>width</var> <var>height</var> <var>myId</var>, space-separated.<br>
  360. +                <ul><li><var>width</var> and <var>height</var> indicate the size of the grid in cells (<const>15</const> <const>15</const>)</li>
  361. +                    <li><var>myId</var> indicates your player ID (<const>0</const> or <const>1</const>). The player with ID <const>0</const> begins.</li>
  362.                  </ul>
  363. -                <span class="statement-lineno">Next <var>height</var> lines:</span> a string of <var>width</var> chars representing the content of each cells of this row. <const>x</const> for an island, <const>.</const> for an empty cell.</div>
  364. +                <span class="statement-lineno">Next <var>height</var> lines:</span> a string of <var>width</var> chars representing the content of each cells of this row: <const>x</const> for an island, <const>.</const> for an empty cell.</div>
  365.          </div>
  366.  
  367.          <!-- Protocol block -->
  368.          <div class="blk">
  369.              <div class="title">Output for the first turn</div>
  370. -            <div class="text">2 space separated integers <var>x</var> <var>y</var> which represent the coordinates of your starting position. The cell at the specified coordinates should be empty which means no island, but the opponent can choose the same cell!</div>
  371. +            <div class="text">2 space-separated integers <var>x</var> <var>y</var> which represent the coordinates of your starting position. The cell at the specified coordinates should be empty which means no island, but the opponent can choose the same cell!</div>
  372.          </div>
  373.  
  374.          <!-- Protocol block -->
  375.          <div class="blk">
  376.              <div class="title">Inputs for each turn</div>
  377. -            <div class="text"><span class="statement-lineno">Line 1: </span>a string with 8 space separated integers.
  378. +            <div class="text"><span class="statement-lineno">Line 1: </span>8 space-separated integers:
  379.                  <br> <var>x</var> <var>y</var> <var>myLife</var> <var>oppLife</var> <var>torpedoCooldown</var> <var>sonarCooldown</var> <var>silenceCooldown</var> <var>mineCooldown</var><br>
  380.                  <ul>
  381.                      <li><var>x</var> and <var>y</var> represent your current position.</li>
  382. -                    <li><var>myLife</var> and <var>oppLife</var> give the number of hit points remaining for, respectively, you and your opponent</li>
  383. -                    <li><var>torpedoCooldown</var> <var>sonarCooldown</var> <var>silenceCooldown</var> <var>mineCooldown</var> represent the cooldowns for each device.
  384. +                    <li><var>myLife</var> and <var>oppLife</var> give the number of hit points you and your opponent have left</li>
  385. +                    <li><var>torpedoCooldown</var> <var>sonarCooldown</var> <var>silenceCooldown</var> <var>mineCooldown</var> represent the number of charges each device still needs before it can be used.
  386.                          <!-- BEGIN level1 level2 -->
  387. -                        Devices unavailable in your league will have <const>-1</const>.
  388. +                        Devices unavailable in your league will have a cooldown value of <const>-1</const>.
  389.                          <!-- END -->
  390.                      </li>
  391.                  </ul>
  392. -                <span class="statement-lineno">Line 2: </span> a string <var>sonarResult</var> which gives you the result of the <action>SONAR</action> action: <const>Y</const> for yes, <const>N</const> for no. It is <const>NA</const>, if no sonar was used. <br>
  393. -                <span class="statement-lineno">Line 3: </span> <var>opponentOrders</var>, a summary of the actions (separated by <const>|</const>) that your opponent has made during its turn.<br>
  394. -                Example: <action>MOVE</action> N |<action>TORPEDO</action> 3 5<br>
  395. -                This example indicates that your opponent moved to the north and then fired a torpedo at the cell (3, 5).<br>
  396. -                <const>NA</const> is used the first turn of the starting player (this is the only case when your opponent hasn't done anything yet).</div>
  397. +                <span class="statement-lineno">Line 2: </span> a string <var>sonarResult</var> which gives you the result of your <action>SONAR</action> action: <const>Y</const> for yes, <const>N</const> for no, <const>NA</const>, if you didn't use the sonar on the previous turn. <br>
  398. +                <span class="statement-lineno">Line 3: </span> <var>opponentOrders</var>, a summary of your opponent's actions (separated by a pipe symbol <const>|</const>) during its turn.<br>
  399. +                Example: <action>MOVE N|TORPEDO 3 5</action><br>
  400. +                This example indicates that your opponent moved to the north and then fired a torpedo to (3,5).<br>
  401. +                On the starting player's first turn, this will be the string <const>NA</const>, since the opponent has no previous orders at that point.</div>
  402.          </div>
  403.  
  404.          <!-- Protocol block -->
  405.          <div class="blk">
  406.              <div class="title">Output for each next turns</div>
  407. -            <div class="text">One or multiple commands separated by <const>|</const>. <br />
  408. -                e.g.: <var>MOVE N TORPEDO | TORPEDO 3 5</var> These commands move your submarine to the north and then fire a torpedo at the cell 3,5.
  409. +            <div class="text">One or multiple commands separated by a pipe symbol <const>|</const>. <br>
  410. +              Example: <action>MOVE N TORPEDO | TORPEDO 3 5</action><br>
  411. +              These commands move your submarine to the north and then fire a torpedo at (3,5).
  412.  
  413.                  Here are the different available actions:
  414.                  <ul>
  415. -                    <li><action>MOVE direction POWER</action></li>
  416. +                    <li><action>MOVE direction power</action></li>
  417.                      <li><action>SURFACE</action></li>
  418.                      <li><action>TORPEDO X Y</action></li>
  419.                      <!-- BEGIN level2 -->
  420. @@ -363,7 +372,18 @@
  421.                      <li><action>TRIGGER X Y</action></li>
  422.                      <!-- END -->
  423.                      <li><action>MSG message</action></li>
  424. -                </ul></div>
  425. +                </ul>
  426. +                Here are the different available powers to charge:
  427. +                <ul>
  428. +                  <li><const>TORPEDO</const></li>
  429. +                  <!-- BEGIN level2 level3 level4 -->
  430. +                  <li><const>SONAR</const></li>
  431. +                  <li><const>SILENCE</const></li>
  432. +                  <!-- END -->
  433. +                  <!-- BEGIN level4 -->
  434. +                  <li><const>MINE</const></li>
  435. +                  <!-- END -->
  436. +            </div>
  437.          </div>
  438.  
  439.          <!-- Protocol block -->
  440. --
  441. 2.26.0
  442.  
  443. From 80e3edb5d61fb2e750d3c67e6ec5e8881a4cf9a2 Mon Sep 17 00:00:00 2001
  444. From: JBM <jbm@codingame.com>
  445. Date: Sun, 29 Mar 2020 13:12:39 +0200
  446. Subject: [PATCH 2/4] =?UTF-8?q?Give=20the=20visibility=20section=20a=20mor?=
  447.  =?UTF-8?q?e=20=E2=80=9Cdiff=E2=80=9D=20feeling?=
  448. MIME-Version: 1.0
  449. Content-Type: text/plain; charset=UTF-8
  450. Content-Transfer-Encoding: 8bit
  451.  
  452. ---
  453. config/statement_en.html.tpl | 17 +++++++++--------
  454.  1 file changed, 9 insertions(+), 8 deletions(-)
  455.  
  456. diff --git a/config/statement_en.html.tpl b/config/statement_en.html.tpl
  457. index 68fd140..630a8ee 100644
  458. --- a/config/statement_en.html.tpl
  459. +++ b/config/statement_en.html.tpl
  460. @@ -72,7 +72,7 @@
  461.                  At the beginning of the game, you'll receive a full 15×15 map that indicates the position of the islands.
  462.                  You will then decide and reply where you want your submarine's <b>starting position</b> to be. <!-- actual format is *not even* (x,y), just let player read the I/O section or stub -->
  463.              </p>
  464. -
  465. +            <br>
  466.              <h2>Turns</h2>
  467.              <p>This is a turn-based game: each player plays a turn one after the other. The whole game lasts <const>299</const> turns per player. The player with id <const>0</const> begins.</p>
  468.              <p>During your turn, thanks to your radio frequency analysis, you will receive an indication of what your opponent has done.
  469. @@ -81,6 +81,7 @@
  470.              <p>
  471.                 During your turn, you must perform <b>at least one action</b>.
  472.              </p>
  473. +            <br>
  474.              <h2>Actions</h2>
  475.              <p>
  476.                  Actions are your turn's output.  They are provided sequentially, on a single line.  You can chain several of them using a pipe symbol <const>|</const>.</p>
  477. @@ -113,7 +114,7 @@
  478.              <br><p><strong>Surface</strong></p>
  479.              The surface action will reset your path of visited cells, so that you can freely move to a cell that you have previously visited.
  480.              But surfacing has major impacts: your opponent will know in which sector you are surfacing, and you will lose <const>1</const> hit point.
  481. -
  482. +            <br>
  483.              <br><p><strong>Torpedo</strong></p>
  484.              The torpedo action requires a charge level of <const>3</const>.
  485.              When fully charged, the torpedo can be fired at an arbitrary water position within a water range of <const>4</const> cells.
  486. @@ -188,17 +189,17 @@
  487.                  <tr>
  488.                      <td><action>MOVE N TORPEDO</action></td>
  489.                      <td><action>MOVE N</action></td>
  490. -                    <td>The opponent will see the movement's direction (in this case: north), but not which power is charged.</td>
  491. +                    <td>The opponent will <em>not</em> see which power is charged.</td>
  492.                  </tr>
  493.                  <tr>
  494.                      <td><action>SURFACE</action></td>
  495.                      <td><action>SURFACE 3</action></td>
  496. -                    <td>The opponent will see that you surfaced in sector <const>3</const></td>
  497. +                    <td>The opponent will see which sector (in this case: <const>3</const>) you surfaced in.</td>
  498.                  </tr>
  499.                  <tr>
  500.                      <td><action>TORPEDO 3 5</action></td>
  501.                      <td><action>TORPEDO 3 5</action></td>
  502. -                    <td>The opponent will see that you fired a torpedo at <const>(3,5)</const></td>
  503. +                    <td>The opponent will see the same order you issued.</const></td>
  504.                  </tr>
  505.                  <!-- BEGIN level2 -->
  506.                  <tr style="color: #7cc576;
  507. @@ -206,7 +207,7 @@
  508.          padding: 2px;">
  509.                      <td><action>SONAR 4</action></td>
  510.                      <td><action>SONAR 4</action></td>
  511. -                    <td>The opponent will see that you used your sonar on sector <const>4</const>.<!-- sonar result timing isn't relevant to this table --></td>
  512. +                    <td>The opponent will see the same order you issued.<!-- sonar result timing isn't relevant to this table --></td>
  513.                  </tr>
  514.                  <tr style="color: #7cc576;
  515.          background-color: rgba(124, 197, 118,.1);
  516. @@ -220,7 +221,7 @@
  517.                  <tr>
  518.                      <td><action>SONAR 4</action></td>
  519.                      <td><action>SONAR 4</action></td>
  520. -                    <td>The opponent will see that you used your sonar on sector <const>4</const>.<!-- sonar result timing isn't relevant to this table --></td>
  521. +                    <td>The opponent will see the same order you issued.<!-- sonar result timing isn't relevant to this table --></td>
  522.                  </tr>
  523.                  <tr>
  524.                      <td><action>SILENCE N 4</action></td>
  525. @@ -241,7 +242,7 @@
  526.          padding: 2px;">
  527.                      <td><action>TRIGGER 3 5</action></td>
  528.                      <td><action>TRIGGER 3 5</action></td>
  529. -                    <td>The opponent will see that you triggered the mine at <const>(3,5)</const>.</td>
  530. +                    <td>The opponent will see the same order you issued.</td>
  531.                  </tr>
  532.                  <!-- END -->
  533.                  <!-- BEGIN level4 -->
  534. --
  535. 2.26.0
  536.  
  537. From 96db3d0ce4089972039ad9f72f83e296c9544c96 Mon Sep 17 00:00:00 2001
  538. From: JBM <jbm@codingame.com>
  539. Date: Sat, 28 Mar 2020 23:33:37 +0100
  540. Subject: [PATCH 3/4] My rewording epiphany: separate charge/energy/power
  541. MIME-Version: 1.0
  542. Content-Type: text/plain; charset=UTF-8
  543. Content-Transfer-Encoding: 8bit
  544.  
  545. “charge” is only to be used as a verb: it is one ofthe effects a MOVE has.
  546. “power” is only used as a noun: it is to be thought of as in “special
  547. power” and is one of torpedo/sonar/silence/mine.
  548. “energy [level]” is the number of charging effects a power has received.
  549.  
  550. I'm reluctantly leaving the “cooldowns” as is, as they impact the stubs
  551. and people have started coding already, but do think about it for the
  552. post-contest phase.
  553.  
  554. Took me quite some fudging to pin down.
  555. ---
  556. config/statement_en.html.tpl | 26 +++++++++++++-------------
  557.  1 file changed, 13 insertions(+), 13 deletions(-)
  558.  
  559. diff --git a/config/statement_en.html.tpl b/config/statement_en.html.tpl
  560. index 630a8ee..1f39cc8 100644
  561. --- a/config/statement_en.html.tpl
  562. +++ b/config/statement_en.html.tpl
  563. @@ -90,17 +90,17 @@
  564.              </p>
  565.              <br>
  566.              <p><strong>Move</strong></p>
  567. -            <p>A move action:
  568. -              <ul>
  569. -                <li>moves your submarine by <const>1</const> cell in a chosen direction (north, east, south, west).</li>
  570. -                <li>charges a power of your choice.</li>
  571. -              </ul>
  572. +            <p>A move action has two effects:
  573. +              <ol>
  574. +                <li>It moves your submarine by <const>1</const> cell in a chosen direction (north, east, south, west).</li>
  575. +                <li>It charges a special power of your choice, <i>i.e.</i> increases its energy level by <const>1</const>.</li>
  576. +              </ol>
  577.              </p>
  578.              <p>When you move, you must respect the following rules:
  579.              <ul><li>You cannot move through islands.</li>
  580.                  <li>You cannot move to a cell you have visited before.</li>
  581.              </ul>
  582. -            <p>You can decide what special power to charge. Different devices require a different amount of charges to be ready. The power levels are separate per device, not shared.<br>
  583. +            <p>You can decide what special power to charge.  The special powers are performed by different devices, who require a different amount of energy to be ready. The energy levels are separate per device, not shared.<br>
  584.              <!-- BEGIN level1 -->
  585.              In this league you can only charge the torpedo.
  586.              <!-- END -->
  587. @@ -116,7 +116,7 @@
  588.              But surfacing has major impacts: your opponent will know in which sector you are surfacing, and you will lose <const>1</const> hit point.
  589.              <br>
  590.              <br><p><strong>Torpedo</strong></p>
  591. -            The torpedo action requires a charge level of <const>3</const>.
  592. +            The torpedo action requires an energy level of <const>3</const>.
  593.              When fully charged, the torpedo can be fired at an arbitrary water position within a water range of <const>4</const> cells.
  594.              This allows the torpedo's path to contain corners and go around islands, but not through them.
  595.              The following image illustrates the range of a torpedo: <br>
  596. @@ -128,26 +128,26 @@
  597.          background-color: rgba(124, 197, 118,.1);
  598.          padding: 2px;">
  599.              <p><strong>Sonar</strong></p>
  600. -            <p>The sonar action requires a charge level of <const>4</const>.
  601. +            <p>The sonar action requires an energy level of <const>4</const>.
  602.                When fully charged, it allows you to check whether the opponent's submarine is in a chosen sector.</p>
  603.              <p>The response will be provided to you in your next turn's input.
  604.              Careful! Said response is in respect to the time you issued the order, so your opponent will have issued and performed orders of its own by the time you receive it.</p>
  605.  
  606.              <br><p><strong>Silence</strong></p>
  607. -            The silence action requires a charge level of <const>6</const>.
  608. +            The silence action requires an energy level of <const>6</const>.
  609.              When fully charged, it allows you to move <const>0</const> to <const>4</const> cells in a chosen direction.  Same as with the Move action, you may not visit an island or an already visited cell, be it as a final action destination or a waypoint.<br>
  610.              Your opponent will not know in which direction or how far you've moved.  It <i>will</i> know that you used the silence action, though.
  611.              </div>
  612.             <!-- END -->
  613.             <!-- BEGIN level3 level4 -->
  614.              <p><strong>Sonar</strong></p>
  615. -            <p>The sonar action requires a charge level of <const>4</const>.
  616. +            <p>The sonar action requires an energy level of <const>4</const>.
  617.                When fully charged, it allows you to check whether the opponent's submarine is in a chosen sector.</p>
  618.              <p>The response will be provided to you in your next turn's input.
  619.              Careful! Said response is in respect to the time you issued the order, so the opponent will have issued and performed orders of its own by the time you receive it.</p>
  620.  
  621.              <br><p><strong>Silence</strong></p>
  622. -            The silence action requires a charge level of <const>6</const>.
  623. +            The silence action requires an energy level of <const>6</const>.
  624.              When fully charged, it allows you to move <const>0</const> to <const>4</const> cells in a chosen direction.  Same as with the Move action, you may not visit an island or an already visited cell, be it as a final action destination or a waypoint.<br>
  625.              Your opponent will not know in which direction or how far you've moved.  It <i>will</i> know that you used the silence action, though.<br>
  626.            <!-- END -->
  627. @@ -157,7 +157,7 @@
  628.          background-color: rgba(124, 197, 118,.1);
  629.          padding: 2px;">
  630.              <p><strong>Mine</strong></p>
  631. -            The mine action requires a charge level of <const>3</const>.
  632. +            The mine action requires an energy level of <const>3</const>.
  633.              The mine can be placed on any cell next to you (north, east, south, west).<br>
  634.              You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.<br>
  635.              Mines are only detonated by using the trigger action, not by a submarine moving onto them.<br>
  636. @@ -170,7 +170,7 @@
  637.              <!-- END -->
  638.              <!-- BEGIN level4 -->
  639.              <p><strong>Mine</strong></p>
  640. -            The mine action requires a charge level of <const>3</const>.
  641. +            The mine action requires an energy level of <const>3</const>.
  642.              The mine can be placed on any cell next to you (north, east, south, west).<br>
  643.              You can't place two own mines on the same cell. However it's possible to place your own mine on an opponent mine or the opponent's submarine itself.<br>
  644.              Mines are only detonated by using the trigger action, not by a submarine moving onto them.<br>
  645. --
  646. 2.26.0
  647.  
  648. From d066d45ab6e6a71d64c25e4153fc3e0fd096a2fd Mon Sep 17 00:00:00 2001
  649. From: JBM <jbm@codingame.com>
  650. Date: Sun, 29 Mar 2020 13:33:04 +0200
  651. Subject: [PATCH 4/4] Split out a Powers paragraph
  652.  
  653. ---
  654. config/statement_en.html.tpl | 9 +++++++--
  655.  1 file changed, 7 insertions(+), 2 deletions(-)
  656.  
  657. diff --git a/config/statement_en.html.tpl b/config/statement_en.html.tpl
  658. index 1f39cc8..1dbd960 100644
  659. --- a/config/statement_en.html.tpl
  660. +++ b/config/statement_en.html.tpl
  661. @@ -100,9 +100,14 @@
  662.              <ul><li>You cannot move through islands.</li>
  663.                  <li>You cannot move to a cell you have visited before.</li>
  664.              </ul>
  665. -            <p>You can decide what special power to charge.  The special powers are performed by different devices, who require a different amount of energy to be ready. The energy levels are separate per device, not shared.<br>
  666. +            <br>
  667. +            <p><strong>Powers</strong></p>
  668. +            <p>For each move action you take, you have to decide what special power to charge.  The special powers are performed by different devices, who require a different amount of energy to be ready.</p>
  669. +            <p>The energy levels are separate per device, not shared.  The amounts of energy needed to activate a device are also distinct per device.<br>
  670. +              A device's energy is fully consumed when that device's power is used.  The energy level cannot grow above that device's requirement for one use of the power.<br>
  671. +              <p>
  672.              <!-- BEGIN level1 -->
  673. -            In this league you can only charge the torpedo.
  674. +            In this league you only have access to the torpedo.
  675.              <!-- END -->
  676.              <!-- BEGIN level2 -->
  677.              In this league you can charge the torpedo, the sonar and the silence mode.
  678. --
  679. 2.26.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement