Constructor
# new BlackJackGame(randomSeednullable)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
randomSeed |
number
|
<nullable> |
the random seed |
Members
Methods
# dealer() → {BlackJackDealer}
Get the dealer
# gameState() → {BlackJackGameState}
Get the games state
# player() → {BlackJackPlayer}
Get the player
# playerHasNatural() → {boolean}
Return whether the player has a natural blackjack
whether the player has a natural blackjack
boolean
# reset(reinitopt) → {boolean}
Reset the game
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
reinit |
boolean
|
<optional> |
true | Whether to reinitialize the game |
boolean
# step(actionString) → {StepResult}
Make an environment step
Parameters:
Name | Type | Description |
---|---|---|
actionString |
BlackJackActionKey
|
The action |
The result
# static encodeStateToIndices(state)
Encode the state to a number encoded array
Parameters:
Name | Type | Description |
---|---|---|
state |
BlackJackGameState
|
the state |
the encoded array