place ships function
This commit is contained in:
parent
efb974deee
commit
5cf7dd2615
|
@ -119,9 +119,9 @@ switch ($_POST['act']){
|
|||
list($xStart,$yStart)=explode(",",$startCoord);
|
||||
list($xEnd,$yEnd)=explode(",",$endCoord);
|
||||
if($xStart == $xEnd){
|
||||
$long=abs($yStart - $yEnd +1);
|
||||
$long=abs($yStart - $yEnd) +1;
|
||||
}else{
|
||||
$long=abs($xStart - $xEnd +1);
|
||||
$long=abs($xStart - $xEnd) +1;
|
||||
}
|
||||
$nbBoatsIwant[$long]-=1;
|
||||
$grid[$player]=place_ship_on_map($xStart,$yStart,$xEnd,$yEnd,$grid[$player]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user