INDEX
craps game (sample), 21–66
building, 38–65
the complete game, 55–65
customizing, 63
opening screen for, 39
rules of the game, 21–23, 27, 55
single-die throws for, 40–47
testing/uploading, 65
text output form for, 38
two-die throws for, 47–55
uploading, 65
createElement method
Hangman game sample and, 296
quiz sample and, 187
Creative Common License, 323
CSS styles, 1, 4, 8–10
blackjack card game sample and, 323–330
bouncing ball sample and, 70–80
cannonball sample and, 101–111
craps game sample and, 24–38
curly brackets ({ }) and, 270
formatting and, 7
Hangman game sample and, 295–302
memory game sample and, 146–154
quiz sample and, 189–193
rock-paper-scissors game sample and,
263–274
slingshot sample and, 101–111
ctx (sample) variable, 30
bouncing ball sample and, 70
Hangman game sample and, 298
rock-paper-scissors game sample and, 264
cur variable, 300, 301
curly brackets ({ }), 154, 270, 324
curwall variable, 220, 231
customizing
blackjack card game sample, 346
bouncing ball sample, 95
cannonball sample, 127
craps game sample, 63
favorite web sites sample, 18
Hangman game sample, 315
mazes , 256
memory game sample, 176
quiz sample, 183, 201, 209
rock-paper-scissors game sample, 262, 284
cx property, intersection and, 222
cy property, intersection and, 222
D
date and time
measuring elapsed time and, 147, 230
quiz sample and, 201
storage/retrieval sample application for,
224–230
within head element, 10
Date function, 11
date and time storage/retrieval and, 224
measuring elapsed time and, 147, 230
days in the month calculation (sample), 29
deal function, for blackjack card game sample,
325, 331
dealfromdeck function, for blackjack card game
sample, 325, 326, 331
dealing cards, in blackjack card game sample,
324–327
dealstart function, for blackjack card game
sample, 325, 330
dealt attribute, 324, 326
deck variable, memory game sample and, 152
declaration statements, 26
defer method, 296
degrees
converting to radians, 106
programming languages and, 106
devices, 257
dice game (sample). See craps game
distance between points, 110
distsq function, for slingshot sample, 109, 128
div element, 187, 297
do-while loop, quiz sample and, 186
!DOCTYPE tag, 5
dot notation, 102, 147, 324
downloading
audio files, 273
favorite web sites sample, 8
sample applications, 100
drag and drop operations, mouse and, 108
draw functions, for Hangman game sample, 299,
302
draw method, 102, 103, 219
draw1 function
for single-die throws, in craps game sample,
40
for two-die throws, in craps game sample, 47