kedoska / engine-blackjack

Javascript library to make blackjack engines
GNU General Public License v2.0
33 stars 29 forks source link

Dealer should check for Blackjack on 10,J,Q,K #3

Closed kedoska closed 8 years ago

kedoska commented 8 years ago

Rules

  1. when Dealer's first card is any 10, J, Q or K we should check for BJ
  2. if Dealer has BJ, go to showdown

    Doubts

  3. how you call this behavior / rule?
  4. is this in any derived variants of the game or should be a configuration?
gsdriver commented 8 years ago

Most American casinos do check the hole card with a 10-value card showing; in Europe (European no-peek variant), the dealer doesn't check the hole card even with an Ace showing. There should be a rules variant that doesn't check and go to showdown in this case.

I personally haven't seen a casino that doesn't check for a BJ with a 10 showing when they do check with an Ace showing - they either check the hole card in both cases or in neither case

kedoska commented 8 years ago

Yes, my only problem with this "check" is that now the "environment" (miniserver in the example) must care about 2 things:

  1. hide the deck here
  2. and now mask the second card of the dealer (after deal)

With that assumed, we can create a no-peek (on/off rule) that will do the magic during the deal. dealerHasBlackjack is there... will use it.

gsdriver commented 8 years ago

Yeah, I'm looking at this and noticed that dealerCards only has one card after Deal, so there is no way to check. I'm thinking of adding a new dealerHoleCard to the state so that the client can ignore it (could even mask this value from the client entirely until we transition to showdown), but we can still look at it internally if we peak

kedoska commented 8 years ago

https://github.com/kedoska/engine-blackjack/blob/master/src/game.js#L212

there... we probably should just pull the 2nd card.

the problem i was proposing (hide the second card) is actually "only related" to live environment but maybe we will have tester for RTP, or we just want to use this in a simulator to teach the player to play BJ.

I think we can assume that second card of the dealer must be mask after until showdown... in any case we do that for deck/s