dev and master
This commit is contained in:
parent
673daee66a
commit
1660a87282
|
@ -6,6 +6,8 @@ It's a website for programming AI challenges. Everyone can read a game's specifi
|
||||||
![image](https://raw.githubusercontent.com/gnieark/botsArena/master/html/principe.gif)
|
![image](https://raw.githubusercontent.com/gnieark/botsArena/master/html/principe.gif)
|
||||||
|
|
||||||
# Still in dev
|
# Still in dev
|
||||||
|
- The stable website (Using github API, Vhost is synchronized to branch master) is [https://botsarena.tinad.fr/](https://botsarena.tinad.fr/)
|
||||||
|
- Dev [http://botsarena-dev.tinad.fr/](http://botsarena-dev.tinad.fr/) (synchronized on this repo 's dev branch), can show messages like "parse error","Internal server error" etc...
|
||||||
To do:
|
To do:
|
||||||
- English translation
|
- English translation
|
||||||
- Develop others arenas (thinking about Connect Four, tron, and maybe one day chess)
|
- Develop others arenas (thinking about Connect Four, tron, and maybe one day chess)
|
||||||
|
@ -14,7 +16,7 @@ To do:
|
||||||
- Page for bot's owners (manage description url etc...)
|
- Page for bot's owners (manage description url etc...)
|
||||||
|
|
||||||
# Contribute
|
# Contribute
|
||||||
You are welcome, Make pull requests on branch dev. Im available on twitter [@gnieark](https://twitter.com/gnieark) in order to talk
|
You are welcome, Make pull requests on branch dev. Im available on twitter [@gnieark](https://twitter.com/gnieark) in order to talk.
|
||||||
|
|
||||||
# install it
|
# install it
|
||||||
I'd better like you to help me to improve [bot's Arena](https://botsarena.tinad.fr/), and you to make your own bots to play challenges. It would be more funny having lot of bots in one arena rather than lot of arenas.
|
I'd better like you to help me to improve [bot's Arena](https://botsarena.tinad.fr/), and you to make your own bots to play challenges. It would be more funny having lot of bots in one arena rather than lot of arenas.
|
||||||
|
|
|
@ -201,7 +201,7 @@ if (isset($_POST['xd_check'])){
|
||||||
?>
|
?>
|
||||||
</section>
|
</section>
|
||||||
<footer>
|
<footer>
|
||||||
<a href="/p/About"><?php echo $lang['ABOUT']; ?></a><a href="/p/legals"><?php echo $lang['LEGALS']; ?></a>
|
<a href="/p/About"><?php echo $lang['ABOUT']; ?></a><a href="https://github.com/gnieark/botsArena">Bots'Arena source code</a><a href="/p/legals"><?php echo $lang['LEGALS']; ?></a>
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -3,7 +3,7 @@ $lang=array(
|
||||||
'lang' => 'fr',
|
'lang' => 'fr',
|
||||||
'SITE_NAME' => 'Arène à bots',
|
'SITE_NAME' => 'Arène à bots',
|
||||||
'SITE_DESCRIPTION' =>
|
'SITE_DESCRIPTION' =>
|
||||||
'<p>Bienvenue sur cette arène à bots.<br/><b>Ce site est en cours de développement. Il fonctionne, mais beaucoup de détails restent à régler, dont la traduction anglais</b><br/>Ce vhost est une image de la branche dev du <a href="https://github.com/gnieark/botsArena/tree/dev">dépot github </a></p>
|
'<p>Bienvenue sur cette arène à bots.<br/><b>Ce site est en cours de développement. Il fonctionne, mais beaucoup de détails restent à régler, dont la traduction anglais</b></p>
|
||||||
<p>Plusieurs jeux sont proposés ici. Vous ne devez pas y jouer, mais dévolopper le "bot" qui jouera en votre nom.
|
<p>Plusieurs jeux sont proposés ici. Vous ne devez pas y jouer, mais dévolopper le "bot" qui jouera en votre nom.
|
||||||
Ce site permet de faire s\'affronter les bots des différents développeurs.</p>',
|
Ce site permet de faire s\'affronter les bots des différents développeurs.</p>',
|
||||||
'HOME' => 'accueil',
|
'HOME' => 'accueil',
|
||||||
|
|
|
@ -196,12 +196,8 @@ switch ($_POST['act']){
|
||||||
die;
|
die;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "fight";
|
case "fight":
|
||||||
|
|
||||||
/*
|
|
||||||
print_r($_SESSION);
|
|
||||||
Array ( [xd_check] => VSlWXLQVbYL2sCBwqetQdorR9 [bot1] => Array ( [id] => 10 [name] => stupidIA [url] => http://botsArena.tinad.fr/StupidIABattleship.php [description] => ) [bot2] => Array ( [id] => 10 [name] => stupidIA [url] => http://botsArena.tinad.fr/StupidIABattleship.php [description] => ) [matchId] => 702 [ships] => Array ( [1] => Array ( [0] => Array ( [0] => 3,0 [1] => 3,1 [2] => 3,2 [3] => 3,3 [4] => 3,4 ) [1] => Array ( [0] => 1,5 [1] => 2,5 [2] => 3,5 [3] => 4,5 ) [2] => Array ( [0] => 7,5 [1] => 8,5 [2] => 9,5 ) [3] => Array ( [0] => 0,0 [1] => 1,0 [2] => 2,0 ) [4] => Array ( [0] => 4,4 [1] => 5,4 ) [5] => Array ( [0] => 5,3 [1] => 6,3 [2] => 7,3 [3] => 8,3 [4] => 9,3 ) [6] => Array ( [0] => 2,7 [1] => 3,7 [2] => 4,7 [3] => 5,7 ) [7] => Array ( [0] => 1,9 [1] => 2,9 [2] => 3,9 ) [8] => Array ( [0] => 7,4 [1] => 8,4 [2] => 9,4 ) [9] => Array ( [0] => 0,2 [1] => 0,3 ) [10] => Array ( [0] => 3,9 [1] => 4,9 [2] => 5,9 [3] => 6,9 [4] => 7,9 ) [11] => Array ( [0] => 2,2 [1] => 2,3 [2] => 2,4 [3] => 2,5 ) [12] => Array ( [0] => 0,8 [1] => 1,8 [2] => 2,8 ) [13] => Array ( [0] => 7,7 [1] => 8,7 [2] => 9,7 ) [14] => Array ( [0] => 8,3 [1] => 9,3 ) [15] => Array ( [0] => 4,5 [1] => 5,5 [2] => 6,5 [3] => 7,5 [4] => 8,5 ) [16] => Array ( [0] => 3,2 [1] => 4,2 [2] => 5,2 [3] => 6,2 ) [17] => Array ( [0] => 0,7 [1] => 1,7 [2] => 2,7 ) [18] => Array ( [0] => 6,1 [1] => 7,1 [2] => 8,1 ) [19] => Array ( [0] => 2,3 [1] => 3,3 ) ) [2] => Array ( [0] => Array ( [0] => 0,9 [1] => 1,9 [2] => 2,9 [3] => 3,9 [4] => 4,9 ) [1] => Array ( [0] => 1,4 [1] => 1,5 [2] => 1,6 [3] => 1,7 ) [2] => Array ( [0] => 3,0 [1] => 4,0 [2] => 5,0 ) [3] => Array ( [0] => 0,0 [1] => 1,0 [2] => 2,0 ) [4] => Array ( [0] => 5,2 [1] => 6,2 ) [5] => Array ( [0] => 2,0 [1] => 3,0 [2] => 4,0 [3] => 5,0 [4] => 6,0 ) [6] => Array ( [0] => 2,1 [1] => 3,1 [2] => 4,1 [3] => 5,1 ) [7] => Array ( [0] => 7,3 [1] => 8,3 [2] => 9,3 ) [8] => Array ( [0] => 0,2 [1] => 1,2 [2] => 2,2 ) [9] => Array ( [0] => 5,3 [1] => 5,4 ) [10] => Array ( [0] => 5,3 [1] => 6,3 [2] => 7,3 [3] => 8,3 [4] => 9,3 ) [11] => Array ( [0] => 0,2 [1] => 0,3 [2] => 0,4 [3] => 0,5 ) [12] => Array ( [0] => 7,2 [1] => 8,2 [2] => 9,2 ) [13] => Array ( [0] => 0,1 [1] => 1,1 [2] => 2,1 ) [14] => Array ( [0] => 7,7 [1] => 7,8 ) [15] => Array ( [0] => 4,1 [1] => 4,2 [2] => 4,3 [3] => 4,4 [4] => 4,5 ) [16] => Array ( [0] => 3,9 [1] => 4,9 [2] => 5,9 [3] => 6,9 ) [17] => Array ( [0] => 7,3 [1] => 8,3 [2] => 9,3 ) [18] => Array ( [0] => 6,8 [1] => 7,8 [2] => 8,8 ) [19] => Array ( [0] => 0,5 [1] => 0,6 ) ) ) [shots] => Array ( [1] => Array ( ) [2] => Array ( ) ) [width] => 10 [height] => 10 )
|
|
||||||
*/
|
|
||||||
if(count($_SESSION['strikes'][1]) == count($_SESSION['strikes'][2])){
|
if(count($_SESSION['strikes'][1]) == count($_SESSION['strikes'][2])){
|
||||||
//player 1 has to fight
|
//player 1 has to fight
|
||||||
$currentPlayer=1;
|
$currentPlayer=1;
|
||||||
|
@ -255,7 +251,7 @@ switch ($_POST['act']){
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
//put previous strikes in a simple array;
|
//put previous strikes in a one dimmension array ;
|
||||||
$previousStrikes=array();
|
$previousStrikes=array();
|
||||||
foreach( $_SESSION['strikes'][$currentPlayer] as $strikes){
|
foreach( $_SESSION['strikes'][$currentPlayer] as $strikes){
|
||||||
$previousStrikes[]=$strikes['target'];
|
$previousStrikes[]=$strikes['target'];
|
||||||
|
@ -296,11 +292,13 @@ switch ($_POST['act']){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//save the shot
|
//remember this shot
|
||||||
$_SESSION['strikes'][$currentPlayer][]=array(
|
$_SESSION['strikes'][$currentPlayer][]=array(
|
||||||
'target' => $x.",".$y,
|
'target' => $x.",".$y,
|
||||||
'result' => $result
|
'result' => $result
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//send message for the arena's ajax web page
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'opponent'=> $opponent,
|
'opponent'=> $opponent,
|
||||||
'target' => $x.",".$y,
|
'target' => $x.",".$y,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user