function simDealer(P, comp, cards, dealer, shuffledComp) {
    while(
      (dealer & VALUE_MASK) < 17 ||
      dealer === DEALER_TEN ||
      dealer === DEALER_ACE ||
      (params.soft17 && dealer === 49)
    ) {
      let nextCard = drawCard(comp, cards, shuffledComp);
      let oldDealer = dealer;
      dealer = P[HAND_STATES.indexOf(dealer)][nextCard];
    }
    return dealer;
  }
// Run dealer until it hits an endstate or bust
Run dealer until it hits an endstate or bust
Run dealer until it hits an endstate or bust
function simDealer(P, comp, cards, dealer, shuffledComp) {
    while(
      (dealer & VALUE_MASK) < 17 ||
      dealer === DEALER_TEN ||
      dealer === DEALER_ACE ||
      (params.soft17 && dealer === 49)
    ) {
      let nextCard = drawCard(comp, cards, shuffledComp);
      let oldDealer = dealer;
      dealer = P[HAND_STATES.indexOf(dealer)][nextCard];
    }
    return dealer;
  }
function simDealer ( P , comp , cards , dealer , shuffledComp ) { while ( ( dealer & VALUE_MASK ) < 17 || dealer === DEALER_TEN || dealer === DEALER_ACE || ( params . soft17 && dealer === 49 ) ) { let nextCard = drawCard ( comp , cards , shuffledComp ) ; let oldDealer = dealer ; dealer = P [ HAND_STATES . indexOf ( dealer ) ] [ nextCard ] ; } return dealer ; }
Run dealer until it hits an endstate or bust
Run dealer until it hits an endstate or bust