質問

I need to construct code which will decide when dealer should 'hit' or when to 'stay' in black jack game.

I'm not sure how to get the grip of a dealer taking a bit educated guess whether to draw another card or stay with original cards etc.

I don't want to hard code anything.

Any ideas?

役に立ちましたか?

解決

This sounds more like a question about the rules of blackjack than a programming question. Rules of the house is that the dealer has to keep hitting until it reaches 17 or greater. That can be hard coded as its a rule of the game.

他のヒント

The dealer could cheat and count the cards. If the probability of getting a good card is bigger than 50%, it would try to get the next card. Else, it would stop.

You just need to count all the "good" cards, and see if the count is bigger than half of the total numbers of cards in the deck.

This would obviously give an advantage to the dealer. You could make it easier or harder to win against the dealer by varying the probability.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top