I am currently trying to make a poker algorithm that creates all possible poker combinations with 2 cards. I know that there are 1,326 combinations of starting hands. So I created my starting deck like this:
$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));
}
}
I want now to loop through all the cards and get all possible combinations with 2 cards for example
: 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
I want to do this for all the combinations that are possible but how.