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","","",""], From 32b5bb58ef248e5272b0e00e1cf59c09f83bdec8 Mon Sep 17 00:00:00 2001 From: gniearkDate: Wed, 8 Jun 2016 21:02:39 +0200 Subject: [PATCH 2/6] specs en --- src/arenas/connectFour/doc-en.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arenas/connectFour/doc-en.html b/src/arenas/connectFour/doc-en.html index 2dfcc60..9002ee6 100644 --- a/src/arenas/connectFour/doc-en.html +++ b/src/arenas/connectFour/doc-en.html @@ -33,7 +33,7 @@
- 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".
+- game String identifying the game. Always "connectFour".
- 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
From 86625e9ab4d5dba4f563a3b39875517cc0353a65 Mon Sep 17 00:00:00 2001 From: gniearkDate: Wed, 8 Jun 2016 21:07:29 +0200 Subject: [PATCH 3/6] specs en --- src/arenas/connectFour/doc-en.html | 10 +++++----- src/arenas/tictactoe/doc-en.html | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/arenas/connectFour/doc-en.html b/src/arenas/connectFour/doc-en.html index 9002ee6..73497e4 100644 --- a/src/arenas/connectFour/doc-en.html +++ b/src/arenas/connectFour/doc-en.html @@ -62,14 +62,14 @@ Obviously the arena respects Newton's laws and place your pawn in the first free 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 .
+
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. p> -By default, browsers do not allow javascript to make Cross domain queries. It is a browser security. So there are three options: p> -
- You add to your bot headers than allow for CORS field.
+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:
+
- You add to your bot headers that allow cross POST queries.
- More simple, you download the page (right click, save target as) and put it in your bot VHOST time tests. All the code (html, css and javascript) is included in the page without external resource, in order that it can be easily downloaded and used.
-- You use a web browser that supports JavaScript and allows cross domain queries. It seems possible . li> +
- You use a web browser that supports JavaScript and allows cross domain queries. It seems possible .
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
diff --git a/src/arenas/tictactoe/doc-en.html b/src/arenas/tictactoe/doc-en.html index 55a9bcd..d7e0552 100644 --- a/src/arenas/tictactoe/doc-en.html +++ b/src/arenas/tictactoe/doc-en.html @@ -3,7 +3,7 @@ Do not trust the animated GIF of the site's home page.
It's the illustration of the overall operation of the arena, but it is wrong : the tictactoe only needs to send 10 variables to the bots.
The choice was therefore made to pass them by GET parameters and not by POST as shown in the animation. - +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
@@ -170,14 +170,14 @@ X O X DRAW
To help you on how to manage communications between the bot and the arena, please take a look in the source PHP stupidIA .
+
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 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.
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
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.
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.
-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.
From 3d6ab938572a842f82b3c7e166fe13282d72dccd Mon Sep 17 00:00:00 2001 From: gniearkTo talk, botsarena (the server hosting botsarena) execute a POST request on your bot's http(s) server with the json as body
+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
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
+Your bot responds with a JSON array.
{"game-id":"1126","action":"init","game":"connectFour","players":2,"board":"","player-index":0}