add readme, display result as json

This commit is contained in:
2023-08-06 23:42:54 +02:00
parent 3820c41800
commit 4bead90e29
3 changed files with 557 additions and 19 deletions

View File

@@ -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 ) {