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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9860295
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

ID: 9861283
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

ID: 9863045
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

ID: 9867422
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
ID: 9867952
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

730 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