add readme, display result as json
This commit is contained in:
16
parse.php
16
parse.php
@@ -60,15 +60,13 @@ else {
|
||||
echo "\n";
|
||||
echo "\n";
|
||||
|
||||
echo "first player is: $first <br />";
|
||||
echo "winner is: $winner<br />" ;
|
||||
echo "num of turns: $turns<br />" ;
|
||||
echo "list of expansions used:" ;
|
||||
echo "<ol>" ;
|
||||
foreach ( array_unique($usedExt) as $e ){
|
||||
print( "<li>".$e."</li>" ) ;
|
||||
}
|
||||
echo "</ol>" ;
|
||||
$result = array(
|
||||
"first player" => $first,
|
||||
"winner" => $winner,
|
||||
"num_turns" => $turns ,
|
||||
"expansions" => array_values( array_unique($usedExt) ),
|
||||
) ;
|
||||
print json_encode( $result, JSON_PRETTY_PRINT );
|
||||
|
||||
}
|
||||
function guessExpansion( $card, $cards, $ext ) {
|
||||
|
||||
Reference in New Issue
Block a user