stupidIa
This commit is contained in:
parent
22b599d427
commit
9091a46151
|
@ -1,3 +1,18 @@
|
|||
<?php
|
||||
//debug mode
|
||||
print_r($_POST);
|
||||
/*
|
||||
* stupid IA for battle ship
|
||||
* choose by random a free column
|
||||
*/
|
||||
|
||||
$grid=json_decode($_POST['grid']);
|
||||
|
||||
$colAvailable=array();
|
||||
|
||||
for($i=0;$i<7;$i++){
|
||||
if($colAvailable[5][$i] == ""){
|
||||
$colAvailable[]=$i;
|
||||
}
|
||||
}
|
||||
shuffle($colAvailable);
|
||||
echo $i;
|
||||
die;
|
||||
|
|
Loading…
Reference in New Issue
Block a user