Hi,
I'm working on a PHP poker simulation (holdem is the game). I'm trying to figure out a way to evaluate the strength of a given hand, and am a bit stuck.
The card values are stored in arrays.
Board cards:
$Board[1], $Board[2], etc.
Player cards:
$Player[1][1] & $Player[1][2] (Player 1 - hole cards 1 & 2)
$Player[2][1] & $Player[2][2] (Player 2 - hole cards 1 & 2)
etc.
Rank & Suit in subarrays:
$Board[2][rank] = "7" (second board card is a 7)
$Player[3][2][suit] = "h" (Player 3's second card is a heart)
Assuming I'll have a function "evalStrength()", and I'll call it passing two cards as a parameter, e.g.
How can I iterate through each of the combinations of cards (Player & Board) to evaluate hand strength at various stages of the deal (1 on flop, 6 on turn, and especially 21 on river)?
Thanks,
--RHYNO
I'm working on a PHP poker simulation (holdem is the game). I'm trying to figure out a way to evaluate the strength of a given hand, and am a bit stuck.
The card values are stored in arrays.
Board cards:
$Board[1], $Board[2], etc.
Player cards:
$Player[1][1] & $Player[1][2] (Player 1 - hole cards 1 & 2)
$Player[2][1] & $Player[2][2] (Player 2 - hole cards 1 & 2)
etc.
Rank & Suit in subarrays:
$Board[2][rank] = "7" (second board card is a 7)
$Player[3][2][suit] = "h" (Player 3's second card is a heart)
Assuming I'll have a function "evalStrength()", and I'll call it passing two cards as a parameter, e.g.
Code:
evalStrength($Player[1][1],$Player[1][2]);
How can I iterate through each of the combinations of cards (Player & Board) to evaluate hand strength at various stages of the deal (1 on flop, 6 on turn, and especially 21 on river)?
Thanks,
--RHYNO