Black Jack (21) Game
Hey everyone, I love the site/forum. I just started doing C++ after learning C a long long long time ago (back when Communists had more of a chance of running the country than Democrats) and now i'm back into it. The first thing i'm trying to do is make a blackjack game. I've yet to try the FAQ for the random number generator, but i'll suppose it works.
The basic idea of the program is to make a game of 21. Two variables, your hand and the dealers. You can hit or stay. This is the most basic version. Without splitting, suits are not needed. So I want to generate two begining numbers for the persons hand. They can see this variable. Also, two numbers for the dealer's invisable hand (except when they win and show it).
This seems simple in words, but for realistic sake, is it possible to make it so it pulls from a 'deck' of 52. So when one 4 is pulled, there is only 3 more to pull. It's not required at all, but for the sake of argument.
Next hump is aces. Aces can be a 1 or an 11. I am guessing that when the random number generates a 1 (Ace) I can output somthing along the lines of "You drew an Ace. Should it be a 1 or an 11". Then just add to the variable. Simple. But is there an easier way? And could it be possible to change it at a later time? (Like if the person has 4 and an ace. Declaring it an 11, he gets a 15. If he draws and gets a 7 or higher he busts. But he should be able to make it a 1)
That is the basic idea. If you love me so very much, and my Russian heratige (or not) my other post explains the optional parts i'm trying to add. Thanks anyways
-G. Matlin, Rabidpunk