我有以下PHP代碼洗牌1套牌;然而 - 我正在尋找像賭場這樣的6副牌在黑傑克遊戲中洗牌。有關如何實現這一目標的任何想法?PHP Shuffle Multiple Decks
private $suites = array('c', 'd', 'h', 's');
private $ranks = array('2', '3', '4', '5', '6', '7', '8', '9', 't', 'j', 'q', 'k', 'a');
private $deck = array();
for ($i = 0; $i < count($this->deck); $i++) {
$r = $i + rand(0, 51 - $i);
$temp = $this->deck[$i];
$this->deck[$i] = $this->deck[$r];
$this->deck[$r] = $temp;
}
有什麼期望的輸出? – 2013-06-28 00:51:26
有你聽說過PHP的[ 'shuffle()'](http://php.net/manual/en/function.shuffle.php)? –
Shuffle函數?http://php.net/manual/en/function.shuffle.php – iWantSimpleLife