HTML and CSS Reference
In-Depth Information
Code
Explanation
}
Closes the function
function swapindeck(j,k) {
Helper function for the swapping
var hold = new MCard(deck[j].num,deck[j].
suit,deck[j].picture.src);
Saves the card in position j
deck[j] = deck[k];
Assigns the card in the k position to
the j position
deck[k] = hold;
Assigns the hold to card in the k
position
}
Closes the function
</script>
Closes the script element
</head>
Closes the head element
<body onLoad="init();">
Opening tag to set the call to init
<header>Press d for deal 1 more card,
h for hold, n for new game.</header>
Header element containing
instructions
<canvas id="canvas" width="800" height="500">
Canvas opener
Your browser doesn't support the HTML5
element canvas.
Warning to noncompliant browsers
</canvas>
Closes the element
<footer>Card images from http://www.eludication
.org/playingcards.html, Creative Common License
( http://creativecommons.org /
licenses/by-sa/2.5 /). <br/>
Opens the footer element, which
contains credit for card images and
a link to the Creative Common
License
Fisher-Yates shuffle explained at
http://eli.thegreenplace.net
/2010/05/28/the-intuition-behind-
fisher-yates-shuffling
Adds the credit for article on the
shuffle algorithm
</footer>
Closes the footer
Search WWH ::




Custom Search