Series for Blackjack

Posted on 2003-12-02
Last Modified: 2010-05-01
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.
Question by:bhalpa
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
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.


Expert Comment

Comment Utility
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.

Expert Comment

Comment Utility
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.

Author Comment

Comment Utility
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....


Accepted Solution

devoted2christ earned 200 total points
Comment Utility
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...

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now