src/Suggestion.js
function ShouldPlayerStand(playerCards, dealerCard, handValue, handCount, options)
{
    var shouldStand = false;

    if (handValue.soft)
    {
        // Don't stand until you hit 18
        if (handValue.total > 18)
        {
            shouldStand = true;
        }
        else if (handValue.total == 18)
        {
            // Stand against dealer 2-8, and against a dealer Ace in single deck if they dealer will stand on soft 17
            shouldStand = ((dealerCard >= 2) && (dealerCard <= 8)) ||
                        ((dealerCard == 1) && (options.numberOfDecks == 1) && !options.hitSoft17);
        }
    }
    else
    {
        // Stand on 17 or above
        if (handValue.total > 16)
        {
            shouldStand = true;
        }
        else if (handValue.total > 12)
        {
            // 13-16 you should stand against dealer 2-6
            shouldStand = (dealerCard >= 2) && (dealerCard <= 6);
        }
        else if (handValue.total == 12)
        {
            // Stand on dealer 4-6
            shouldStand = (dealerCard >= 4) && (dealerCard <= 6);
        }

        // Advanced option - in single deck a pair of 7s should stand against a dealer 10
        if ((options.strategyComplexity != "simple") && (handValue.total == 14) && (playerCards[0] == 7) && (dealerCard == 10) && (options.numberOfDecks == 1))
        {
            shouldStand = true;
        }
    }

    return shouldStand;    
}
function ShouldPlayerStand(playerCards, dealerCard, handValue, handCount, options)
{
    var shouldStand = false;

    if (handValue.soft)
    {
        // Don't stand until you hit 18
        if (handValue.total > 18)
        {
            shouldStand = true;
        }
        else if (handValue.total == 18)
        {
            // Stand against dealer 2-8, and against a dealer Ace in single deck if they dealer will stand on soft 17
            shouldStand = ((dealerCard >= 2) && (dealerCard <= 8)) ||
                        ((dealerCard == 1) && (options.numberOfDecks == 1) && !options.hitSoft17);
        }
    }
    else
    {
        // Stand on 17 or above
        if (handValue.total > 16)
        {
            shouldStand = true;
        }
        else if (handValue.total > 12)
        {
            // 13-16 you should stand against dealer 2-6
            shouldStand = (dealerCard >= 2) && (dealerCard <= 6);
        }
        else if (handValue.total == 12)
        {
            // Stand on dealer 4-6
            shouldStand = (dealerCard >= 4) && (dealerCard <= 6);
        }

        // Advanced option - in single deck a pair of 7s should stand against a dealer 10
        if ((options.strategyComplexity != "simple") && (handValue.total == 14) && (playerCards[0] == 7) && (dealerCard == 10) && (options.numberOfDecks == 1))
        {
            shouldStand = true;
        }
    }

    return shouldStand;    
}
function ShouldPlayerStand ( playerCards , dealerCard , handValue , handCount , options ) { var shouldStand = false ; if ( handValue . soft ) { // Don't stand until you hit 18 if ( handValue . total > 18 ) { shouldStand = true ; } else if ( handValue . total == 18 ) { // Stand against dealer 2-8, and against a dealer Ace in single deck if they dealer will stand on soft 17 shouldStand = ( ( dealerCard >= 2 ) && ( dealerCard <= 8 ) ) || ( ( dealerCard == 1 ) && ( options . numberOfDecks == 1 ) && ! options . hitSoft17 ) ; } } else { // Stand on 17 or above if ( handValue . total > 16 ) { shouldStand = true ; } else if ( handValue . total > 12 ) { // 13-16 you should stand against dealer 2-6 shouldStand = ( dealerCard >= 2 ) && ( dealerCard <= 6 ) ; } else if ( handValue . total == 12 ) { // Stand on dealer 4-6 shouldStand = ( dealerCard >= 4 ) && ( dealerCard <= 6 ) ; } // Advanced option - in single deck a pair of 7s should stand against a dealer 10 if ( ( options . strategyComplexity != "simple" ) && ( handValue . total == 14 ) && ( playerCards [ 0 ] == 7 ) && ( dealerCard == 10 ) && ( options . numberOfDecks == 1 ) ) { shouldStand = true ; } } return shouldStand ; }
Stand Strategy  Note that we've already checkd other actions such as double, split, and surrender So at this point we're only assessing whether you should stand as opposed to hitting
Stand Strategy Note that we ve already checkd other actions such as double split and surrender So at this point we re only assessing whether you should stand as opposed to hitting