This place used to read: “Just read the sample code. You can figure this out.” Here are the formalities for that other part of the audience.
Your first line of input contains three space-separated parameters: roadLength initialStones seed
At each turn, you are provided with the following three space-separated values: trollDistance stones opponentStones
After having received your turn input, you are to output a single integer stones: the number of stones you wish to throw at the troll.
You may optionally provide a message 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.
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.
In the lower leagues, the following maps are currently available and randomly yet extremely fairly (you wouldn't believe the effort that went into this) chosen uniformly at random among the following:
Road length | Stones |
---|---|
You can also override them via game settings roadLength and initialStones, so long as you remember you won't be choosing them for ranking play.
I'm not maintaining the full changelog here anymore as the game's source repository is now publicly available. I'll just make note of the single latest change, so you can know how far behind you were lagging. Patches welcome, BTW.
This draft's last change is: game seed is sent in inputs.
Based on an involuntary suggestion by Zaap38 on the #Fr channel. The original appears to be by Romain André-Lovichi .