kedoska / engine-blackjack

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

getPrize must perform calculation consider hi AND lo #49

Closed kedoska closed 7 years ago

kedoska commented 7 years ago

After the fix for #47 we now need to consider that handValue.hi is not the only available value to be considered in getPrize The following code is not enough at this point:

  if (playerValue.hi > dealerValue) {
    return (bet + bet)
  } else if (playerValue.hi === dealerValue) {
    return bet
  }