Simple One Game Blackjack 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
Javascript 838

The very first version, not optimized !
All rules are not fully observed, :-o

!function(){var f=require("readline").createInterface(process.stdin,process.stdout),g=[],h=function(){for(var b;!b||-1&lt;g.indexOf(b);)b="A23456789TJQK".charAt(13*Math.random()|0)+"HDCS".charAt(4*Math.random()|0);g.push(b);return b},k=function(b){var a=0,d=0;for(z=b.length;z--;){var c=b[z].charAt(0);/[TJQK]/.test(c)?a+=10:/[2-9]/.test(c)?a+=+c:"A"==c&amp;&amp;(d++,a++)}for(;d--;)21&gt;=a+10&amp;&amp;(a+=10);return a};(function(){var b=[],a=[],d=0,c=0;f.prompt();f.on("line",function(e){e=e.charAt(0);"H"==e&amp;&amp;(b.push(h()),
c=k(b),console.log("Your hand: "+b+" = "+c+" points"),21&lt;c&amp;&amp;(console.log("LOSE"),process.exit(0)));if("S"==e){for(;17&gt;(d=k(a));)a.push(h());console.log("My hand: "+a+" = "+d+" points");21&lt;d||d&lt;c?console.log("WIN"):d&gt;c?console.log("LOSE"):console.log("DRAW");process.exit(0)}f.prompt()}).on("close",function(){process.exit(0)})})()}();


Execute it with nodeJS