diff --git a/src/arenas/connectFour/doc-en.html b/src/arenas/connectFour/doc-en.html index 27c1c55..2dfcc60 100644 --- a/src/arenas/connectFour/doc-en.html +++ b/src/arenas/connectFour/doc-en.html @@ -1,37 +1,46 @@ -

Functioning of duels for battle four

-

Your program does not have to manage a whole part of noughts and crosses, just one lap

-

Connect four's wire rack

+

Functioning of duels for connect four

+

The board

-

-

Request Arena -> your bot

-

The arbitrator program (the arena) build a request with POST parameters as follow :

+

requests from BotsArena to your bot

+

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

+

Message initating the game

+ BotsArena sends: +
{"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"}
+  
- - - - - - - - - - - - -
namevalue
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. -
youyour symbol in the grid
gridString, 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}
+
    +
  • game-id String identifying the party.
  • +
  • action String identifying the phase, play-turn now, you have to play.
  • +
  • game String identifying the game. Always "tictactoe".
  • +
  • players Int indicating the number of players in the game, still 2 on connect Four.
  • +
  • board The map, i'll explain it at next chapter
  • +
  • you String, Your bot's character on the grid
  • +
  • player-index Int The order of your bot in turns. The first player is 0, second is 2.
  • +
+

The map

+

It is represented by a sub-array, on the "board" parameter.
Exemple:

   [["","","","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.
-

what return your bot

-

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 )

+ + +

Tools for developing and testing your bot

+

To help you on how to manage communications between the bot and the arena, please take a look in the source PHP stupidIA .

+ +

Script Botsarena

+

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. +

By default, browsers do not allow javascript to make Cross domain queries. It is a browser security. So there are three options: +

+

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.

+

Bolosseum

+

You will find command line tools to test and debug your bot on github project Bolosseum of @moul.

+

Bringing your bot in this arena

+

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 @@
  • largeur: 7 cases
  • hauteur: 6 cases
  • -

    +

    Communications entre l'arène et votre bot

    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 @@

    la map

    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","","",""],