Chapter 10. Blackjack

Blackjack
  • the footer and header tags, which are new to HTML5

  • capturing key presses

  • programmer-defined objects

  • generating Image elements using a set of external image files

  • shuffling a deck of cards

Introduction

The objective of this chapter is to combine programming techniques and HTML5 and JavaScript features to implement the card game blackjack, also called 21. The implementation will make use of new tags introduced in HTML5, namely footer and header. We will make use of the footer to give credit to the source for the card images and the web site we are using for the shuffling algorithm. The cards are created using programmer-defined objects ...

Get The Essential Guide to HTML5: Using Games to Learn HTML5 and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.