Series for Blackjack

Hello experts,

Please help me ASAP.
I want to create a series of winning/losing combinations for the blackjack game.

I want a visual basic code to that job.
Depending on the condition the application should generate a series of cards for both player and dealer.

Condition (Parameter) Dealer BJ:

Can any one explain me the logic? I code is available it is really cool.

I gan give you more points for this but the application should be working perfect.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
What is your end goal here bhalpa?  It does seem that you are tyring to write a less than honest game:

Shuffle the deck and deal them as they are.

You want to do it this way:

Shuffle the deck into an array. Deal the cards as they are. Hit on 16, stay on a hard 17. Never double or split, but allow the player that option. These are the rules that casinos use, and they win over time. The player may or may not win every time, but they always have the illusion that they are winning, when over time you are.

No one is going to play a game that has less than normal odds. I don't see why you're trying to make it that way.
Most games that want people to return to them keep up with their winnings as well. So in true effect there is always going to be the competition for the most "money". The logic behind this would be opposite of the casino, the user must be the winner over time. No one is going to continue to play a game that they are slowly but inevitably going to loose either especially if there is money involved.
bhalpaAuthor Commented:
All i need is a working code...
I am trying to create a game on a condition.

If any body can help, points are there....

Ok then...

You're not going to be able to create a list of all possible combinations. Think about how many combinations one deck would hold. However, you can generate the win on the fly:

First, decide if you want this to be a win. If yes, then throw the dealer a card with a value from 8-10 (do this randomly, so it isn't the same every time). Then, throw the player a lower card, from 2-6 (again, random). Then, throw the dealer another 10-11. This guarantees him at least an 18, which you can sit on. You may even spice it up a bit by throwing him a low card, and then hitting on it during gameplay to make it look more realistic, and not such a blatant win. Then, you throw the player a ten or ace. He'll have something between a 12 and 17. If he stays on 17, you win. If he hits, then calculate what you need to make him lose. On a 12, you would want to dish him a low card, perhaps a 2-5. He'll either stay and lose, or hit again, where you would throw him a card to make him bust. Now, you'll just want to reverse the order of the two cards here and there.

If you want it to be a loss, then reverse this. Throw in an occasional bust to make it look realistic.

The hard part is making it look like you aren't cheating. That's going to be nearly impossible, as any gameplayer can see through schemes like this. The point here is that the player is never going to win, which means they aren't going to have fun, which means your game is not going to be played. If you play by casino rules, you will win a majority of the time, making it actually realistic. But if you insist on a 66% win, then you would use the method above. It just requires a lot more thought to code than the normal blackjack...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.