diff --git a/src/arenas/Battleship/doc-en.html b/src/arenas/Battleship/doc-en.html index 0c26435..545cb32 100644 --- a/src/arenas/Battleship/doc-en.html +++ b/src/arenas/Battleship/doc-en.html @@ -1,173 +1,62 @@ -
- Battleship is played in two stages : -
+Elle se joue en deux phases
- At each turn, the arena made HTTP(s) queries containing POST parameters, to your bots.
- They must respond to the specifications below.
-
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. | -
- 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.
-
Pour communiquer, l'arène (le serveur hébergeant botsarena) fait des requetes http(s) de type POST vers les bots. Le message est dans le corps de la requête au format JSON.
+Votre bot répond par un array au format JSON.
+{"game-id":1609,"game":"battleship","action":"init","players":2,"player-index":0,"board":{"opponent":"stupidIA","width":"10","height":"10","ship1":"0","ship2":"1","ship3":"2","ship4":"1","ship5":"1","ship6":"0"}}+
Si on décompose le tableau pour l'expliquer:
+Votre bot doit retourner le nom de votre bot et le placement de vos bateaux au format JSON:
++ {"name":"gnieark","boats":["4,2-4,6","3,3-3,0","2,3-2,1","7,9-5,9","6,8-6,7"]} ++
["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. + 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.
- The order of the boats does not matter.
- Similarly, for a boat, the order of its points does not matter either.
+ 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.
- Seen on the grid, the example above would be : + Vu sur la grille, l'exemple précédent donnerait :
- Examples of parameters sent by the arena. -
-- [game] => Battleship - [match_id] => 834-1 - [act] => fight - [opponent] => stupidIA - [width] => 10 - [height] => 10 - [ship1] => 0 - [ship2] => 1 - [ship3] => 2 - [ship4] => 1 - [ship5] => 1 - [ship6] => 0 - [your_strikes] => [] - [his_strikes] => [] --
- [game] => Battleship - [match_id] => 834-1 - [act] => fight - [opponent] => stupidIA - [width] => 10 - [height] => 10 - [ship1] => 0 - [ship2] => 1 - [ship3] => 2 - [ship4] => 1 - [ship5] => 1 - [ship6] => 0 - [your_strikes] => [{"target":"4,6","result":""}] - [his_strikes] => [{"target":"7,8","result":""}] --
- [game] => Battleship - [match_id] => 834-1 - [act] => fight - [opponent] => stupidIA - [width] => 10 - [height] => 10 - [ship1] => 0 - [ship2] => 1 - [ship3] => 2 - [ship4] => 1 - [ship5] => 1 - [ship6] => 0 - [your_strikes] => [{"target":"4,6","result":""},{"target":"3,9","result":"hit"}] - [his_strikes] => [{"target":"7,8","result":""},{"target":"7,8","result":""}] --
- 6,9 --
- To shoot on the coordinates x=6 y=9 -
\ No newline at end of file + +L'arène vous envoie par exemple le message suivant:
+{"game":"Battleship","game-id":1615,"action":"play-turn","player-index":1,"board":{"opponent":"stupidIA","width":"10","height":"10","ship1":"0","ship2":"1","ship3":"2","ship4":"1","ship5":"1","ship6":"0","your_strikes":[{"target":"4,3","result":""},{"target":"9,8","result":""}],"his_strikes":[{"target":"2,2","result":""},{"target":"0,6","result":""},{"target":"7,0","result":""}]}}+
Elle est représentée par les éléments d'écrits à l'étape précédente et par deux sous tableaux your_strikes et his strikes
+Chaîne de caractères représentant un array au format JSON.
+ Ce parametre n'est envoyé que lors de la phase de tirs du jeu (act=fight).
+ Il vous indique les tirs que vous avez déjà effectués et leur résultats.
+ Lors du premier tour de jeu, il représente un array vide:
+
[ ]+
+ 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: +
+Il doit répondre par les coordonnées de la case dans laquelle il souhaite effectuer un tir.
+{"play":"1,8"}+
x,y
+Le formulaire d'inscription de votre bot est sur la page d'accueil du site.
\ No newline at end of file