1 <div class="statement-body">
3 <div class="statement-section statement-goal">
5 <span class="icon icon-goal"> </span>
8 <div class="statement-goal-content">
9 Don't get destroyed by the troll.
13 <div class="statement-section statement-rules">
15 <span class="icon icon-rules"> </span>
18 <div class="statement-rules-content">
19 You <em>have</em> to shoot at least <const>1</const> stone per
20 turn if you have any left.
23 <div class="statement-section statement-warning">
25 <span class="icon icon-warning"> </span>
26 <span>Breaking Change</span>
29 The <var>roadLength</var> game input variable used to be the
30 cardinal number of positions the troll could be in. That's the
31 way it was presented in the original game, but I leaned more
32 towards distances to make the I/O protocol easier on beginners.
33 So it's currently inconsistent.
36 This is going to change in the following days to be a distance
37 everywhere, more in line with the protocol's other measures.
38 Not to mention being somewhat more consistent with the variable
40 <a href="https://www.codingame.com/profile/c4a50746f425cb125f77487aaf51350c7258821">
43 for reminding me of this.
46 If you used this variable, I suggest you temporarily used one
47 of these workarounds so you don't get bit by the upcoming
51 <tr><th>Former use</th><th>As a</th><th>Try this</th></tr>
53 <td><pre>roadLength - 1</pre></td>
54 <td><pre>distance to opponent</pre></td>
55 <td><pre>roadLength & (~1)</pre></td>
58 <td><pre>roadLength</pre></td>
59 <td><pre>number of troll states</pre></td>
60 <td><pre>roadLength | 1</pre></td>
63 <td><pre>roadLength + 1</pre></td>
64 <td><pre>I have no idea</pre></td>
65 <td><pre>(roadLength + 1) & (-1)</pre></td>
69 <div class="statement-section statement-warning">
71 <span class="icon icon-warning"> </span>
72 <span>Rule Evolution</span>
74 <div class="statement-warning-content">
75 The following ideas are still in flux, waiting for some
76 opinions. Please drop a word on the
77 <a href="https://www.codingame.com/contribute/view/507070b7925f661e2d2835c14f950b9d157e">
81 <a href="https://forum.codingame.com/t/troll-vs-castles-brainstorm/184827?u=jbm">
86 Is it even worth publishing? can the problem be totally solved?
89 More maps? (a map is a {road length} × {initial stone count} pair)
92 Leagues? I could conceive the referee being permissive
93 (allow 0 stones thrown) in the first one, and then strict.
96 Fog of war? (see only troll position, not enemy throw/stones left)
99 <strong>variable</strong> for of war? (seeing enemy stones
100 is a boolean decided randomly as part of the map?
103 alternative fog of war? (seeing enemy stones only when
104 troll is close to us?)
107 Praise for my artistic skillz
115 <div class="statement-victory-conditions">
116 <div class="icon victory"></div>
118 <div class="title">Victory Condition</div>
119 <div class="text">Your opponent loses.</div>
122 <div class="statement-lose-conditions">
123 <div class="icon lose"></div>
125 <div class="title">Defeat Condition</div>
127 <li>The troll reaches your castle.</li>
128 <li>When no player has stones left, the troll is closer to your castle.</li>
132 <div class="statement-section statement-protocol">
134 <span class="icon icon-protocol"> </span>
135 <span>I/O Protocol</span>
137 <div class="statement-protocol-content">
138 Just read the sample code. You can figure this out.
141 <div class="statement-section statement-expertrules">
143 <span class="icon icon-expertrules"> </span>
146 <div class="statement-expert-rules-content">
148 The following maps are currently available and randomly yet
149 extremely fairly (you wouldn't believe the effort that went
150 into this) chosen uniformly at random among the following:
153 <tr><th>Road length</th><th>Stones</th></tr>
154 <tr><td><const>7</const></td><td><const>15</const></td></tr>
155 <tr><td><const>7</const></td><td><const>30</const></td></tr>
156 <tr><td><const>15</const></td><td><const>30</const></td></tr>
157 <tr><td><const>15</const></td><td><const>50</const></td></tr>
160 As with anything in this <em>draft</em> statement, this
161 is <strong>subject to change without notice</strong>. Why do
162 you think they're provided in the game input?
166 <div class="statement-section statement-protocol">
168 <span class="icon icon-protocol"> </span>
169 <span>Change Log</span>
173 Of course that game needed MSG functionality!
176 Enforce the one-stone rule. (that also fixed the legacy
177 buh—sorry people! I put an easter egg in exchange)
180 Cutesy defeat animations.
183 Distinct castle sprites!
186 Terminate game when there are no more stones in sight.
189 More pretty. (SRLSLY)
192 No more void maps. (root cause: Java <const>%</const> on a
197 <div class="statement-story-background">
198 <div class="statement-story"
199 style="position: relative; min-height: min-content">
200 <div class="story-text">
201 Based on an involuntary suggestion by
202 <span class="card" cg-codingamer-card-popup=""
203 userid="user.codingamer.userId">
205 href="/profile/dbfa96e0ac9b77a3db679628f27224ae8509333"
206 title="Zaap38">Zaap38</a>
208 on the #Fr channel. The original appears to be by
209 <a href="http://andre.lovichi.free.fr/teaching/ea/2015-2016/cours/troll/Trolls_et_chateaux.pdf">
210 Romain André-Lovichi