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