Visa källkod
Nedanstående filer finns i denna katalog. Klicka på en fil för att visa dess innehåll.
- .buildpath
- .project
- CCard.php
- CCardHand.php
- CDeck.php
- argyle.jpg
- card.php
- common.php
- deck.php
- grunge.jpg
- hand.php
- index.php
- sessDest.php
- sessions.php
- sessions_mroos.php
- source.php
- template.php
- tiles.jpg
Stäng "deck.php"
<?php
// ===============================================================
// Contents: Kortgrejer.
// Author: Staffan Lindsgård
// ===============================================================
$pagetitle = "Korta leken!";
$customhead = "";
require_once "common.php";
echo $page_top;
// ===============================================================
// Inkluderar externa PHP-filer.
require_once "CDeck.php";
// ===============================================================
// Inställningar för felsökning.
error_reporting(-1);
$debug = false;
$debug = (empty($_GET['debug']) ? $debug : $_GET['debug']);
$debug = ($debug=="true" ? true : false);
$debug_out = "<h1 class='debug'>Debug info</h1>\n";
// ===============================================================
// Skriver lite variabler.
$deck1 = new CDeck();
$html = "<h2>Visa kort i en oblandad lek</h2>\n";
while($card = $deck1->DealFromTop()) {
$card->FlipCard();
$html .= $card->GetCardAsCSS();
}
$deck2 = new CDeck();
$deck2->Shuffle();
$html .= "<h2>Visa fem kort från en blandad lek</h2>\n";
for($i = 1; $i <= 5; $i++) {
$card = $deck2->DealFromTop();
$card->FlipCard();
$html .= $card->GetCardAsCSS();
}
?>
<h1>Hur ser min kortlek ut?</h1>
<?php echo $html; ?>
<?php echo ($debug == true ? $debug_out : ''); ?>
<?php
echo $page_bottom;
?>