Bug report from @Astrobytes and @UnnamedCodinGamer
[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 three space-separated
115              parameters:
116              <var>roadLength</var> <var>initialStones</var> <var>seed</var>
117            </p>
118            <dl style="margin: 1em;">
119              <dt>roadLength</dt>
120              <dd style="margin-left: 6em;">
121                distance between both castles, between <const>6</const>
122                and <const>14</const>.
123              </dd>
124              <dt>initialStones</dt>
125              <dd style="margin-left: 6em;">
126                number of stones a castle starts the day with,
127                between <const>0</const> and <const>50</const>.
128              </dd>
129              <dt>gameSeed</dt>
130              <dd style="margin-left: 6em;">
131                the game's seed.  The game AIs use it to provide you
132                with reproducible matches even when they use stochastic
133                algorithms, and you're encouraged to do the same!  See
134                examples section below for simple ways to achieve that.
135              </dd>
136            </dl>
137          </div>
138        </div>
139        <div class="blk">
140          <div class="title">Turn Input</div>
141          <div class="text">
142            <p>
143              At each turn, you are provided with the following three
144              space-separated values:
145              <var>trollDistance</var>
146              <var>stones</var>
147              <var>opponentStones</var>
148            </p>
149            <dl style="margin: 1em;">
150              <dt>trollDistance</dt>
151              <dd style="margin-left: 6em;">
152                distance between the troll and your castle
153              </dd>
154              <dt>stones</dt>
155              <dd style="margin-left: 6em;">
156                number of stones you have left
157              </dd>
158              <dt>opponentStones</dt>
159              <dd style="margin-left: 6em;">
160                number of stones your opponent has left
161              </dd>
162            </dl>
163          </div>
164        </div>
165        <div class="blk">
166          <div class="title">Turn Output</div>
167          <div class="text">
168            <p>
169              After having received your turn input, you are to output
170              a single integer <var>stones</var>: the number of stones
171              you wish to throw at the troll.
172            </p>
173            <p style="margin-top: 1ex">
174              You may optionally provide a <em>message</em> you wish
175              your castle to yell at the troll or at your opponent.
176              Just append it to your output, being sure to separate it
177              with at least one space.
178              <!-- It has no incidence on the game whatsoever.  Unless
179              you're god, that is. -->
180            </p>
181          </div>
182        </div>
183        <div class="blk">
184          <div class="title">Timing Considerations</div>
185          <div class="text">
186            <p>
187              You're currently allowed the default SDK timings.  I
188              think it's one second for the first turn and 50&nbsp;ms
189              then, but don't quote me on this.
190            </p>
191          </div>
192        </div>
193      </div>
194    </div>
195    <div class="statement-section statement-expertrules">
196      <h2>
197        <span class="icon icon-expertrules">&nbsp;</span>
198        <span>Expert rules</span>
199      </h2>
200      <div class="statement-expert-rules-content">
201        <p>
202          In the lower leagues, the following maps are currently
203          available and randomly yet extremely fairly (you wouldn't
204          believe the effort that went into this) chosen uniformly at
205          random among the following:
206        </p>
207        <table style="margin: 1ex">
208          <tr>
209            <th style="border-bottom: 2px dashed #f2bb13; min-width: 6em;">Road length</th>
210            <th style="border-bottom: 2px dashed #f2bb13; min-width: 6em;">Stones</th>
211          </tr>
212          <tr>
213            <td style="border-bottom: 1px dashed #f2bb13"><const>6</const></td>
214            <td style="border-bottom: 1px dashed #f2bb13"><const>15</const></td>
215          </tr>
216          <tr>
217            <td style="border-bottom: 1px dashed #f2bb13"><const>6</const></td>
218            <td style="border-bottom: 1px dashed #f2bb13"><const>30</const></td>
219          </tr>
220          <tr>
221            <td style="border-bottom: 1px dashed #f2bb13"><const>14</const></td>
222            <td style="border-bottom: 1px dashed #f2bb13"><const>30</const></td>
223          </tr>
224          <tr>
225            <td style="border-bottom: 1px dashed #f2bb13"><const>14</const></td>
226            <td style="border-bottom: 1px dashed #f2bb13"><const>50</const></td>
227          </tr>
228        </table>
229        <p>
230          You can also override them via game
231          settings <var>roadLength</var> and <var>initialStones</var>,
232          so long as you remember you won't be choosing them for
233          ranking play.
234        </p>
235      </div>
236    </div>
237    <div class="statement-section statement-protocol">
238      <h2>
239        <span class="icon icon-protocol">&nbsp;</span>
240        <span>Change Log</span>
241      </h2>
242      <p>
243        I'm not maintaining the full changelog here anymore as the
244        <a href="https://troll.desast.re/troll.git">game's source
245        repository</a> is now publicly available.  I'll just make note
246        of the single latest change, so you can know how far behind you
247        were lagging.  Patches welcome, BTW.
248      </p>
249      <p>
250        This draft's last change is:
251        <strong>
252          game seed is sent in inputs.
253        </strong>
254      </p>
255    </div>
256    <div class="statement-story-background">
257      <div class="statement-story"
258           style="position: relative; min-height: min-content">
259        <div class="story-text">
260          <div style="text-align: center">
261            &ldquo;Trolls simply detest the very sight of dwarves (uncooked).&rdquo;
262          </div>
263          <div style="text-align: right">
264            &mdash;&nbsp;J.R.R. Tolkien, <i>The Hobbit</i>
265          </div>
266        </div>
267        <div class="story-text" style="margin-top: 4em">
268          <p>
269            Based on an involuntary suggestion by
270            <span class="card" cg-codingamer-card-popup=""
271                  userid="user.codingamer.userId">
272              <a class="pseudo"
273                 href="/profile/dbfa96e0ac9b77a3db679628f27224ae8509333"
274                 title="Zaap38">Zaap38</a>
275            </span>
276            on the #Fr channel.  The original appears to be by
277            <a href="http://andre.lovichi.free.fr/teaching/ea/2015-2016/cours/troll/Trolls_et_chateaux.pdf">
278              Romain Andr&eacute;-Lovichi
279            </a>.
280          </p>
281        </div>
282      </div>
283    </div>
284 </div>