+ <p style="margin-bottom: 1em">
+ This place used to read: “Just read the sample code. You can
+ figure this out.” Here are the formalities for <em>that
+ other</em> part of the audience.
+ </p>
+ <div class="blk">
+ <div class="title">Map Input</div>
+ <div class="text">
+ <p>
+ 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…
+ </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>reserved</var>
+ </p>
+ <dl style="margin: 1em;">
+ <dt>roadLength</dt>
+ <dd style="margin-left: 6em;">
+ distance between both castles, between <const>6</const>
+ and <const>14</const>.
+ </dd>
+ <dt>initialStones</dt>
+ <dd style="margin-left: 6em;">
+ number of stones a castle starts the day with,
+ between <const>0</const> and <const>50</const>.
+ </dd>
+ <dt>gameSeed</dt>
+ <dd style="margin-left: 6em;">
+ the game's seed. The game AIs use it to provide you
+ with reproducible matches even when they use stochastic
+ algorithms, and you're encouraged to do the same! See
+ examples section below for simple ways to achieve that.
+ </dd>
+ <dt>gameSide</dt>
+ <dd style="margin-left: 6em;">
+ which side you're on, as <const>-1</const>
+ or <const>1</const>. It's not supposed to make a
+ difference to how you handle the rest of the game, but
+ you can XOR it to your <code>gameSeed</code> to have a
+ (reproducible) random that doesn't mecessarily draw
+ when it plays against itself.
+ </dd>
+ <dt>reserved</dt>
+ <dd style="margin-left: 6em;">
+ reserved for future use, ignore for now
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="blk">
+ <div class="title">Turn Input</div>
+ <div class="text">
+ <p>
+ At each turn, you are provided with the following three
+ space-separated values:
+ <var>trollDistance</var>
+ <var>stones</var>
+ <var>opponentStones</var>
+ </p>
+ <dl style="margin: 1em;">
+ <dt>trollDistance</dt>
+ <dd style="margin-left: 6em;">
+ distance between the troll and your castle
+ </dd>
+ <dt>stones</dt>
+ <dd style="margin-left: 6em;">
+ number of stones you have left
+ </dd>
+ <dt>opponentStones</dt>
+ <dd style="margin-left: 6em;">
+ number of stones your opponent has left
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="blk">
+ <div class="title">Turn Output</div>
+ <div class="text">
+ <p>
+ After having received your turn input, you are to output
+ a single integer <var>stones</var>: the number of stones
+ you wish to throw at the troll.
+ </p>
+ <p style="margin-top: 1ex">
+ You may optionally provide a <em>message</em> you wish
+ your castle to yell at the troll or at your opponent.
+ Just append it to your output, being sure to separate it
+ with at least one space.
+ <!-- It has no incidence on the game whatsoever. Unless
+ you're god, that is. -->
+ </p>
+ </div>
+ </div>
+ <div class="blk">
+ <div class="title">Timing Considerations</div>
+ <div class="text">
+ <p>
+ You're currently allowed the default SDK timings. I
+ think it's one second for the first turn and 50 ms
+ then, but don't quote me on this.
+ </p>
+ </div>
+ </div>