Global

Members

<readonly> FaceValue :int

Enum of the card faces
Type:
  • int
Properties:
Name Type Default Description
Two int 2
Three int 3
Four int 4
Five int 5
Six int 6
Seven int 7
Eight int 8
Nine int 9
Ten int 10
Jack int 11
Queen int 12
King int 13
Ace int 14
Source:

<readonly> PlayerAction :string

Enum of actions a player can take when it is their turn
Type:
  • string
Properties:
Name Type Default Description
Hit string Hit The player is requesting another card be dealt to them
Stand string Stand The player would like to stick with their current hand
Source:

PlayerResult :int

Possible values for the result of a round.
Type:
  • int
Properties:
Name Type Default Description
Win int 0
Loss int 1
Push int 2
Bust int 3
Source:

<readonly> Suit :string

Enum of the card suits
Type:
  • string
Properties:
Name Type Default Description
Diamonds string Diamonds
Spades string Spades
Clubs string Clubs
Hearts string Hearts
Source:

Methods

containsAce(hand) → {boolean}

Checks to see if a given hand contains at least one Ace
Parameters:
Name Type Description
hand BlackJackHand the hand to search
Source:
Returns:
- returns a value indicating whether the hand contains an ace
Type
boolean

containsCard(hand, faceValue, suit) → {boolean}

Checks to see if a hand contains a specific card, optionally checking the suit as well as the face value.
Parameters:
Name Type Argument Description
hand BlackJackHand The hand to search
faceValue FaceVal The face value to search for
suit Suit <optional>
The suit of the card
Source:
Returns:
- returns a value indicating whether a card with the given face value is contained in the given hand.
Type
boolean

Type Definitions

BlackJackHand

Describes a hand of cards in BlackJack
Type:
  • Object
Properties:
Name Type Description
HandTotal number The total value of the hand
Cards Card[] Array of the cards in this hand.
Source:

Card

Type:
  • Object
Properties:
Name Type Description
FaceVal FaceValue The face value of this card (ie Ace, Two,... King, etc)
Suit Suit The suit for this card.
Source:

RoundResults

An object containing the results (you vs dealer only) for this round. This includes the win/loss/push status as well as the full hand for you and the dealer.
Type:
  • Object
Properties:
Name Type Description
Result PlayerResult The result of the round.
DealerHand BlackJackHand The hand for the dealer
PlayerHand BlackJackHand The hand for the current player
Source:

TurnStatus

The status of the player and dealer for this turn. Gives information about which cards the player is holding and their total value as determined by standard blackjack rules. Similar information about the dealer's hand is provided, however the face down card is omitted.
Type:
  • Object
Properties:
Name Type Description
DealerHand BlackJackHand The hand for the dealer
PlayerHand BlackJackHand The hand for the current player
Source: