diff --git a/countBattles.txt b/countBattles.txt new file mode 100644 index 0000000..203bd07 --- /dev/null +++ b/countBattles.txt @@ -0,0 +1 @@ +846 \ No newline at end of file diff --git a/html/StupidIABattleship.php b/html/StupidIABattleship.php index 8452d22..ca8afb6 100644 --- a/html/StupidIABattleship.php +++ b/html/StupidIABattleship.php @@ -21,8 +21,6 @@ function is_it_possible_to_place_ships_on_grid($gridWidth,$gridHeight,$nbShipsSi } return true; } - - function place_ship_on_map($x1,$y1,$x2,$y2,$map){ if ((($x1 <> $x2) && ($y1 <> $y2)) OR (!isset($map[$y1][$x1])) @@ -68,8 +66,10 @@ function place_ship_on_map($x1,$y1,$x2,$y2,$map){ return $map; } } + switch($_POST['act']){ case "init": + file_put_contents(__DIR__."/log.txt",print_r($_POST,true)); $wantedVars=array( 'match_id' => false, //false-> string ; true -> integer 'opponent' => false, @@ -205,10 +205,11 @@ switch($_POST['act']){ //print_r($map); echo json_encode($shipsCoords); + file_put_contents(__DIR__."/log.txt",json_encode($shipsCoords),FILE_APPEND); break; case "fight": //for debog arena - file_put_contents(__DIR__."/log.txt",print_r($_POST,true)); + file_put_contents(__DIR__."/log.txt",print_r($_POST,true),FILE_APPEND); // if((is_int(settype($_POST['width'],"integer"))) && (is_int(settype($_POST['height'],"integer")))){ diff --git a/html/index.php b/html/index.php index 2ff7447..7e3f6b8 100644 --- a/html/index.php +++ b/html/index.php @@ -134,7 +134,7 @@ if(isset($_GET['arena'])){ $siteTitle="Bots Arena"; $siteDescription="bots arena main page. Program your own artificiel intelligence and let it play here"; $mainSectionScript="../src/home.php"; - $asideSectionContent=''; + $asideSectionContent='

Principe:

'; $cssAdditionalScript=""; $jsAdditionalScript=""; } @@ -161,7 +161,7 @@ if (isset($_POST['xd_check'])){ ?> - + @@ -178,7 +178,6 @@ if (isset($_POST['xd_check'])){

-