Add a side seed for @pb4. Cry before the in-IDE HTML rendering.
[troll.git] / config / statement_en.html
1 <div class="statement-body">
2    <!-- GOAL --> 
3    <div class="statement-section statement-goal"> 
4      <h2> 
5        <span class="icon icon-goal">&nbsp;</span> 
6        <span>The Goal</span> 
7      </h2> 
8      <div class="statement-goal-content"> 
9        Don't get destroyed by the troll.
10      </div>
11    </div> 
12    <!-- RULES --> 
13    <div class="statement-section statement-rules"> 
14      <h2> 
15        <span class="icon icon-rules">&nbsp;</span> 
16        <span>Rules</span> 
17      </h2> 
18      <div class="statement-rules-content">
19        If you have stones, shoot <const>1</const> or more of them.
20        <br>
21        If you don't have stones, shoot <const>0</const> exactly.
22      </div>
23    </div>
24    <div class="statement-section statement-warning">
25      <h2>
26        <span class="icon icon-warning">&nbsp;</span>
27        <span>Rule Evolution</span>
28      </h2>
29      <div class="statement-warning-content">
30        The following ideas are still in flux, waiting for some
31        opinions.  Please drop a word on the
32        <a href="https://www.codingame.com/contribute/view/507070b7925f661e2d2835c14f950b9d157e">contribution's page</a>
33        or
34        <a href="https://forum.codingame.com/t/troll-vs-castles-brainstorm/184827?u=jbm">
35          on the forum
36        </a>
37        <ul>
38          <li><s>
39            Is it even worth publishing? can the problem be totally solved?
40          </s></li>
41          <li>
42            More maps? (a map is a {road length} × {initial stone count} pair)
43            → Yes, there will be more maps.
44          </li>
45          <li>
46            Leagues
47            <ol>
48              <li>
49                single small map, cheating is tolerated, boss plays tit
50                for tat (9/10) or cheats (1/10)
51              </li>
52              <li>
53                rock troll and ice troll unlocked; multiple rounds;
54                four maps available; no cheating; boss plays well but
55                not perfect
56              </li>
57              <li>
58                all races unlocked; map continuum, no boss but default
59                AI doesn't lose.
60                <!-- I've actually got plans on a generic way to do
61                     that.  It's going to need many many hacks and a
62                     viewer module.  It's not planned for too soon.  -->
63              </li>
64            </ol>
65            For the WIP phase of this draft, I'll likely merge the last
66            two leagues into one because we need data on what makes the
67            games interesting.
68          </li>
69          <li>
70            <s>Fog of war?</s> Cancelled.  Not in this game.
71          </li>
72          <li>
73            Praise for my artistic skillz.  There can never be enough
74            of that.
75          </li>
76          <li>
77            Other remarks?
78          </li>
79        </ul>
80      </div>
81    </div>
82    <div class="statement-victory-conditions">
83      <div class="icon victory"></div>
84      <div class="blk">
85        <div class="title">Victory Condition</div>
86        <div class="text">Your opponent loses.</div>
87      </div>
88    </div>
89    <div class="statement-lose-conditions">
90      <div class="icon lose"></div>
91      <div class="blk">
92        <div class="title">Defeat Condition</div>
93        <ul>
94          <li>The troll reaches your castle.</li>
95          <li>When no player has stones left, the troll is closer to your castle.</li>
96        </ul>
97      </div>
98    </div>
99    <div class="statement-section statement-protocol">
100      <h2>
101        <span class="icon icon-protocol">&nbsp;</span>
102        <span>I/O Protocol</span>
103      </h2>
104      <div class="statement-protocol-content">
105        <p style="margin-bottom: 1em">
106          This place used to read: “Just read the sample code.  You can
107          figure this out.”  Here are the formalities for <em>that
108          other</em> part of the audience.
109        </p>
110        <div class="blk">
111          <div class="title">Map Input</div>
112          <div class="text">
113            <p>
114              Your first line of input contains space-separated
115              parameters:
116              <var>roadLength</var> <var>initialStones</var>
117              <var>gameSeed</var> <var>gameSide</var>
118              <var>reserved1</var> &hellip; <var>reservedN</var>
119            </p>
120            <dl style="margin: 1em;">
121              <dt>roadLength</dt>
122              <dd style="margin-left: 6em;">
123                distance between both castles, between <const>6</const>
124                and <const>14</const>.
125              </dd>
126              <dt>initialStones</dt>
127              <dd style="margin-left: 6em;">
128                number of stones a castle starts the day with,
129                between <const>0</const> and <const>50</const>.
130              </dd>
131              <dt>gameSeed</dt>
132              <dd style="margin-left: 6em;">
133                the game's seed.  The game AIs use it to provide you
134                with reproducible matches even when they use stochastic
135                algorithms, and you're encouraged to do the same!  See
136                examples section below for simple ways to achieve that.
137              </dd>
138              <dt>gameSide</dt>
139              <dd style="margin-left: 6em;">
140                which side you're on, as <const>-1</const>
141                or <const>1</const>.  It's not supposed to make a
142                difference to how you handle the rest of the game, but
143                you can XOR it to your <code>gameSeed</code> to have a
144                (reproducible) random that doesn't mecessarily draw
145                when it plays against itself.
146              </dd>
147              <dt>reserved<em>N</em></dt>
148              <dd style="margin-left: 6em;">
149                one or more parameters, reserved for future use
150              </dd>
151            </dl>
152          </div>
153        </div>
154        <div class="blk">
155          <div class="title">Turn Input</div>
156          <div class="text">
157            <p>
158              At each turn, you are provided with the following three
159              space-separated values:
160              <var>trollDistance</var>
161              <var>stones</var>
162              <var>opponentStones</var>
163            </p>
164            <dl style="margin: 1em;">
165              <dt>trollDistance</dt>
166              <dd style="margin-left: 6em;">
167                distance between the troll and your castle
168              </dd>
169              <dt>stones</dt>
170              <dd style="margin-left: 6em;">
171                number of stones you have left
172              </dd>
173              <dt>opponentStones</dt>
174              <dd style="margin-left: 6em;">
175                number of stones your opponent has left
176              </dd>
177            </dl>
178          </div>
179        </div>
180        <div class="blk">
181          <div class="title">Turn Output</div>
182          <div class="text">
183            <p>
184              After having received your turn input, you are to output
185              a single integer <var>stones</var>: the number of stones
186              you wish to throw at the troll.
187            </p>
188            <p style="margin-top: 1ex">
189              You may optionally provide a <em>message</em> you wish
190              your castle to yell at the troll or at your opponent.
191              Just append it to your output, being sure to separate it
192              with at least one space.
193              <!-- It has no incidence on the game whatsoever.  Unless
194              you're god, that is. -->
195            </p>
196          </div>
197        </div>
198        <div class="blk">
199          <div class="title">Timing Considerations</div>
200          <div class="text">
201            <p>
202              You're currently allowed the default SDK timings.  I
203              think it's one second for the first turn and 50&nbsp;ms
204              then, but don't quote me on this.
205            </p>
206          </div>
207        </div>
208      </div>
209    </div>
210    <div class="statement-section statement-expertrules">
211      <h2>
212        <span class="icon icon-expertrules">&nbsp;</span>
213        <span>Expert rules</span>
214      </h2>
215      <div class="statement-expert-rules-content">
216        <p>
217          In the lower leagues, the following maps are currently
218          available and randomly yet extremely fairly (you wouldn't
219          believe the effort that went into this) chosen uniformly at
220          random among the following:
221        </p>
222        <table style="margin: 1ex">
223          <tr>
224            <th style="border-bottom: 2px dashed #f2bb13; min-width: 6em;">Road length</th>
225            <th style="border-bottom: 2px dashed #f2bb13; min-width: 6em;">Stones</th>
226          </tr>
227          <tr>
228            <td style="border-bottom: 1px dashed #f2bb13"><const>6</const></td>
229            <td style="border-bottom: 1px dashed #f2bb13"><const>15</const></td>
230          </tr>
231          <tr>
232            <td style="border-bottom: 1px dashed #f2bb13"><const>6</const></td>
233            <td style="border-bottom: 1px dashed #f2bb13"><const>30</const></td>
234          </tr>
235          <tr>
236            <td style="border-bottom: 1px dashed #f2bb13"><const>14</const></td>
237            <td style="border-bottom: 1px dashed #f2bb13"><const>30</const></td>
238          </tr>
239          <tr>
240            <td style="border-bottom: 1px dashed #f2bb13"><const>14</const></td>
241            <td style="border-bottom: 1px dashed #f2bb13"><const>50</const></td>
242          </tr>
243        </table>
244        <p>
245          You can also override them via game
246          settings <var>roadLength</var> and <var>initialStones</var>,
247          so long as you remember you won't be choosing them for
248          ranking play.
249        </p>
250      </div>
251    </div>
252    <div class="statement-section statement-protocol">
253      <h2>
254        <span class="icon icon-protocol">&nbsp;</span>
255        <span>Change Log</span>
256      </h2>
257      <p>
258        I'm not maintaining the full changelog here anymore as the
259        <a href="https://troll.desast.re/troll.git">game's source
260        repository</a> is now publicly available.  I'll just make note
261        of the single latest change, so you can know how far behind you
262        were lagging.  Patches welcome, BTW.
263      </p>
264      <p>
265        This draft's last change is:
266        <strong>
267          game seed is sent in inputs.
268        </strong>
269      </p>
270    </div>
271    <div class="statement-story-background">
272      <div class="statement-story"
273           style="position: relative; min-height: min-content">
274        <div class="story-text">
275          <div style="text-align: center">
276            &ldquo;Trolls simply detest the very sight of dwarves (uncooked).&rdquo;
277          </div>
278          <div style="text-align: right">
279            &mdash;&nbsp;J.R.R. Tolkien, <i>The Hobbit</i>
280          </div>
281        </div>
282        <div class="story-text" style="margin-top: 4em">
283          <p>
284            Based on an involuntary suggestion by
285            <span class="card" cg-codingamer-card-popup=""
286                  userid="user.codingamer.userId">
287              <a class="pseudo"
288                 href="/profile/dbfa96e0ac9b77a3db679628f27224ae8509333"
289                 title="Zaap38">Zaap38</a>
290            </span>
291            on the #Fr channel.  The original appears to be by
292            <a href="http://andre.lovichi.free.fr/teaching/ea/2015-2016/cours/troll/Trolls_et_chateaux.pdf">
293              Romain Andr&eacute;-Lovichi
294            </a>.
295          </p>
296        </div>
297      </div>
298    </div>
299 </div>