From 8c5281010622386c1c57a8ee5eec18ed89dfb039 Mon Sep 17 00:00:00 2001 From: arun Date: Tue, 16 Jan 2007 15:00:03 +0000 Subject: new sort function; should sorrt correctly for solos,etc --- functions.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 221bea8..cecc63c 100644 --- a/functions.php +++ b/functions.php @@ -523,4 +523,24 @@ function set_gametype($gametype) } } +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; + } + + $compare = create_function("$a, $b", "return pos_array($a,$ALL)-pos_array($b,$ALL);"); + + usort ( $cards, $compare ); + + return; +} + + ?> \ No newline at end of file -- cgit v1.2.3-18-g5258