0
我目前正在尝试使用2张扑克牌创建所有可能的扑克组合。我知道有1,326种起手组合。 所以我创造了我开始的甲板像这样:PHP - 创建所有可能的扑克组合的扑克算法
$startingDeck = array();
for($i=1; $i <= 13; $i++)
{
for($x=0; $x <= 3; $x++)
{
array_push($startingDeck, array("Value" => $i ,"Color" => $x, "key"=> $i.$x));
}
}
我现在要遍历所有的牌,并得到2卡的所有可能的组合,例如
: value 1 color 1 and value 1 color 2
: value 1 color 1 and value 1 color 3
... etc
: value 2 color 0 and value 1 color 1
: value 2 color 0 and value 1 color 2
... etc
我想要为所有这样做可能的组合,但如何。