.
This commit is contained in:
parent
9b789f3716
commit
dd334d2c67
|
@ -35,11 +35,175 @@ Ainsi, vous pouvez pousser le délire jusqu'à faire un algorythme qui s'adapte
|
||||||
{"name":"gnieark","boats":["4,2-4,6","3,3-3,0","2,3-2,1","7,9-5,9","6,8-6,7"]}
|
{"name":"gnieark","boats":["4,2-4,6","3,3-3,0","2,3-2,1","7,9-5,9","6,8-6,7"]}
|
||||||
</pre>
|
</pre>
|
||||||
<ul>
|
<ul>
|
||||||
<li><em>name</em> le nom de votre bot (actuellment non pris en compte par cette arène).</li>
|
<li><em>name</em> Le nom de votre bot (actuellment non pris en compte par cette arène).</li>
|
||||||
<li><em>boats</em></li>
|
<li><em>boats</em> Tableau indiquant le placement de vos bateaux</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>L'arène ne vérifie pas actuellement cette réponse, l'étape d'init a été insérée pour assurer la compatibilité avec <a href="https://github.com/moul/bolosseum">Bolosseum</a>.
|
<ul>
|
||||||
Si votre bot repond une page blanche à cette étape (action=init), ça marchera dans le cadre de botsarena.</p>
|
<h3>boats</h3>
|
||||||
|
<li>La grille commence au point 0,0.</li>
|
||||||
|
<li>Les entiers, ordonnée et abscisses, définissant un point, sont séparés d'une virgule ",".</li>
|
||||||
|
<li>Les deux points définissant les extrémités d'un navire sont séparés par un tiret "-".</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Exemple de placement de 5 bateaux tailles respectives 5, 4, 3, 3, 2 cases :</h4>
|
||||||
|
<pre>
|
||||||
|
["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"]
|
||||||
|
</pre>
|
||||||
|
<p>
|
||||||
|
Bien évidemment si vos bateaux se chevauchent, ou si leur nombre et leur longueur ne correspond pas à la demande de l'arène, vous perdez la partie.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
L'ordre des bateaux n'a pas d'importance.<br/>
|
||||||
|
De la même manière, pour un bateau, l'ordre de ses points n'importe pas non plus.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Vu sur la grille, l'exemple précédent donnerait :
|
||||||
|
</p>
|
||||||
|
<table class="battleshipGrid nofloat" id="tbl1">
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>0</td>
|
||||||
|
<td>1</td>
|
||||||
|
<td>2</td>
|
||||||
|
<td>3</td>
|
||||||
|
<td>4</td>
|
||||||
|
<td>5</td>
|
||||||
|
<td>6</td>
|
||||||
|
<td>7</td>
|
||||||
|
<td>8</td>
|
||||||
|
<td>9</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>0</td>
|
||||||
|
<td class="empty" id="bot1-0-0"></td>
|
||||||
|
<td class="shipOn" id="bot1-0-1"></td>
|
||||||
|
<td class="shipOn" id="bot1-0-2"></td>
|
||||||
|
<td class="shipOn" id="bot1-0-3"></td>
|
||||||
|
<td class="empty" id="bot1-0-4"></td>
|
||||||
|
<td class="empty" id="bot1-0-5"></td>
|
||||||
|
<td class="empty" id="bot1-0-6"></td>
|
||||||
|
<td class="empty" id="bot1-0-7"></td>
|
||||||
|
<td class="empty" id="bot1-0-8"></td>
|
||||||
|
<td class="empty" id="bot1-0-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>1</td>
|
||||||
|
<td class="empty" id="bot1-1-0"></td>
|
||||||
|
<td class="empty" id="bot1-1-1"></td>
|
||||||
|
<td class="empty" id="bot1-1-2"></td>
|
||||||
|
<td class="empty" id="bot1-1-3"></td>
|
||||||
|
<td class="empty" id="bot1-1-4"></td>
|
||||||
|
<td class="empty" id="bot1-1-5"></td>
|
||||||
|
<td class="empty" id="bot1-1-6"></td>
|
||||||
|
<td class="empty" id="bot1-1-7"></td>
|
||||||
|
<td class="empty" id="bot1-1-8"></td>
|
||||||
|
<td class="empty" id="bot1-1-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>2</td>
|
||||||
|
<td class="empty" id="bot1-2-0"></td>
|
||||||
|
<td class="shipOn" id="bot1-2-1"></td>
|
||||||
|
<td class="shipOn" id="bot1-2-2"></td>
|
||||||
|
<td class="shipOn" id="bot1-2-3"></td>
|
||||||
|
<td class="shipOn" id="bot1-2-4"></td>
|
||||||
|
<td class="empty" id="bot1-2-5"></td>
|
||||||
|
<td class="empty" id="bot1-2-6"></td>
|
||||||
|
<td class="empty" id="bot1-2-7"></td>
|
||||||
|
<td class="empty" id="bot1-2-8"></td>
|
||||||
|
<td class="empty" id="bot1-2-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>3</td>
|
||||||
|
<td class="empty" id="bot1-3-0"></td>
|
||||||
|
<td class="empty" id="bot1-3-1"></td>
|
||||||
|
<td class="empty" id="bot1-3-2"></td>
|
||||||
|
<td class="shipOn" id="bot1-3-3"></td>
|
||||||
|
<td class="shipOn" id="bot1-3-4"></td>
|
||||||
|
<td class="shipOn" id="bot1-3-5"></td>
|
||||||
|
<td class="shipOn" id="bot1-3-6"></td>
|
||||||
|
<td class="shipOn" id="bot1-3-7"></td>
|
||||||
|
<td class="empty" id="bot1-3-8"></td>
|
||||||
|
<td class="empty" id="bot1-3-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>4</td>
|
||||||
|
<td class="empty" id="bot1-4-0"></td>
|
||||||
|
<td class="empty" id="bot1-4-1"></td>
|
||||||
|
<td class="empty" id="bot1-4-2"></td>
|
||||||
|
<td class="empty" id="bot1-4-3"></td>
|
||||||
|
<td class="empty" id="bot1-4-4"></td>
|
||||||
|
<td class="empty" id="bot1-4-5"></td>
|
||||||
|
<td class="empty" id="bot1-4-6"></td>
|
||||||
|
<td class="empty" id="bot1-4-7"></td>
|
||||||
|
<td class="empty" id="bot1-4-8"></td>
|
||||||
|
<td class="empty" id="bot1-4-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>5</td>
|
||||||
|
<td class="empty" id="bot1-5-0"></td>
|
||||||
|
<td class="empty" id="bot1-5-1"></td>
|
||||||
|
<td class="empty" id="bot1-5-2"></td>
|
||||||
|
<td class="empty" id="bot1-5-3"></td>
|
||||||
|
<td class="empty" id="bot1-5-4"></td>
|
||||||
|
<td class="empty" id="bot1-5-5"></td>
|
||||||
|
<td class="empty" id="bot1-5-6"></td>
|
||||||
|
<td class="empty" id="bot1-5-7"></td>
|
||||||
|
<td class="empty" id="bot1-5-8"></td>
|
||||||
|
<td class="empty" id="bot1-5-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>6</td>
|
||||||
|
<td class="empty" id="bot1-6-0"></td>
|
||||||
|
<td class="empty" id="bot1-6-1"></td>
|
||||||
|
<td class="empty" id="bot1-6-2"></td>
|
||||||
|
<td class="empty" id="bot1-6-3"></td>
|
||||||
|
<td class="empty" id="bot1-6-4"></td>
|
||||||
|
<td class="empty" id="bot1-6-5"></td>
|
||||||
|
<td class="empty" id="bot1-6-6"></td>
|
||||||
|
<td class="empty" id="bot1-6-7"></td>
|
||||||
|
<td class="empty" id="bot1-6-8"></td>
|
||||||
|
<td class="empty" id="bot1-6-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>7</td>
|
||||||
|
<td class="empty" id="bot1-7-0"></td>
|
||||||
|
<td class="shipOn" id="bot1-7-1"></td>
|
||||||
|
<td class="shipOn" id="bot1-7-2"></td>
|
||||||
|
<td class="shipOn" id="bot1-7-3"></td>
|
||||||
|
<td class="empty" id="bot1-7-4"></td>
|
||||||
|
<td class="empty" id="bot1-7-5"></td>
|
||||||
|
<td class="empty" id="bot1-7-6"></td>
|
||||||
|
<td class="empty" id="bot1-7-7"></td>
|
||||||
|
<td class="shipOn" id="bot1-7-8"></td>
|
||||||
|
<td class="empty" id="bot1-7-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>8</td>
|
||||||
|
<td class="empty" id="bot1-8-0"></td>
|
||||||
|
<td class="empty" id="bot1-8-1"></td>
|
||||||
|
<td class="empty" id="bot1-8-2"></td>
|
||||||
|
<td class="empty" id="bot1-8-3"></td>
|
||||||
|
<td class="empty" id="bot1-8-4"></td>
|
||||||
|
<td class="empty" id="bot1-8-5"></td>
|
||||||
|
<td class="empty" id="bot1-8-6"></td>
|
||||||
|
<td class="empty" id="bot1-8-7"></td>
|
||||||
|
<td class="shipOn" id="bot1-8-8"></td>
|
||||||
|
<td class="empty" id="bot1-8-9"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>9</td>
|
||||||
|
<td class="empty" id="bot1-9-0"></td>
|
||||||
|
<td class="empty" id="bot1-9-1"></td>
|
||||||
|
<td class="empty" id="bot1-9-2"></td>
|
||||||
|
<td class="empty" id="bot1-9-3"></td>
|
||||||
|
<td class="empty" id="bot1-9-4"></td>
|
||||||
|
<td class="empty" id="bot1-9-5"></td>
|
||||||
|
<td class="empty" id="bot1-9-6"></td>
|
||||||
|
<td class="empty" id="bot1-9-7"></td>
|
||||||
|
<td class="empty" id="bot1-9-8"></td>
|
||||||
|
<td class="empty" id="bot1-9-9"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<h3>Message vous demandant de jouer (seulement un tour)</h3>
|
<h3>Message vous demandant de jouer (seulement un tour)</h3>
|
||||||
<p>L'arène vous envoie par exemple le message suivant:</p>
|
<p>L'arène vous envoie par exemple le message suivant:</p>
|
||||||
<pre>{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"","0-2":"","1-0":"","1-1":"","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0}</pre>
|
<pre>{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"","0-2":"","1-0":"","1-1":"","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0}</pre>
|
||||||
|
@ -355,170 +519,7 @@ Match nul
|
||||||
Vous retournez une chaine de caractères qui est un tableau JSON ayant autant d'enregistrements que de navires.<br/>
|
Vous retournez une chaine de caractères qui est un tableau JSON ayant autant d'enregistrements que de navires.<br/>
|
||||||
Chaque navire est défini par les coordonnées de ses extrémités.
|
Chaque navire est défini par les coordonnées de ses extrémités.
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
|
||||||
<li>La grille commence au point 0,0.</li>
|
|
||||||
<li>Les entiers, ordonnée et abscisses, définissant un point, sont séparés d'une virgule ",".</li>
|
|
||||||
<li>Les deux points définissant les extrémités d'un navire sont séparés par un tiret "-".</li>
|
|
||||||
</ul>
|
|
||||||
<h4>Exemple de placement de 5 bateaux tailles respectives 5, 4, 3, 3, 2 cases :</h4>
|
|
||||||
<pre>
|
|
||||||
["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"]
|
|
||||||
</pre>
|
|
||||||
<p>
|
|
||||||
Bien évidemment si vos bateaux se chevauchent, ou si leur nombre et leur longueur ne correspond pas à la demande de l'arène, vous perdez la partie.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
L'ordre des bateaux n'a pas d'importance.<br/>
|
|
||||||
De la même manière, pour un bateau, l'ordre de ses points n'importe pas non plus.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Vu sur la grille, l'exemple précédent donnerait :
|
|
||||||
</p>
|
|
||||||
<table class="battleshipGrid nofloat" id="tbl1">
|
|
||||||
<tr>
|
|
||||||
<td></td>
|
|
||||||
<td>0</td>
|
|
||||||
<td>1</td>
|
|
||||||
<td>2</td>
|
|
||||||
<td>3</td>
|
|
||||||
<td>4</td>
|
|
||||||
<td>5</td>
|
|
||||||
<td>6</td>
|
|
||||||
<td>7</td>
|
|
||||||
<td>8</td>
|
|
||||||
<td>9</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>0</td>
|
|
||||||
<td class="empty" id="bot1-0-0"></td>
|
|
||||||
<td class="shipOn" id="bot1-0-1"></td>
|
|
||||||
<td class="shipOn" id="bot1-0-2"></td>
|
|
||||||
<td class="shipOn" id="bot1-0-3"></td>
|
|
||||||
<td class="empty" id="bot1-0-4"></td>
|
|
||||||
<td class="empty" id="bot1-0-5"></td>
|
|
||||||
<td class="empty" id="bot1-0-6"></td>
|
|
||||||
<td class="empty" id="bot1-0-7"></td>
|
|
||||||
<td class="empty" id="bot1-0-8"></td>
|
|
||||||
<td class="empty" id="bot1-0-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1</td>
|
|
||||||
<td class="empty" id="bot1-1-0"></td>
|
|
||||||
<td class="empty" id="bot1-1-1"></td>
|
|
||||||
<td class="empty" id="bot1-1-2"></td>
|
|
||||||
<td class="empty" id="bot1-1-3"></td>
|
|
||||||
<td class="empty" id="bot1-1-4"></td>
|
|
||||||
<td class="empty" id="bot1-1-5"></td>
|
|
||||||
<td class="empty" id="bot1-1-6"></td>
|
|
||||||
<td class="empty" id="bot1-1-7"></td>
|
|
||||||
<td class="empty" id="bot1-1-8"></td>
|
|
||||||
<td class="empty" id="bot1-1-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>2</td>
|
|
||||||
<td class="empty" id="bot1-2-0"></td>
|
|
||||||
<td class="shipOn" id="bot1-2-1"></td>
|
|
||||||
<td class="shipOn" id="bot1-2-2"></td>
|
|
||||||
<td class="shipOn" id="bot1-2-3"></td>
|
|
||||||
<td class="shipOn" id="bot1-2-4"></td>
|
|
||||||
<td class="empty" id="bot1-2-5"></td>
|
|
||||||
<td class="empty" id="bot1-2-6"></td>
|
|
||||||
<td class="empty" id="bot1-2-7"></td>
|
|
||||||
<td class="empty" id="bot1-2-8"></td>
|
|
||||||
<td class="empty" id="bot1-2-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>3</td>
|
|
||||||
<td class="empty" id="bot1-3-0"></td>
|
|
||||||
<td class="empty" id="bot1-3-1"></td>
|
|
||||||
<td class="empty" id="bot1-3-2"></td>
|
|
||||||
<td class="shipOn" id="bot1-3-3"></td>
|
|
||||||
<td class="shipOn" id="bot1-3-4"></td>
|
|
||||||
<td class="shipOn" id="bot1-3-5"></td>
|
|
||||||
<td class="shipOn" id="bot1-3-6"></td>
|
|
||||||
<td class="shipOn" id="bot1-3-7"></td>
|
|
||||||
<td class="empty" id="bot1-3-8"></td>
|
|
||||||
<td class="empty" id="bot1-3-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>4</td>
|
|
||||||
<td class="empty" id="bot1-4-0"></td>
|
|
||||||
<td class="empty" id="bot1-4-1"></td>
|
|
||||||
<td class="empty" id="bot1-4-2"></td>
|
|
||||||
<td class="empty" id="bot1-4-3"></td>
|
|
||||||
<td class="empty" id="bot1-4-4"></td>
|
|
||||||
<td class="empty" id="bot1-4-5"></td>
|
|
||||||
<td class="empty" id="bot1-4-6"></td>
|
|
||||||
<td class="empty" id="bot1-4-7"></td>
|
|
||||||
<td class="empty" id="bot1-4-8"></td>
|
|
||||||
<td class="empty" id="bot1-4-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>5</td>
|
|
||||||
<td class="empty" id="bot1-5-0"></td>
|
|
||||||
<td class="empty" id="bot1-5-1"></td>
|
|
||||||
<td class="empty" id="bot1-5-2"></td>
|
|
||||||
<td class="empty" id="bot1-5-3"></td>
|
|
||||||
<td class="empty" id="bot1-5-4"></td>
|
|
||||||
<td class="empty" id="bot1-5-5"></td>
|
|
||||||
<td class="empty" id="bot1-5-6"></td>
|
|
||||||
<td class="empty" id="bot1-5-7"></td>
|
|
||||||
<td class="empty" id="bot1-5-8"></td>
|
|
||||||
<td class="empty" id="bot1-5-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>6</td>
|
|
||||||
<td class="empty" id="bot1-6-0"></td>
|
|
||||||
<td class="empty" id="bot1-6-1"></td>
|
|
||||||
<td class="empty" id="bot1-6-2"></td>
|
|
||||||
<td class="empty" id="bot1-6-3"></td>
|
|
||||||
<td class="empty" id="bot1-6-4"></td>
|
|
||||||
<td class="empty" id="bot1-6-5"></td>
|
|
||||||
<td class="empty" id="bot1-6-6"></td>
|
|
||||||
<td class="empty" id="bot1-6-7"></td>
|
|
||||||
<td class="empty" id="bot1-6-8"></td>
|
|
||||||
<td class="empty" id="bot1-6-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>7</td>
|
|
||||||
<td class="empty" id="bot1-7-0"></td>
|
|
||||||
<td class="shipOn" id="bot1-7-1"></td>
|
|
||||||
<td class="shipOn" id="bot1-7-2"></td>
|
|
||||||
<td class="shipOn" id="bot1-7-3"></td>
|
|
||||||
<td class="empty" id="bot1-7-4"></td>
|
|
||||||
<td class="empty" id="bot1-7-5"></td>
|
|
||||||
<td class="empty" id="bot1-7-6"></td>
|
|
||||||
<td class="empty" id="bot1-7-7"></td>
|
|
||||||
<td class="shipOn" id="bot1-7-8"></td>
|
|
||||||
<td class="empty" id="bot1-7-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>8</td>
|
|
||||||
<td class="empty" id="bot1-8-0"></td>
|
|
||||||
<td class="empty" id="bot1-8-1"></td>
|
|
||||||
<td class="empty" id="bot1-8-2"></td>
|
|
||||||
<td class="empty" id="bot1-8-3"></td>
|
|
||||||
<td class="empty" id="bot1-8-4"></td>
|
|
||||||
<td class="empty" id="bot1-8-5"></td>
|
|
||||||
<td class="empty" id="bot1-8-6"></td>
|
|
||||||
<td class="empty" id="bot1-8-7"></td>
|
|
||||||
<td class="shipOn" id="bot1-8-8"></td>
|
|
||||||
<td class="empty" id="bot1-8-9"></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>9</td>
|
|
||||||
<td class="empty" id="bot1-9-0"></td>
|
|
||||||
<td class="empty" id="bot1-9-1"></td>
|
|
||||||
<td class="empty" id="bot1-9-2"></td>
|
|
||||||
<td class="empty" id="bot1-9-3"></td>
|
|
||||||
<td class="empty" id="bot1-9-4"></td>
|
|
||||||
<td class="empty" id="bot1-9-5"></td>
|
|
||||||
<td class="empty" id="bot1-9-6"></td>
|
|
||||||
<td class="empty" id="bot1-9-7"></td>
|
|
||||||
<td class="empty" id="bot1-9-8"></td>
|
|
||||||
<td class="empty" id="bot1-9-9"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<h3>Lors du combat</h3>
|
<h3>Lors du combat</h3>
|
||||||
<p>
|
<p>
|
||||||
Voici quelques exemples des parametres envoyés par l'arène.
|
Voici quelques exemples des parametres envoyés par l'arène.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user