[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Series for Blackjack

Posted on 2003-12-02
5
Medium Priority
?
387 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 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:

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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month18 days, 21 hours left to enroll

834 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