This is a very stripped down version of A BlackJack KOTH contest...
This is the goal:
Upon the execution: There are two inputs, "H" to hit (have the code deal a card), "S" to stand (Stop getting cards, and let dealer try to win).
Coding Rules:
- There is no betting or splitting of hands, for simplicity of the challenge.
- Suits are HDCS; standing for Hearts, Diamonds, Clubs and Spades respectively.
- Trumps must be formatted as A23456789TJQK, where T is the 10; therefore TH is the 10 of Hearts, etc.
- A is worth 1 or 11. Face cards are worth 10 points. A perfect game is 21 points.
- If you go over 21 points, the output along with the cards must show "BUST".
- If the dealer goes over 21 points and you're standing, output with cards must show "WIN"
- If the dealer beats you even though you're standing, output with cards must show "LOSE"
- If the dealer matches your score on standing, output with cards must show "PUSH"
- Dealer must stand on 17 through to 21.
- If you Stand, it calculates your score and displays it (see below), and then goes into dealer play mode. If the dealer stands or busts, it calculates its score and displays it.
- Standard 52 cards in a deck, no duplicates can be generated.
Output must resemble the following:
H Your hand: 3H H Your hand: 3H 8S H Your hand: 3H 8S 9D S Standing... Your hand: 3H 8S 9D = 20 points My hand: 2C 5H 8H 9S = 24 points WIN
Shortest code wins