foreach($args as $arg)
{
$ok = $ok * isset($_REQUEST[$arg]);
- /* echo "$arg: ok = $ok <br />";
- */
+ /*echo "$arg: ok = $ok <br />";
+ */
}
return $ok;
}
$c3 = $p[3];
$c4 = $p[4];
- /* find out who won */
-
/* first card is better than all the rest */
if( compare_cards($c1,$c2,$mode) && compare_cards($c1,$c3,$mode) && compare_cards($c1,$c4,$mode) )
return 1;
/* second card is better than first and better than the rest */
- if( !compare_cards($c1,$c2,$mode) && compare_cards($c2,$c3,$mode) && compare_cards($c2,$c4,$mode) )
+ if( !compare_cards($c1,$c2,$mode) && compare_cards($c2,$c3,$mode) && compare_cards($c2,$c4,$mode) )
return 2;
/* third card is better than first card and better than last */
case 48:
return 0;
default:
- echo "something went wrong, please contact the admin. ErrorCode: 2<br>";
+ echo "something went wrong, please contact the admin. ErrorCode: 2 - $card<br>";
return 0;
}
}
}
}
+function mysort($cards,$gametype)
+{
+ usort ( $cards, "sort_comp" );
+ return $cards;
+}
+
+function sort_comp($a,$b)
+{
+ global $TRUMP,$DIAMONDS,$HEARTS,$CLUBS,$SPADES;
+
+ $ALL = array();
+ $ALL = array_merge($TRUMP,$DIAMONDS,$CLUBS,$HEARTS,$SPADES,$DIAMONDS);
+
+ return pos_array($a,$ALL)-pos_array($b,$ALL);
+}
+
?>
\ No newline at end of file