jstone3503
New member
- Joined
- Nov 20, 2006
- Messages
- 3
- Programming Experience
- 1-3
Hey guys. I am having to make a Blackjack program using Visual Basic for my final for my programming class, but I'm having some problems with it and was wondering if somebody could point me in the right direction. Don't worry I'm not cheating, just needing some advice.
Here is what we have to do:
1. Ask for the player's name.
2. Has a deal, hit, stay and quit button.
3. Player starts with $5,000.
4. Player should be able to click hits to get as close to or equal to 21 without going over. The player can only receive a maximum of five cards.
5. Dealer's cards are not shown until the stay button is clicked.
6. If the dealer's card dont total 17 or higher, they must hit until they reach 17 or higher.
7. If both dealer and player have the same total and both are less than or equal to 21, a label will display "Push" or "Win" or "Lose" based on whether the Dealer or Player wins.
OK here's where I need some help. We have not learned arrays yet, so I'm having to use Do While or Do Until Loops.
I have a random generator create two random numbers for the first two cards automatically.
I can't figure out how to do the 17 thing with the dealer. If their total is less than 17, it will create another random number and add that to the total and check to see if its still less than 17 and so forth until it either reaches 17 or the dealer has 5 cards.
Can someone help me figure out how to use the random generator in this loop...that is the toughest part I'm having problems with.
Thanks in advance.
Here is what we have to do:
1. Ask for the player's name.
2. Has a deal, hit, stay and quit button.
3. Player starts with $5,000.
4. Player should be able to click hits to get as close to or equal to 21 without going over. The player can only receive a maximum of five cards.
5. Dealer's cards are not shown until the stay button is clicked.
6. If the dealer's card dont total 17 or higher, they must hit until they reach 17 or higher.
7. If both dealer and player have the same total and both are less than or equal to 21, a label will display "Push" or "Win" or "Lose" based on whether the Dealer or Player wins.
OK here's where I need some help. We have not learned arrays yet, so I'm having to use Do While or Do Until Loops.
I have a random generator create two random numbers for the first two cards automatically.
I can't figure out how to do the 17 thing with the dealer. If their total is less than 17, it will create another random number and add that to the total and check to see if its still less than 17 and so forth until it either reaches 17 or the dealer has 5 cards.
Can someone help me figure out how to use the random generator in this loop...that is the toughest part I'm having problems with.
Thanks in advance.