Do you know how to code for a Black Jack
On behalf of our fellow CEan #-Link-Snipped-# , I am putting a question before all CEans over here:
"BlackJack is a very well known gambling card game played against a dealer in a casino. In his card game, each player is trying to beat the dealer, by obtaining a sum of card values notmore than 21 which is greater than the sum of dealer card values. Player is initially given 2 cards, but he could choose to hit(ask for 3rd card) or stand (no more cards). If he chooses to hit for 3rd card and total score crosses 21 he get busted (losess irresopective of the total score of dealer cards). Face cards(Jack, Queens and Kings) are worth 10 points. Aces are worth 1 or 11, whichever is preferable. Other cards are represented by their number."
Here , you have to implement a conservative player strategy of playing blackjack. This conservative player does not want to get busted and hit only when its safe to do so.
He follows following strategy:
hit if(score<=11) or (an ACE is held)
stand otherwise
Write a program to implement the above strategy given the initial 2 cards of the player.
[ PS: Rohit, Please check if I have missed anything here. ]