This commit is contained in:
Gnieark 2015-12-20 19:45:54 +01:00
parent edaa05ab90
commit a53303f279

View File

@ -74,33 +74,25 @@ Chaque navire est défini par les coordonnées de ses extrémités.</p>
<li>Les entiers; ordonnée et abscisses définissant un point sont séparés d'une virgule &quot;,&quot;.</li> <li>Les entiers; ordonnée et abscisses définissant un point sont séparés d'une virgule &quot;,&quot;.</li>
<li>Les deux points définissant les extrémités d'un navire sont séparés par un tiret &quot;-&quot;.</li> <li>Les deux points définissant les extrémités d'un navire sont séparés par un tiret &quot;-&quot;.</li>
</ul> </ul>
<h4>Exemple:</h4> <h4>Exemple de placement de 5 bateaux tailles respectives 5, 4, 3, 3, 2 cases:</h4>
<pre> <pre>
["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"] ["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"]
</pre> </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. 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"> <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></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="empty" id="bot1-0-2"></td><td class="empty" 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>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="shipOn" 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>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="empty" id="bot1-2-2"></td><td class="empty" id="bot1-2-3"></td><td class="empty" 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>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="shipOn" id="bot1-3-1"></td><td class="empty" id="bot1-3-2"></td><td class="empty" id="bot1-3-3"></td><td class="empty" id="bot1-3-4"></td><td class="empty" id="bot1-3-5"></td><td class="empty" id="bot1-3-6"></td><td class="empty" id="bot1-3-7"></td><td class="empty" id="bot1-3-8"></td><td class="empty" id="bot1-3-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="shipOn" id="bot1-4-2"></td><td class="shipOn" 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>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>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="shipOn" id="bot1-6-3"></td><td class="shipOn" id="bot1-6-4"></td><td class="shipOn" 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>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="empty" id="bot1-7-1"></td><td class="empty" id="bot1-7-2"></td><td class="empty" 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="empty" id="bot1-7-8"></td><td class="empty" id="bot1-7-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="empty" id="bot1-8-8"></td><td class="empty" id="bot1-8-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> <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> </table>
<p>largeur; 10, hauteur 10; 3 bateaux:</p>
<ul>
<li>Bateau de 4 cases ayant pour extrémités 1,0 et 1,3. sera noté &quot;1,0-1,3&quot; ou &quot;1,3-1,0&quot;</li>
<li>Bateau de 2 cases ayant pour extrémités 2,4 et 3,4. sera noté &quot;2,4-3,4&quot; ou &quot;3,4-2,4&quot;</li>
<li>Bateau de 3 cases ayant pour extrémités 3,6 et 5,6. sera noté &quot;3,6-5,6&quot; ou &quot;5,6-3,6&quot;</li>
</ul>
<p>Pour placer ces 3 bateaux, vous devez retourner au format JSON le tableau suivant:</p>
<pre>
&#91;&quot;1,0-1,3&quot;,&quot;2,4-3,4&quot;,&quot;3,6-5,6&quot;&#93;
</pre>