PHP Classes

number of hands; flop burn cards

Recommend this page to a friend!

      PHP Poker Engine  >  All threads  >  number of hands; flop burn cards  >  (Un) Subscribe thread alerts  
Subject:number of hands; flop burn cards
Summary:looping too many hands; returned flop incorrect
Messages:3
Author:Brian Pang
Date:2006-11-02 15:58:51
Update:2006-12-29 12:08:50
 

  1. number of hands; flop burn cards   Reply   Report abuse  
Picture of Brian Pang Brian Pang - 2006-11-02 15:58:51
aPokerGameEngineTestv3.php

Line 18:
for($cardcounter=0;$cardcounter<=$playnum;$cardcounter++)

(Assuming line 13 is $playnum=8) This is actually dealing 9 hands. Should be $cardcounter < $playnum in the for condition.

Same issue for Line 62:
for($finalHandCounter1=0;$finalHandCounter1<=$playnum;$finalHandCounter1++)

Should be $finalHandCounter1<$playnum

and Line 79:
for($var1=0;$var1<=$playnum;$var1++){

Should be $var1<$playnum


Line 35:
$flopStart=($playnum*2)+2;//start position for flop cards

Should be just $flopStart=($playnum*2);
you were adding the extra 2 card positions to account for the extra hand dealt in line 18.


Line 37:
$flopCards=8;//defines how many cards in flop inclusive of burns

Only 7 cards flop (on the board). I've never seen a burn card before the flop (first 3 cards).

Line 38:
for($x=0;$x<=$flopCards;$x++)//loop to populate the flop

As above with $playnum, this should be $x<$flopCards in the for condition.

  2. players' second card; flop fix   Reply   Report abuse  
Picture of Brian Pang Brian Pang - 2006-11-04 13:48:43 - In reply to message 1 from Brian Pang
Line 15:
$secondcard=($playnum+1);

Should be just $secondcard=$playnum;
Since the array counting starts at zero (0) the 8th position in the array is already the 9th card in the deck.

Lines 49-57:
print_r($flop[1]." ");
print_r($flop[2]." ");
print_r($flop[3]." ");
print_r($flop[5]." ");
print_r($flop[7]." ");


//create new hands that include the flop cards
$flopPlayCards=array($flop[1],$flop[2],$flop[3],$flop[5],$flop[7]);


Again, since the array begins at zero (0) the cards to use are:
0,1,2,4,6

print_r($flop[0]." ");
print_r($flop[1]." ");
print_r($flop[2]." ");
print_r($flop[4]." ");
print_r($flop[6]." ");


//create new hands that include the flop cards
$flopPlayCards=array($flop[0],$flop[1],$flop[2],$flop[4],$flop[6]);


These should more correctly be referred to as the "board" but I don't want to go changing variable names around at this time.

  3. Re: number of hands; flop burn cards   Reply   Report abuse  
Picture of Jayme Fishman Jayme Fishman - 2006-12-29 12:08:50 - In reply to message 1 from Brian Pang
Brian - you can choose to count from 0 or 1 when you pass the playnum argument ... your choice. However, that is not a bug.