Pour démarrer la partie, l'arène va envoyer une requette http(s) à votre programme contenant les paramètres POST suivants:
+
+
+
+
+
\ No newline at end of file
diff --git a/src/arenas/Battleship/functions.php b/src/arenas/Battleship/functions.php
new file mode 100644
index 0000000..f57cd56
--- /dev/null
+++ b/src/arenas/Battleship/functions.php
@@ -0,0 +1,44 @@
+ $botsCount)){
+ error(400,"wrong parameters");
+ die;
+ }
+ }
+ return array('bot1' => $_POST['bot1'],'bot2' => $_POST['bot2']);
+}
+
+function generate_numeric_select($start,$end,$selected,$name,$id){
+ $out="";
+
+}
\ No newline at end of file
diff --git a/src/arenas/Battleship/js.js b/src/arenas/Battleship/js.js
new file mode 100644
index 0000000..e5d752b
--- /dev/null
+++ b/src/arenas/Battleship/js.js
@@ -0,0 +1,83 @@
+function Ajx(){
+ var request = false;
+ try {request = new ActiveXObject('Msxml2.XMLHTTP');}
+ catch (err2) {
+ try {request = new ActiveXObject('Microsoft.XMLHTTP');}
+ catch (err3) {
+ try { request = new XMLHttpRequest();}
+ catch (err1) {
+ request = false;
+ }
+ }
+ }
+ return request;
+}
+function createElem(type,attributes)
+{
+ var elem=document.createElement(type);
+ for (var i in attributes)
+ {elem.setAttribute(i,attributes[i]);}
+ return elem;
+}
+
+function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check){
+ var bot1IdName = bot1.split("-");
+ var bot2IdName = bot2.split("-");
+ document.getElementById('fightResult').innerHTML = '';
+ //dessiner les deux grilles
+ var tableAdv=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
+ var tableMe=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
+ //ligne de titre
+ var trTitre1=createElem("tr");
+ var trTitre2=createElem("tr");
+ var tdTitre1=createElem("th",{"colspan":gridWidth});
+ var tdTitre2=createElem("th",{"colspan":gridWidth});
+ tdTitre1.innerHTML = bot1IdName[1];
+ tdTitre2.innerHTML = bot2IdName[1];
+ trTitre1.appendChild(tdTitre1);
+ tableAdv.appendChild(trTitre1);
+ trTitre2.appendChild(tdTitre2);
+ tableMe.appendChild(trTitre2);
+
+ for (var i=0; i < gridHeight ; i++){
+ var trAdv=createElem("tr");
+ var trMe=createElem("tr");
+ for (var j=0; j < gridWidth ; j++){
+ var tdAdv=createElem("td",{"id":"adv" + i +"-" + j,"class": "empty"});
+ var tdMe=createElem("td",{"id":"me" + i +"-" + j,"class": "empty"});
+ trAdv.appendChild(tdAdv);
+ trMe.appendChild(tdMe);
+ }
+ tableAdv.appendChild(trAdv);
+ tableMe.appendChild(trMe);
+ }
+ document.getElementById('fightResult').appendChild(tableAdv);
+ document.getElementById('fightResult').appendChild(tableMe);
+ var divLogs=createElem("div",{"id":"logs"});
+ document.getElementById('fightResult').appendChild(divLogs);
+
+
+
+ var xhr = Ajx();
+ xhr.onreadystatechange = function(){if(xhr.readyState == 4){
+ if(xhr.status == 200) {
+ //document.getElementById('fightResult').innerHTML = xhr.responseText;
+ }
+ }};
+ xhr.open("POST", '/Battleship', true);
+ xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ xhr.send(
+ 'act=initGame&bot1=' + bot1
+ + '&bot2=' + bot2
+ + '&gridWidth=' + gridWidth
+ + '&gridHeight=' + gridHeight
+ + '&nbShip1=' + nbShip1
+ + '&nbShip1=' + nbShip2
+ + '&nbShip3=' + nbShip3
+ + '&nbShip4=' + nbShip4
+ + '&nbShip5=' + nbShip5
+ + '&nbShip6=' + nbShip6
+ + '&xd_check=' + xd_check
+ );
+
+}
\ No newline at end of file
diff --git a/src/arenas/Battleship/public.php b/src/arenas/Battleship/public.php
index 61aa218..f62943a 100644
--- a/src/arenas/Battleship/public.php
+++ b/src/arenas/Battleship/public.php
@@ -1 +1,55 @@
-
Battle ship
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VS
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/arenas/Battleship/style.css b/src/arenas/Battleship/style.css
new file mode 100644
index 0000000..4c97286
--- /dev/null
+++ b/src/arenas/Battleship/style.css
@@ -0,0 +1,8 @@
+article p {width: 100%;}
+article p label {float:left; text-align:right; width:60%}
+article p select {}
+td{min-width: 15px; height: 15px;}
+.battleshipGrid{float: left; border-collapse:collapse; margin: 20px 20px 20px 20px;}
+.battleshipGrid tr{}
+.battleshipGrid tr td{border: 1px dashed green;}
+.battleshipGrid tr th{text-align: center;}
\ No newline at end of file
diff --git a/src/arenas/tictactoe/doc-fr.html b/src/arenas/tictactoe/doc-fr.html
index de5151a..2e5feff 100644
--- a/src/arenas/tictactoe/doc-fr.html
+++ b/src/arenas/tictactoe/doc-fr.html
@@ -32,4 +32,4 @@ avec les coordonnées d'une case déjà jouée perd la partie.
Publier votre programme pour le tester puis le lâcher dans l'arène
-
Ce n'est pas encore possible. L'interface est en cours de developpement. Mais vous pouvez toujours me contacter, @gnieark sur twitter, je mettrai à la main votre bot dans l'arène.