From 7038797ff279b9f3ce7d196d86f45f6e579a39fe Mon Sep 17 00:00:00 2001
From: gnieark Your program does not have to manage a whole part of noughts and crosses, just one lapFunctioning of duels for battle four
-Connect four's wire rack
+Functioning of duels for connect four
+The board
-
-
The arbitrator program (the arena) build a request with POST parameters as follow :
+To talk, botsarena (the server hosting botsarena) execute a POST request on your bot's http(s) server with the json as body
+Your bot responds with a JSON array
+{"game-id":"1126","action":"init","game":"connectFour","players":2,"board":"","player-index":0}+
Explanation of each parameters:
+Your bot should return his name JSON format:
++ {"name":"botName"} +-
name | value |
---|---|
game | -
- String, always "connectFour". - Can be usefull if you use the same URL for play to others 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. - |
-
you | your symbol in the grid |
grid | String, representing an array in JSON format. this is the wire. - the first seven values are the bottom horizontal line. - Exemple: + The arena currently does not check this response, the init step was included to ensure compatibility with Bolosseum . + If your bot returns a blank page at this step (action = init), it will work. +Message asking you to play (only one turn)+The Arena sends as example the following message: +{"game-id":"9916","action":"play-turn","game":"connectFour","players":2,"board":[["","","","","","",""],["","","","","","",""],["","","","","","",""],["","","","","","",""],["","","","","","",""],["","","","","","",""]],"you":"X","player-index":0}+
The map+ It is represented by a sub-array, on the "board" parameter. [["","","","X","0","",""], ["","","","X","","",""], @@ -40,9 +49,30 @@ It will serve you if your AI makes statistics on games. ["","","","","","",""], ["","","","","","",""]]+ Visually, the connect 4 's plate is reversed. The line with index zero (top in the above excerpt) represents the bottom line. +Your bot response- |
JSON format, Only one digit that indicate column you want to play. 0 to 6.
++{"play":"3"} ++
For play in column three.
-
only one char: 0,1,2,3,4,5 or 6 that indicates the column you want to play
+Obviously the arena respects Newton's laws and place your pawn in the first free space of the column ( starting at index 0 ) + + +To help you on how to manage communications between the bot and the arena, please take a look in the source PHP stupidIA .
+ +
This small html + javascript page will allow you to test and debug on your bot.
It will allow you to test your boot via its URL, against himself, a human or stupidIA.
Once ready, Express Sign your bot in the arena. p>
+
By default, browsers do not allow javascript to make Cross domain queries. It is a browser security. So there are three options: p> +
This problem does not arise at the arena once your bot will be registered. Because in that case, it is the requests to the bot, not a browser.
+You will find command line tools to test and debug your bot on github project Bolosseum of @moul.
+The registration form your bot is on the site's home page.
diff --git a/src/arenas/connectFour/doc-fr.html b/src/arenas/connectFour/doc-fr.html index b186055..4f3f71d 100644 --- a/src/arenas/connectFour/doc-fr.html +++ b/src/arenas/connectFour/doc-fr.html @@ -4,7 +4,7 @@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.
@@ -42,7 +42,7 @@Elle est contenue dans le champs board du message JSON.C'est un tableau à deux dimmensions au format JSON vous indiquant l'état de la grille.
- Exemple:
+ Exemple:
[["","","","X","0","",""], ["","","","X","","",""],