Solved

Series for Blackjack

Posted on 2003-12-02
5
379 Views
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.

example
Condition (Parameter) Dealer BJ:
Dealer:SA|DK
Player:S5|H8|C5

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.
Bhalpa.
0
Comment
Question by:bhalpa
5 Comments
 
LVL 85

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:

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20736961.html

Shuffle the deck and deal them as they are.

Idle_Mind
0
 
LVL 2

Expert Comment

by:devoted2christ
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.
0
 
LVL 9

Expert Comment

by:TooKoolKris
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.
0
 

Author Comment

by:bhalpa
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....

Bhalpa
0
 
LVL 2

Accepted Solution

by:
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...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

766 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