In Public:courses.cs456 there are a collection of bit-maps which represent the 52 different playing cards. Write a VB interface for a simplified game of Blackjack.
Briefly the play of the game should proceed as follows:
- There is one player and one dealer.
- The player makes a bet in $$$$$.
- The player is dealt 2 cards which are visible.
- The player now tries to get as close to a score of 21 as possible where face cards count as 10, the ace as 11 and all other cards count the value on their face. If you have a total count that is greater than 21 then you have BUST and you lose.
- The player may ask for one or more cards until he feels he is as close to 21 as he feels he needs to get. He then STANDS. Then he turns play over to the dealer.
- The dealer then takes 2 cards. If he has 17 or more he STANDS otherwise he keeps taking cards until he either ends up with 17 or more (STANDS or he has more than 21 (BUST).
- If the player is closer to 21 than the dealer he wins.
- If the dealer is closer to 21 than the player he wins.
- If the player BUSTS and the dealer has 17 or more then the dealer wins.
- If the player BUSTS and the player has not then the player wins.
- If both dealer and player busts or their count is tied then it is a TIE and nobody wins.
Write VB code that will play the game until the player says STOP. Keep track of the total winnings of the player.
(Prepared by Ken Blundell, UMKC)