Exemplo n.º 1
0
function displayScores()
{
    $scores = '';
    $a = new Pontoon();
    $deck = $a->newShuffledDeck();
    $hand = $a->dealCards($deck, 2);
    foreach ($hand as $card) {
        $scores .= $card['name'] . " of " . $card['suit'] . "<br>";
    }
    $score = $a->scoreHand($hand);
    $scores .= "Your possible scores are ";
    foreach ($score as $option) {
        $scores .= $option . ", ";
    }
    return $scores;
}
Exemplo n.º 2
0
 /**
  * @param $hand
  * @param $expectedResult
  *
  * @dataProvider handProvider
  */
 public function testHands($hand, $expectedResult)
 {
     $a = new Pontoon();
     $this->assertEquals($expectedResult, $a->scoreHand($hand));
 }