Blackjack
This sample demonstrates use of the <script>, <var>, <assign>, <if>, <else>, and <elseif> elements:
- It deals a hand of blackjack (the gambling card game).
- It lets the player choose "hit" or "hold".
Notes for running Blackjack
Initial page URI
http://hostname:8090/BlackJack/Blackjack.vxml
Sample dialog
|
Application |
The dealer is showing a King of Hearts and you have a Ace of Spades and a 2 of Spades. Would you like to hit or hold? |
|
Caller |
Hit. |
|
Application |
You’ve drawn a 7 of Hearts bringing your score up to 20. Would you like to hit or hold? |
|
Caller |
Hit. |
|
Application |
You’ve drawn a 6 of Clubs bringing your score up to 16. Would you like to hit or hold? |
|
Caller |
Hit. |
|
Application |
You’ve drawn a 4 of Diamonds, bringing your score up to 20. Would you like to hit or hold? |
|
Caller |
Hold. |
|
Application |
The dealer’s other card is a 8 of Spades. The dealer draws a Jack of Hearts. Dealer busts. Thanks for playing. |