test
This commit is contained in:
parent
5322444f2b
commit
c34b7f63e9
|
@ -7,118 +7,88 @@
|
||||||
<meta name="author" content="Gnieark" />
|
<meta name="author" content="Gnieark" />
|
||||||
<title>Test ton bot</title>
|
<title>Test ton bot</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body{
|
body{width:100%; font-size:100%; line-height:140%; word-wrap:break-word; text-rendering:optimizelegibility;
|
||||||
width:100%;
|
margin:0 auto; font-family : "lucida grande", "gill sans", arial, sans-serif; left:auto;}
|
||||||
font-size:100%;
|
header{ background-color:#A60800; width: 100%; overflow: hidden; height: auto;}
|
||||||
line-height:140%;
|
header h1{display: block; font-size:300%; color:#FFF;float: left; margin-left: 5%;}
|
||||||
word-wrap:break-word;
|
header nav{display: block; width: 45%; color:#FFF; float: right;}
|
||||||
text-rendering:optimizelegibility;
|
#menus{ margin-left: 50px; width:100%; display: table;}
|
||||||
margin:0 auto;
|
#menus a{color: #fff; display: table-cell; text-decoration: none;text-align: center;border-radius: 15px 15px 0px 0px;}
|
||||||
font-family : "lucida grande", "gill sans", arial, sans-serif;
|
#menus a.selected{color:#202020; background-color:#fff;}
|
||||||
left:auto;
|
footer{height: 70px; display: block; color: #343638; font-size: 11pt; line-height: 15pt; margin: 0; padding-top: 15pt;
|
||||||
}
|
overflow-x: hidden; box-sizing: border-box; background-image: -webkit-linear-gradient(top, #f5f5f5,#e9e9e9);
|
||||||
header{
|
border-top: 1px solid #bebebe; color: #999; font-size: 12px; line-height: 1.5em; text-align: center;width: 100%;}
|
||||||
background-color:#A60800;
|
footer a {margin:0px 15px 0px 15px; color: #666;text-decoration: none; font-weight: normal;}
|
||||||
width: 100%;
|
#languages{float: right; text-align: right;}
|
||||||
overflow: hidden;
|
section{margin: 0 auto; width: 90%;}
|
||||||
height: auto;
|
article{float: right; width:70%;}
|
||||||
}
|
aside{float:left; width: 28%; border-right: 1px dashed green;}
|
||||||
header h1{
|
aside table {width: 90%;}
|
||||||
display: block;
|
aside table tr td{width: 33%;}
|
||||||
font-size:300%;
|
aside table tr td input{width: 100%;}
|
||||||
color:#FFF;float: left;
|
|
||||||
margin-left: 5%;}
|
|
||||||
|
|
||||||
header nav{
|
|
||||||
display: block;
|
|
||||||
width: 45%;
|
|
||||||
color:#FFF;
|
|
||||||
float: right;
|
|
||||||
|
|
||||||
}
|
|
||||||
#menus{
|
|
||||||
margin-left: 50px;
|
|
||||||
width:100%;
|
|
||||||
display: table;
|
|
||||||
}
|
|
||||||
#menus a{
|
|
||||||
color: #fff;
|
|
||||||
display: table-cell;
|
|
||||||
text-decoration: none;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 15px 15px 0px 0px;
|
|
||||||
}
|
|
||||||
#menus a.selected{
|
|
||||||
color:#202020;
|
|
||||||
background-color:#fff;
|
|
||||||
}
|
|
||||||
footer{
|
|
||||||
height: 70px;
|
|
||||||
display: block;
|
|
||||||
color: #343638;
|
|
||||||
font-size: 11pt;
|
|
||||||
line-height: 15pt;
|
|
||||||
margin: 0;
|
|
||||||
padding-top: 15pt;
|
|
||||||
overflow-x: hidden;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-image: -webkit-linear-gradient(top, #f5f5f5,#e9e9e9);
|
|
||||||
border-top: 1px solid #bebebe;
|
|
||||||
color: #999;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 1.5em;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
footer a {
|
|
||||||
margin:0px 15px 0px 15px;
|
|
||||||
color: #666;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
#languages{
|
|
||||||
float: right;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
section{
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
article{
|
|
||||||
float: right;
|
|
||||||
width:70%;
|
|
||||||
}
|
|
||||||
aside{
|
|
||||||
float:left;
|
|
||||||
width: 28%;
|
|
||||||
border-right: 1px dashed green;
|
|
||||||
}
|
|
||||||
.center{text-align: center;}
|
.center{text-align: center;}
|
||||||
aside p img{ width: 100%; max-width:342px;}
|
aside p img{ width: 100%; max-width:342px;}
|
||||||
form textarea, form input, form select {width:40%;}
|
form textarea, form input, form select {width:40%;}
|
||||||
form input[type=checkbox], form input[type=radio] { width:15px; }
|
form input[type=checkbox], form input[type=radio] { width:15px; }
|
||||||
form label {
|
form label {float:left; width:40%; margin-right:0.5em;
|
||||||
float:left;
|
padding-top:0.2em; text-align:right;}
|
||||||
width:40%;
|
pre{ font-style: normal;font-size: 16px; margin-left: 32px;font-family: Consolas, "Times New Roman", Verdana;
|
||||||
margin-right:0.5em;
|
border-left: 4px solid #CCC; padding-left: 8px;}
|
||||||
padding-top:0.2em;
|
.battleGrid{display:table-cell; padding-left:10px; border-collapse:collapse; margin: 20px 20px 20px 20px;}
|
||||||
text-align:right;
|
.battleGrid tr{}
|
||||||
}
|
.battleGrid tr td{border: 1px dashed green; text-align: center; font-weight: bold;min-width:20px; height:20px;}
|
||||||
pre{
|
.winCase{background-color:red;}
|
||||||
font-style: normal;
|
</style>
|
||||||
font-size: 16px;
|
|
||||||
margin-left: 32px;
|
<script>
|
||||||
font-family: Consolas, "Times New Roman", Verdana;
|
function createElem(type,attributes){
|
||||||
border-left: 4px solid #CCC;
|
var elem=document.createElement(type);
|
||||||
padding-left: 8px;
|
for (var i in attributes)
|
||||||
|
{elem.setAttribute(i,attributes[i]);}
|
||||||
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changePlayerType(player,newValue){
|
||||||
|
if(newValue == "bot"){
|
||||||
|
document.getElementById('url' + player).disabled="";
|
||||||
|
}else{
|
||||||
|
document.getElementById('url' + player).disabled="disabled";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
function play(grid,player){
|
||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
}
|
||||||
|
function startGame(){
|
||||||
|
//empty div
|
||||||
|
document.getElementById("fightResult").innerHTML="";
|
||||||
|
//create grid
|
||||||
|
var table=createElem('table',{'class':'battleGrid'});
|
||||||
|
for (var i=6; i > -1; i--){
|
||||||
|
var tr=createElem('tr');
|
||||||
|
for (var j=0;j<7; j++){
|
||||||
|
var td=createElem('td',{'id': 'td' + j + '_' + i});
|
||||||
|
tr.appendChild (td);
|
||||||
|
}
|
||||||
|
|
||||||
|
table.appendChild(tr);
|
||||||
|
}
|
||||||
|
document.getElementById('fightResult').appendChild(table);
|
||||||
|
var divLogs=createElem("div",{"id":"logs"});
|
||||||
|
document.getElementById('fightResult').appendChild(divLogs);
|
||||||
|
|
||||||
|
var grid=[["","","","","","",""],
|
||||||
|
["","","","","","",""],
|
||||||
|
["","","","","","",""],
|
||||||
|
["","","","","","",""],
|
||||||
|
["","","","","","",""],
|
||||||
|
["","","","","","",""]];
|
||||||
|
|
||||||
|
play(grid,1);
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -127,23 +97,35 @@ pre{
|
||||||
<section>
|
<section>
|
||||||
<aside>
|
<aside>
|
||||||
<h2>Configure the test</h2>
|
<h2>Configure the test</h2>
|
||||||
<p> Player 1
|
<table>
|
||||||
<select name="player1Type">
|
<tr>
|
||||||
<option value="bot">bot</option>
|
<td>Player 1</td>
|
||||||
<option value="human">human</option>
|
<td><select name="player1Type" onchange="changePlayerType(1,this.value);">
|
||||||
</select>
|
<option value="bot">bot</option>
|
||||||
<input type="text" name="player1URL" placeholder="url du bot http://localhost"/>
|
<option value="human">human</option>
|
||||||
</p>
|
</select>
|
||||||
<p> Player 2
|
</td>
|
||||||
<select name="player2Type">
|
<td>
|
||||||
<option value="human">human</option>
|
<input id="url1" type="text" name="player1URL" placeholder="url du bot http://localhost"/>
|
||||||
<option value="bot">bot</option>
|
</td>
|
||||||
|
</tr>
|
||||||
</select>
|
<tr>
|
||||||
<input type="text" name="player2URL" placeholder="url du bot http://localhost"/>
|
<td>Player 2</td>
|
||||||
</p>
|
<td>
|
||||||
|
<select name="player2Type" onchange="changePlayerType(2,this.value);">
|
||||||
|
<option value="human">human</option>
|
||||||
|
<option value="bot">bot</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input id="url2" type="text" name="player2URL" placeholder="url du bot http://localhost" disabled/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
<p><input type="button" onclick="startGame()" value="Fight"/></p>
|
<p><input type="button" onclick="startGame()" value="Fight"/></p>
|
||||||
</aside>
|
</aside>
|
||||||
|
<article id="fightResult">
|
||||||
|
</article>
|
||||||
</section>
|
</section>
|
||||||
<footer>
|
<footer>
|
||||||
<a href="/p/About">About</a><a href="https://github.com/gnieark/botsArena">Bots'Arena source code</a><a href="/p/legals">Mentions légales</a>
|
<a href="/p/About">About</a><a href="https://github.com/gnieark/botsArena">Bots'Arena source code</a><a href="/p/legals">Mentions légales</a>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user