diff --git a/src/arenas/Battleship/doc-en.html b/src/arenas/Battleship/doc-en.html index 0799f92..0c26435 100644 --- a/src/arenas/Battleship/doc-en.html +++ b/src/arenas/Battleship/doc-en.html @@ -1,106 +1,324 @@ -
Battleship is played in two steps:
Ces derniers doivent répondre selon les spécifications ci dessous -At each turn of the game, Arena makes http(s) queries to your bots. This queries contains POST parameters. Your bots have to answer as it is specified here.
-POST parameter | Description |
---|---|
game | string, always "Battleship". Is needed if your bot URL is used for several games. |
match_id | string, matches this regex: ^[0-9]+-(1|2)$ -First number (digits before hyphen) logs the match. Number after hyphen logs the bot.If you are the first player it's "1", otherwhise "2". -It could be usefull if you want to make statistics |
act | Can have two values: -
|
opponent | -Your opponent's authentification string -Chaîne de caractères identifiant votre adversaire. Ainsi, vous pouvez pousser le délire jusqu'à faire un algorythme qui s'adapte en fonction de l'adversaire et de l'historique des combats avec ce dernier. |
width | Entier, compris entre 1 et 100, bornes incluses, vous indique la largeur de la map. | -
height | Entier, compris entre 1 et 100, bornes incluses, Vous indique la hauteur de la map. |
ship1 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 1 case à placer. |
ship2 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 2 cases à placer. |
ship3 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 3 cases à placer. |
... | ... |
ship6 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 6 cases à placer. |
your_strikes | -
- chaîne de caractères représentant un array au format JSON. [ ] -Lors du deuxième tour de jeu, il contient le tir précédent et son résultat: -[{"target":"2,0","result":""}] -Lors du troisième tour de jeu, les deux tirs précédents -[{"target":"2,0","result":"hit"},{"target":"5,1","result":"hit"}] -Chaque tir est un sous array pour lesquels: -
|
his_strikes | idem sauf qu'il s'agit du tir de l'adversaire. |
Lors de l'initialisation d'une partie StupidIA VS StupidsIA, l'arène a envoyé au bot les parametres POST suivants:
-game=Battleship&match_id=828-1&act=init&opponent=stupidIA&width=10&height=10&ship1=0&ship2=1&ship3=2&ship4=1&ship5=1&ship6=0-
Soit, sous forme plus lisible:
--[game] => Battleship -[match_id] => 828-1 -[act] => init -[opponent] => stupidIA -[width] => 10 -[height] => 10 -[ship1] => 0 -[ship2] => 1 -[ship3] => 2 -[ship4] => 1 -[ship5] => 1 -[ship6] => 0 -- -
La page http que doit générer votre bot contient la position des navires.
-Vous retournez une chaine de caractères codant tableau JSON ayant autant d'enregistrements que de navires. -Chaque navire est défini par les coordonnées de ses extrémités.
++ Battleship is played in two stages : +
-["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"] -- -
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
-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.
-Vu sur la grille, l'exemple précédent donnerait:
-0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
0 | ||||||||||
1 | ||||||||||
2 | ||||||||||
3 | ||||||||||
4 | ||||||||||
5 | ||||||||||
6 | ||||||||||
7 | ||||||||||
8 | ||||||||||
9 |
Parameter | +Description | +
---|---|
game | +
+ String, will always "Battleship". + Can be used if your url is used for several games. + |
+
match_id | +
+ String. Match the following regular expression : ^[0-9]+-(1|2)$ + The first number (digits before the hyphen) identified the game. + The number after the hyphen indicates whether you are the first or second bot in the order to play. + It will serve you if your AI makes statistics on games. + |
+
act | +
+ Can take two values : +
|
+
opponent | +
+ String identifying your opponent. + So you can grow up delirium by developping an algorithm that adapts depending on the opponent and the history of fighting with it. + |
+
width | +Integer, between 1 and 100, inclusive, indicates the width of the map. | +
height | +Integer, between 1 and 100, inclusive, indicates the height of the map. | +
ship1 | +Integer, between 0 and 10, inclusive, indicates the number of boats with length of 1 box to set. | +
ship2 | +Integer, between 0 and 10, inclusive, indicates the number of boats with length of 2 box to set. | +
... | +... | +
ship6 | +Integer, between 0 and 10, inclusive, indicates the number of boats with length of 6 box to set. | +
your_strikes | +
+
+ String, representing an array in JSON format. + [ ] + ++ In the second round of game, it contains the previous shot and the result : + ++ [{"target":"2,0","result":""}] + ++ In the third round of play, the two previous shots : + ++ [{"target":"2,0","result":"hit"},{"target":"5,1","result":"hit"}] + ++ Each shot is a sub array for which : + +
|
+
his_strikes | +Same except that this is the shot of the opponent. | +
Voici quelques exemples des parametres envoyés par l'arène.
-+ Lors de l'initialisation d'une partie StupidIA VS StupidsIA, l'arène a envoyé au bot les parametres POST suivants : + During initialization of part StupidIA VS StupidIA, the arena send to your bot the following parameters in POST : +
++ game=Battleship&match_id=828-1&act=init&opponent=stupidIA&width=10&height=10&ship1=0&ship2=1&ship3=2&ship4=1&ship5=1&ship6=0 ++
+ Or, more readable : +
++ [game] => Battleship + [match_id] => 828-1 + [act] => init + [opponent] => stupidIA + [width] => 10 + [height] => 10 + [ship1] => 0 + [ship2] => 1 + [ship3] => 2 + [ship4] => 1 + [ship5] => 1 + [ship6] => 0 ++
+ The HTTP page that must generate your bot contains the position of ships. +
+
+ You return a character string that is a JSON array with as many records as ships.
+ Each ship is defined by the coordinates of its ends.
+
+ ["3,3-3,7","2,1-2,4","0,1-0,3","7,3-7,1","8,8-7,8"] ++
+ Of course if your boat overlap, or if their number and length does not match the demand of the arena, you lose the game. +
+
+ The order of the boats does not matter.
+ Similarly, for a boat, the order of its points does not matter either.
+
+ Seen on the grid, the example above would be : +
++ | 0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | +
0 | ++ | + | + | + | + | + | + | + | + | + |
1 | ++ | + | + | + | + | + | + | + | + | + |
2 | ++ | + | + | + | + | + | + | + | + | + |
3 | ++ | + | + | + | + | + | + | + | + | + |
4 | ++ | + | + | + | + | + | + | + | + | + |
5 | ++ | + | + | + | + | + | + | + | + | + |
6 | ++ | + | + | + | + | + | + | + | + | + |
7 | ++ | + | + | + | + | + | + | + | + | + |
8 | ++ | + | + | + | + | + | + | + | + | + |
9 | ++ | + | + | + | + | + | + | + | + | + |
+ Examples of parameters sent by the arena. +
+[game] => Battleship [match_id] => 834-1 @@ -116,9 +334,8 @@ Chaque navire est défini par les coordonnées de ses extrémités. [ship6] => 0 [your_strikes] => [] [his_strikes] => [] -)-
[game] => Battleship [match_id] => 834-1 @@ -135,7 +352,7 @@ Chaque navire est défini par les coordonnées de ses extrémités. [your_strikes] => [{"target":"4,6","result":""}] [his_strikes] => [{"target":"7,8","result":""}]-
[game] => Battleship [match_id] => 834-1 @@ -152,8 +369,10 @@ Chaque navire est défini par les coordonnées de ses extrémités. [your_strikes] => [{"target":"4,6","result":""},{"target":"3,9","result":"hit"}] [his_strikes] => [{"target":"7,8","result":""},{"target":"7,8","result":""}]-
-6,9 + 6,9-
Pour tirer aux coordonnées x=6 y=9
\ No newline at end of file ++ To shoot on the coordinates x=6 y=9 +
\ No newline at end of file diff --git a/src/arenas/Battleship/doc-fr.html b/src/arenas/Battleship/doc-fr.html index c3394f1..ce3650b 100644 --- a/src/arenas/Battleship/doc-fr.html +++ b/src/arenas/Battleship/doc-fr.html @@ -1,103 +1,322 @@ -La bataille navale se joue en deux phases:
-+ La bataille navale se joue en deux phases : +
+A chaque tour de jeu l'arène fait des requetes http(s) contenant des paramètres de type POST, vers vos bots. Ces derniers doivent répondre selon les spécifications ci dessous.
+
+ A chaque tour de jeu l'arène fait des requetes http(s) contenant des paramètres de type POST, vers vos bots.
+ Ces derniers doivent répondre selon les spécifications ci dessous.
+
Paramètre | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
game | chaîne de caractères, sera toujours "Battleship" Peut servir si votre url sert à plusieurs jeux | |||||||||
match_id | chaîne de caractères. répond à l'expression régulière suivante: ^[0-9]+-(1|2)$ -Le premier nombre (digits avant le tiret) identifie le match. Le numéro après le tiret vous indique si vous êtes le bot 1 ou le bot 2 dans l'ordre de jeu. -Ça vous servira si votre IA fait des statistiques sur les matchs. | |||||||||
act | Peut prendre deux valeurs: -
| |||||||||
opponent | Chaîne de caractères identifiant votre adversaire. Ainsi, vous pouvez pousser le délire jusqu'à faire un algorythme qui s'adapte en fonction de l'adversaire et de l'historique des combats avec ce dernier. | |||||||||
width | Entier, compris entre 1 et 100, bornes incluses, vous indique la largeur de la map. | -|||||||||
height | Entier, compris entre 1 et 100, bornes incluses, Vous indique la hauteur de la map. | |||||||||
ship1 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 1 case à placer. | |||||||||
ship2 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 2 cases à placer. | |||||||||
ship3 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 3 cases à placer. | |||||||||
... | ... | |||||||||
ship6 | Entier, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 6 cases à placer. | |||||||||
your_strikes | -
- chaîne de caractères représentant un array au format JSON. [ ] -Lors du deuxième tour de jeu, il contient le tir précédent et son résultat: -[{"target":"2,0","result":""}] -Lors du troisième tour de jeu, les deux tirs précédents -[{"target":"2,0","result":"hit"},{"target":"5,1","result":"hit"}] -Chaque tir est un sous array pour lesquels: -
| |||||||||
his_strikes | idem sauf qu'il s'agit du tir de l'adversaire. |
Paramètre | +Description | +
---|---|
game | +
+ Chaîne de caractères, sera toujours "Battleship". + Peut servir si votre url sert à plusieurs jeux. + |
+
match_id | +
+ Chaîne de caractères. Répond à l'expression régulière suivante: ^[0-9]+-(1|2)$ + Le premier nombre (digits avant le tiret) identifie le match. + Le numéro après le tiret vous indique si vous êtes le bot 1 ou le bot 2 dans l'ordre de jeu. + Ça vous servira si votre IA fait des statistiques sur les matchs. + |
+
act | +
+ Peut prendre deux valeurs : +
|
+
opponent | +
+ Chaîne de caractères identifiant votre adversaire. + Ainsi, vous pouvez pousser le délire jusqu'à faire un algorythme qui s'adapte en fonction de l'adversaire et de l'historique des combats avec ce dernier. + |
+
width | +Entier, compris entre 1 et 100, bornes incluses, vous indique la largeur de la map. | +
height | +Entier, compris entre 1 et 100, bornes incluses, vous indique la hauteur de la map. | +
ship1 | +Entier, compris entre 0 et 10, bornes incluses, vous indique le nombre de bateaux de longeur 1 case à placer. | +
ship2 | +Entier, compris entre 0 et 10, bornes incluses, vous indique le nombre de bateaux de longeur 2 cases à placer. | +
... | +... | +
ship6 | +Entier, compris entre 0 et 10, bornes incluses, vous indique le nombre de bateaux de longeur 6 cases à placer. | +
your_strikes | +
+
+ Chaîne de caractères représentant un array au format JSON. + [ ] + ++ Lors du deuxième tour de jeu, il contient le tir précédent et son résultat : + ++ [{"target":"2,0","result":""}] + ++ Lors du troisième tour de jeu, les deux tirs précédents : + ++ [{"target":"2,0","result":"hit"},{"target":"5,1","result":"hit"}] + ++ Chaque tir est un sous array pour lesquels: + +
|
+
his_strikes | +Idem sauf qu'il s'agit du tir de l'adversaire. | +
Lors de l'initialisation d'une partie StupidIA VS StupidsIA, l'arène a envoyé au bot les parametres POST suivants:
-game=Battleship&match_id=828-1&act=init&opponent=stupidIA&width=10&height=10&ship1=0&ship2=1&ship3=2&ship4=1&ship5=1&ship6=0-
Soit, sous forme plus lisible:
++ Lors de l'initialisation d'une partie StupidIA VS StupidsIA, l'arène a envoyé au bot les parametres POST suivants : +
-[game] => Battleship -[match_id] => 828-1 -[act] => init -[opponent] => stupidIA -[width] => 10 -[height] => 10 -[ship1] => 0 -[ship2] => 1 -[ship3] => 2 -[ship4] => 1 -[ship5] => 1 -[ship6] => 0 + game=Battleship&match_id=828-1&act=init&opponent=stupidIA&width=10&height=10&ship1=0&ship2=1&ship3=2&ship4=1&ship5=1&ship6=0- -
La page http que doit générer votre bot contient la position des navires.
-Vous retournez une chaine de caractères codant tableau JSON ayant autant d'enregistrements que de navires. -Chaque navire est défini par les coordonnées de ses extrémités.
++ Soit, sous forme plus lisible : +
++ [game] => Battleship + [match_id] => 828-1 + [act] => init + [opponent] => stupidIA + [width] => 10 + [height] => 10 + [ship1] => 0 + [ship2] => 1 + [ship3] => 2 + [ship4] => 1 + [ship5] => 1 + [ship6] => 0 ++
+ La page http que doit générer votre bot contient la position des navires. +
+
+ Vous retournez une chaine de caractères qui est un tableau JSON ayant autant d'enregistrements que de navires.
+ Chaque navire est défini par les coordonnées de ses extrémités.
+
-["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"]- -
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
-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.
-Vu sur la grille, l'exemple précédent donnerait:
++ 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. +
+
+ 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.
+
+ Vu sur la grille, l'exemple précédent donnerait : +
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
0 | ||||||||||
1 | ||||||||||
2 | ||||||||||
3 | ||||||||||
4 | ||||||||||
5 | ||||||||||
6 | ||||||||||
7 | ||||||||||
8 | ||||||||||
9 | ||||||||||
+ | 0 | +1 | +2 | +3 | +4 | +5 | +6 | +7 | +8 | +9 | +
0 | ++ | + | + | + | + | + | + | + | + | + |
1 | ++ | + | + | + | + | + | + | + | + | + |
2 | ++ | + | + | + | + | + | + | + | + | + |
3 | ++ | + | + | + | + | + | + | + | + | + |
4 | ++ | + | + | + | + | + | + | + | + | + |
5 | ++ | + | + | + | + | + | + | + | + | + |
6 | ++ | + | + | + | + | + | + | + | + | + |
7 | ++ | + | + | + | + | + | + | + | + | + |
8 | ++ | + | + | + | + | + | + | + | + | + |
9 | ++ | + | + | + | + | + | + | + | + | + |
Voici quelques exemples des parametres envoyés par l'arène.
++ Voici quelques exemples des parametres envoyés par l'arène. +
[game] => Battleship @@ -114,7 +333,6 @@ Chaque navire est défini par les coordonnées de ses extrémités. [ship6] => 0 [your_strikes] => [] [his_strikes] => [] -)
@@ -150,8 +368,10 @@ Chaque navire est défini par les coordonnées de ses extrémités. [your_strikes] => [{"target":"4,6","result":""},{"target":"3,9","result":"hit"}] [his_strikes] => [{"target":"7,8","result":""},{"target":"7,8","result":""}]-
-6,9 + 6,9-
Pour tirer aux coordonnées x=6 y=9
\ No newline at end of file ++ Pour tirer aux coordonnées x=6 y=9 +
\ No newline at end of file