Merge pull request #95 from gnieark/dev

Dev
This commit is contained in:
Gnieark 2016-06-28 23:44:00 +02:00 committed by GitHub
commit d8b7244f77
7 changed files with 47 additions and 22 deletions

View File

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="author" content="Gnieark" />
<title>Test ton bot</title>
<title>ConnectFour's Ludus</title>
<style type="text/css">
body{width:100%; font-size:100%; line-height:140%; word-wrap:break-word; text-rendering:optimizelegibility;
margin:0 auto; font-family : "lucida grande", "gill sans", arial, sans-serif; left:auto;}
@ -25,10 +25,10 @@ article{float: right; width:70%;}
aside{float:left; width: 28%; border-right: 1px dashed green;}
aside table {width: 90%;}
aside table tr td{width: 33%;}
aside table tr td input{width: 100%;}
aside table tr td input, aside table tr td select {width: 100%;}
.center{text-align: center;}
aside p img{ width: 100%; max-width:342px;}
form textarea, form input, form select {width:40%;}
form textarea, form input, form select {width:100%;}
form input[type=checkbox], form input[type=radio] { width:15px; }
form label {float:left; width:40%; margin-right:0.5em;
padding-top:0.2em; text-align:right;}
@ -317,9 +317,12 @@ function startGame(){
</head>
<body>
<header>
<h1>Debug and test your connectFour AI</h1>
<h1>ConnectFour's Ludus</h1>
</header>
<section>
<p>Here you can test and fix your bot, against himself, against human or against any other bot if you know the URL.
<br/>No scoring here, it's a Ludus (gladiators training center).</p>
<aside>
<h2>Configure the test</h2>
<table>
@ -330,10 +333,15 @@ function startGame(){
<option value="human">human</option>
</select>
</td>
<td>
</tr>
<tr>
<td colspan="2">
<input id="url1" type="text" name="player1URL" placeholder="url du bot http://localhost" value="https://ias.tinad.fr/StupidIAconnectFour.php"/>
</td>
</tr>
<tr>
<td>Player 2</td>
<td>
@ -342,10 +350,13 @@ function startGame(){
<option value="bot">bot</option>
</select>
</td>
<td>
</tr>
<tr>
<td colspan="2">
<input id="url2" type="text" name="player2URL" placeholder="url du bot http://localhost" disabled value="https://ias.tinad.fr/StupidIAconnectFour.php"/>
</td>
</tr>
</table>
<p><input type="button" onclick="startGame()" value="Fight"/></p>
</aside>

View File

@ -25,7 +25,7 @@ article{float: right; width:70%;}
aside{float:left; width: 28%; border-right: 1px dashed green;}
aside table {width: 90%;}
aside table tr td{width: 33%;}
aside table tr td input{width: 100%;}
aside table tr td input, aside table tr td select {width: 100%;}
.center{text-align: center;}
aside p img{ width: 100%; max-width:342px;}
form textarea, form input, form select {width:40%;}
@ -246,7 +246,9 @@ function startGame(){
<option value="human">human</option>
</select>
</td>
<td>
</tr>
<tr>
<td colspan="2">
<input id="url1" type="text" name="player1URL" placeholder="url du bot http://localhost" value="https://ias.tinad.fr/stupidIATictactoe.php"/>
</td>
</tr>
@ -258,7 +260,9 @@ function startGame(){
<option value="bot">bot</option>
</select>
</td>
<td>
</tr>
<tr>
<td colspan="2">
<input id="url2" type="text" name="player2URL" placeholder="url du bot http://localhost" disabled value="https://ias.tinad.fr/stupidIATictactoe.php"/>
</td>
</tr>

View File

@ -55,5 +55,7 @@ $lang = array(
'YOUR_EMAIL_FOR_BOT_VALIDATION' => 'Your email address (will serve to validate your bot)',
'SAVE_BOT' => 'Save',
'E_MAIL_EDIT_BOT' => "Hello Dude! \n Please Folow the next URL in order to validate your bot update.",
'YOUR_EMAIL_FOR_BOT_EDIT' => 'E-mail used for add this bot:'
'YOUR_EMAIL_FOR_BOT_EDIT' => 'E-mail used for add this bot:',
'GO-TO-LUDUS' => 'Visit the ludus',
'LUDUS-DETAIL' => '(Place to fix / improve your bot without scoring)'
);

View File

@ -55,5 +55,7 @@ $lang = array(
'YOUR_EMAIL_FOR_BOT_VALIDATION' => 'Votre adresse e-mail (servira pour la validation de votre bot)',
'SAVE_BOT' => 'Enregistrer',
'E_MAIL_EDIT_BOT' => "Bonjour Dude! \n Suivez l'URL suivante pour valider les modifications sur votre bot.",
'YOUR_EMAIL_FOR_BOT_EDIT' => 'L\'adresse e-mail qui a servi à l\'inscription du bot:'
'YOUR_EMAIL_FOR_BOT_EDIT' => 'L\'adresse e-mail qui a servi à l\'inscription du bot:',
'GO-TO-LUDUS' => 'Se rendre au ludus',
'LUDUS-DETAIL' => '(Page pour débogguer votre bot sans comptage des scores)'
);

View File

@ -71,15 +71,11 @@ switch ($_POST['act']){
'player-index' => $player
);
}
/*
* 'messageSend' => $data_string,
* 'httpStatus' => $curl_getinfo($ch)['http_code'],
* 'response' => $output,
* 'responseArr' => $arr
*/
get_IA_Response($_SESSION['bot1']['url'],$params[0]); //don't care about result
get_IA_Response($_SESSION['bot2']['url'],$params[1]); //don't care about result
//don't break, continue
case "fight":

View File

@ -17,7 +17,8 @@ $arenas=array(
'title' => "Tic Tac Toe",
'metaDescription' => 'Affrontements de bots au TicTacToe, morpion',
'jsFile'=> "js.js",
'cssFile'=> "style.css"
'cssFile'=> "style.css",
'ludusUrl' => "/testBotScripts/tictactoe.html"
),
array(
'id' => "Battleship",
@ -33,7 +34,8 @@ $arenas=array(
'title' => "Puissance 4",
'metaDescription' => 'Affrontements de bots puissance 4',
'jsFile'=> "js.js",
'cssFile'=> "style.css"
'cssFile'=> "style.css",
'ludusUrl' => "/testBotScripts/connectfour.html"
)
);

View File

@ -304,10 +304,18 @@ function get_unique_id(){
return $count;
}
function get_default_aside_content($currentArena){
global $lang;
$asideSectionContent = '<h2>infos:</h2><p>'.$lang['DEV-YOUR-OWN-BOT'].'<br/> <a href="/'.$currentArena.'/doc">'.$lang['DOC_SPECS_LINKS'].'</a></p>
<h2>Scores</h2>';
global $lang, $currentArenaArr;
//bla bla
$asideSectionContent = '<h2>infos:</h2><p>'.$lang['DEV-YOUR-OWN-BOT'].'<br/> <a href="/'.$currentArena.'/doc">'.$lang['DOC_SPECS_LINKS'].'</a></p>';
//lien pour le ludus
if(isset($currentArenaArr['ludusUrl'])){
$asideSectionContent.= '<p><a href="'.$currentArenaArr['ludusUrl'].'">'.$lang['GO-TO-LUDUS'].'</a>&nbsp;'.$lang['LUDUS-DETAIL'].'</p>';
}
//scores
$asideSectionContent.='<h2>Scores</h2>';
$podium=ELO_get_podium($currentArena);
$count=0;
$asideSectionContent.= '<ul class="podium">';