This commit is contained in:
Gnieark 2016-05-30 20:04:28 +02:00
parent a159776681
commit db5afc8c67
2 changed files with 53 additions and 38 deletions

View File

@ -32,9 +32,7 @@
<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> <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>
{"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>
<ul> <ul>
<li><i>game-id</i> string identifiant la partie</li> <li><i>game-id</i> string identifiant la partie</li>
<li><i>action</i> string identifiant la phase, <i>play-turn</i> tout de suite, qui vous indique que vous devez jouer</li> <li><i>action</i> string identifiant la phase, <i>play-turn</i> tout de suite, qui vous indique que vous devez jouer</li>
@ -45,94 +43,109 @@
<li><i>player-index</i>int, L'ordre de votre bot dans les tours de jeu. Le premier joueur a la valeur 0, le deuxième 1.</li> <li><i>player-index</i>int, L'ordre de votre bot dans les tours de jeu. Le premier joueur a la valeur 0, le deuxième 1.</li>
</ul> </ul>
<h4>la map</h4> <h4>la map</h4>
<p>Elle est représenté par un sous-tableau. Les index correspondent aux coordonnées x-y de la case. les valeurs peuvent &ecirc;tre:</p>
<ul>
<li>Vide, personne n'a joué à cette case</li>
<li>"X" ou "O", le joueur ayant ce symbole a déjà joué cette case.</li>
</ul>
<h2>Exemple de partie</h2> <h2>Exemple de partie</h2>
<pre> <pre class="arrenaMessage">
{"game-id":"1126","action":"init","game":"tictactoe","players":2,"board":"","player-index":0} {"game-id":"1126","action":"init","game":"tictactoe","players":2,"board":"","player-index":0}
</pre>
<pre class="botResponse">
{"name":"moul-tictactoe","play":null,"error":null} {"name":"moul-tictactoe","play":null,"error":null}
</pre>
<pre class="arrenaMessage">
{"game-id":"1126","action":"init","game":"tictactoe","players":2,"board":"","player-index":1} {"game-id":"1126","action":"init","game":"tictactoe","players":2,"board":"","player-index":1}
</pre>
<pre class="botResponse">
{"name":"moul-tictactoe","play":null,"error":null} {"name":"moul-tictactoe","play":null,"error":null}
</pre>
<pre class="arrenaMessage">
{"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} {"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 class="botResponse">
{"name":"","play":"0-1","error":null} {"name":"","play":"0-1","error":null}
</pre>
moul2 joue en 0-1 la nouvelle grille est moul2 joue en 0-1 la nouvelle grille est
X X
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"X","0-2":"","1-0":"","1-1":"","1-2":"","2-0":"","2-1":"","2-2":""},"you":"O","player-index":1} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"X","0-2":"","1-0":"","1-1":"","1-2":"","2-0":"","2-1":"","2-2":""},"you":"O","player-index":1}
</pre>
<pre class="botResponse">
{"name":"","play":"1-1","error":null} {"name":"","play":"1-1","error":null}
</pre>
moul2 joue en 1-1 la nouvelle grille est moul2 joue en 1-1 la nouvelle grille est
X X
O O
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"X","0-2":"","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"","0-1":"X","0-2":"","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0}
</pre>
<pre class="botResponse">
{"name":"","play":"0-0","error":null} {"name":"","play":"0-0","error":null}
</pre>
moul2 joue en 0-0 la nouvelle grille est moul2 joue en 0-0 la nouvelle grille est
X X X X
O O
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"O","player-index":1} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"O","player-index":1}
</pre>
<pre class="botResponse">
{"name":"","play":"0-2","error":null} {"name":"","play":"0-2","error":null}
</pre>
moul2 joue en 0-2 la nouvelle grille est moul2 joue en 0-2 la nouvelle grille est
X X O X X O
O O
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"","1-1":"O","1-2":"","2-0":"","2-1":"","2-2":""},"you":"X","player-index":0}
</pre>
<pre class="botResponse">
{"name":"","play":"2-0","error":null} {"name":"","play":"2-0","error":null}
</pre>
moul2 joue en 2-0 la nouvelle grille est moul2 joue en 2-0 la nouvelle grille est
X X O X X O
O O
X X
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"","1-1":"O","1-2":"","2-0":"X","2-1":"","2-2":""},"you":"O","player-index":1} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"","1-1":"O","1-2":"","2-0":"X","2-1":"","2-2":""},"you":"O","player-index":1}
</pre>
<pre class="botResponse">
{"name":"","play":"1-0","error":null} {"name":"","play":"1-0","error":null}
</pre>
moul2 joue en 1-0 la nouvelle grille est moul2 joue en 1-0 la nouvelle grille est
X X O X X O
O O O O
X X
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"","2-0":"X","2-1":"","2-2":""},"you":"X","player-index":0} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"","2-0":"X","2-1":"","2-2":""},"you":"X","player-index":0}
</pre>
<pre class="botResponse">
{"name":"","play":"1-2","error":null} {"name":"","play":"1-2","error":null}
</pre>
moul2 joue en 1-2 la nouvelle grille est moul2 joue en 1-2 la nouvelle grille est
X X O X X O
O O X O O X
X X
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"X","2-0":"X","2-1":"","2-2":""},"you":"O","player-index":1} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"X","2-0":"X","2-1":"","2-2":""},"you":"O","player-index":1}
</pre>
<pre class="botResponse">
{"name":"","play":"2-1","error":null} {"name":"","play":"2-1","error":null}
</pre>
moul2 joue en 2-1 la nouvelle grille est moul2 joue en 2-1 la nouvelle grille est
X X O X X O
O O X O O X
X O X O
<pre class="arrenaMessage">
{"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"X","2-0":"X","2-1":"O","2-2":""},"you":"X","player-index":0} {"game-id":"1126","action":"play-turn","game":"tictactoe","players":2,"board":{"0-0":"X","0-1":"X","0-2":"O","1-0":"O","1-1":"O","1-2":"X","2-0":"X","2-1":"O","2-2":""},"you":"X","player-index":0}
</pre>
<pre class="botResponse">
{"name":"","play":"2-2","error":null} {"name":"","play":"2-2","error":null}
</pre>
moul2 joue en 2-2 la nouvelle grille est moul2 joue en 2-2 la nouvelle grille est
X X O X X O
O O X O O X

View File

@ -3,3 +3,5 @@ td {min-width: 10px; height: 10px;}
.cellj2{border-top:1px dotted black;} .cellj2{border-top:1px dotted black;}
.celli0{border-right:1px dotted black;} .celli0{border-right:1px dotted black;}
.celli2{border-left:1px dotted black;} .celli2{border-left:1px dotted black;}
.arrenaMessage{color: green;}
.botResponse{color: red;}