Nerdjack - Blackjack for Nerds ;)

Blackjack pays 3:2 - Dealer stands on 17 - Insurance pays 2:1

Cash:
Round:
Info:
Stats:
Your name:
function bet(cash, shuffled, stats) { /* shuffled // boolean, true if the deck was freshly shuffled (thus has all 52*6 cards) cash // number, your current amount of cash return how much you want to bet (1 to 1000) */ return Math.min(100, cash); } function command(data, stats) { /* data contains: yourCards // array of string, cards you have drawn (try: stats.c = data.yourCards) dealerCards // array of string, cards the dealer as open yourTotal // number, your highest total at the moment followActions // array of string, actions you can choose from: hit, stand, double, split */ // Dummy logic: just do what you can ;) if (data.followActions.includes("double")){ return "double"; } else if (data.followActions.includes("split")) { return "split"; } else if (data.followActions.includes("hit")) { return "hit"; } return "stand"; } function insurance(data, stats) { /* data contains: yourCards // array of string, cards you have drawn dealerCards // array of string, cards the dealer as open, must be any single Ace yourTotal // number, your highest total at the moment */ return false; // return if you want to buy an insurance } function result(data, stats) { /* data contains: yourCards // array of string, all cards you have drawn dealerCards // array of string, all cards the dealer has drawn yourTotal // number, your final value dealerTotal // number, the dealer's final value result // string, the result payout // number, payout amount */ // this method is for collecting statistics only. No decision as to be made here. // return true; // if you want to stop playing with this player and start over again } /* the object behind the stats parameter is always the same object, so you can collect statistics during the entire runtime of Start or Start100x. The content of stats is written to the stats div. */ function begin(stats) { // called before a player and deck is created } function cashUpdate(cash, stats) { // called after a game was played // return true; // if you want to stop playing with this player and start over again } function end(finalMoney, maxMoney, stats) { // called after a player went bankrupt // maxMoney is the highest amount of money this player had during its lifetime }