2010 | OriginalPaper | Chapter
Blackjack
Activate our intelligent search to find suitable subject content or patents.
Select sections of text to find matching patents with Artificial Intelligence. powered by
Select sections of text to find additional relevant content using AI-assisted search. powered by
In this chapter, you learned how to implement a card game using features of HTML5, JavaScript, and CSS along with general programming techniques. These included
Generating a set of Image objects based on names of external files
Designing a programmer-defined object for cards, incorporating the Images
Drawing images and text on the screen
Making use of for, while, and if to implement the logic of blackjack
Using calculations and logic to generate the computer’s moves
Establishing event handling for the keydown event so that the player could indicate a request to deal a new card, hold, or start a new game and using switch to distinguish between the keys
Using the header and footer elements, new to HTML5, for directions and giving credit to sources
This is the last chapter of this book. I hope you take what you have learned and produce enhanced versions of these games and games of your own invention. Enjoy!