function mysort($cards,$gametype)
{
- global $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES;
-
- switch($gametype) {
- case normal:
- case trump:
- default:
- $ALL = array_merge($TRUMP,$DIAMONDS,$CLUBS,$HEARTS,$SPADES,$DIAMONDS);
- break;
- }
+ usort ( $cards, "sort_comp" );
+ return $cards;
+}
- $compare = create_function("$a, $b", "return pos_array($a,$ALL)-pos_array($b,$ALL);");
+function sort_comp($a,$b)
+{
+ global $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES;
- usort ( $cards, $compare );
+ $ALL = array();
+ $ALL = array_merge($TRUMP,$DIAMONDS,$CLUBS,$HEARTS,$SPADES,$DIAMONDS);
- return;
+ return pos_array($a,$ALL)-pos_array($b,$ALL);
}
-
?>
\ No newline at end of file
}
$mycards = DB_get_hand($me);
- mysort($mycards,$gametype);
+ $mycards = mysort($mycards,$gametype);
echo "<div class=\"mycards\">\n";
if($myturn && !myisset("card"))