示例#1
0
        echo $PlayerSue->render();
        echo '<br/>';

        ?>

    </div>
</div>

<div class="clearfix"> <!-- adding some space -->
</div>

<footer>
    <p>
        <?php

        echo 'Number of cards remaining in the deck: ' . $Deck->getNumCards();

        ?>

    </p>

    <p>Thanks for playing!</p>


</footer>

<?php
}

}
?>
<link href="module4-hw-style.css" rel="stylesheet" />

<?php 
include_once 'module4-hw.php';
try {
    //Test Deck
    $deck = new Deck();
    $deck->getCard()->render();
    $deck->getCard()->render();
    $deck->getCard()->render();
    $deck->getCard()->render();
    $deck->getCard()->render();
    echo $deck->getNumCards();
    echo '<hr />';
    $deck->testFunction();
    echo '<hr />';
    //instantiate cards
    $ten = new Card('hearts', 10);
    $ace = new Card('spades', 1);
    $jack = new Card('diamonds', 11);
    $queen = new Card('clubs', 12);
    $king = new Card('hearts', 13);
    //render cards
    $ten->render();
    $ace->render();
    $jack->render();
    $queen->render();
    $king->render();
    //var_dump protected properties
    echo '<h2>10 of Hearts</h2>';
    $ten->testFunction();