Location: PHPKode > scripts > PHP Poker Engine > php-poker-engine/testTexasDeck.php
<?php
//include the deck and engine
include("pokerDeck.php");
include ("phpPokerEngineV3.php");
//set player number
$playnum=4;
//create deck
$texasDeck = new deck();
//shuffles and deals new game
$texasDeck->dealTexas($playnum);
/*
THE FOLLOWING DEMOS HOW TO GET DATA AFTER DEALTEXAS IS RUN
*/
print"<p>\n</p>";
//returns Flop
echo "Flop:  ";
echo $texasDeck->getFlop();
print"<p>\n</p>";
//returns Turn
echo "Turn:  ";
echo $texasDeck->getTurn();
print"<p>\n</p>";
//returns River
echo "River:  ";
echo $texasDeck->getRiver();
print"<p>\n</p>";
print"<p>All pocket hands</p>";
echo $texasDeck->getallPockets();
print"<p>this is player 1's pocket</p>";
echo $texasDeck->getPlayer1Pocket();
print"<p>this is player 1's pocket PLUS the FLOP</p>";
echo $texasDeck->getP1PocketPlusFlop();
print"<p>this is player 1's pocket PLUS the FLOP and the TURN</p>";
echo $texasDeck->getP1PocketFlopTurn();
print"<p>\n</p>";
echo "This is player 1's pocket PLUS the FLOP, TURN, and RIVER";
print"<p>\n</p>";
echo $texasDeck->getP1FinalHand();
print"<p>\n</p>";
/*
THIS CODE WILL EVALUATE HANDS
*/
//declare new variable
$string1;
//set the variable to the final hand of player 1
$string1 = $texasDeck->getP1FinalHand();
print"<p>\n</p>";
//create an array that is the ASCII count from the variable
$chart = count_chars($string1,1);
//create new name for array for massive switch with count results
$chartArray = array($chart);
print"<p>\n</p>";
//create second parameter for evaluation
$evaluateArray = array();
//push in the card values into the array before it is passed
array_push($evaluateArray,$string1);
//instantiate massiveSwitch objec
$testIt = new pokerEngine();
//call handTest method passing both required parameters
$testIt->handTest($chartArray,$evaluateArray);
print"<p>\n</p>";
//get the text description for the hand
echo $testIt->getText();




?>
Return current item: PHP Poker Engine