Implement a blackjack cards game with betting between 1 user and the computer (dealer). We will use a deck of playing cards with the following cards 2 3 ... 10 J Q K A of: hearts diamonds clubs spades. At the beginning of the game, the user starts with $20 and can bet at most 2 dollars per game (i.e., the user can only bet $1 or $2). At the beginning of each round, the user places his bet in his "betting box". The user box is dealt an initial hand of two cards visible to the user. The computer/dealer's hand receives its first card face up, and its second card face down immediately (the hole card), which the computer does not reveal unless it makes the its hand a blackjack.
The user's object is to win money by creating card totals which will turn out to be higher than the dealer's hand, but without exceeding 21 ("busting"/"breaking"). The user must choose whether to "hit" (take a card), "stand" (end their turn), "double" (double wager, take a single card and finish), "split" (if the two cards have the same value (i.e., rank, e.g., the player can split if he has 2 queens), separate them to make two hands) or "surrender" (give up a half-bet and retire from the game).
Once the player splits, he is only allowed to play hit and stand. The bets are made before the choices of the player, so it is considered the same for both hands in the case of a split. If one hand looses, then the player continues with the other hand. If both hands win, then the player wins double the bet.
Number-cards count as their natural value; the jack, queen, and king (also known as "face cards" or "pictures") count as 10; aces are valued as either 1 or 11 (i.e., the program should sum up with both values (1 and 11) for Ace and take the value that makes the sum less or equal than 21, but closer to 21.) If the hand value exceeds 21 points, it busts, and all bets on it are immediately forfeit. Details about player decisions are available here: http://en.wikipedia.org/wiki/Blackjack#Player_decisions
Check that the same cards are not distributed as duplicates in the same game round!
After the user finished playing, the dealer's hand is resolved by drawing cards until the hand busts or achieves a value of 17 or higher. The dealer never doubles, splits nor surrenders. If the dealer busts, then the user wins. If the dealer does not bust, the user wins the bet if his hand is higher than the computer's, and loses if it is lower. In the case of a tied score, known as "push" or "standoff", bets are normally returned without adjustment. Wins are paid out at 1:1, or equal to the wager, except for winning blackjacks, which are traditionally paid at 3:2 (meaning the player receives three dollars for every two bet), or one and a half times the wager. Aces are valued 11 by the computer.
Your game should play 10 hands and print the purse of the user.