By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

Dealing cards

P: n/a
Hi, could somebody in the right direction to write a program to deal
cards. What I want to do is:
With an 8 deck of cards. I know the player has an ace, the dealer has a
2, is deal every possible scenario, going player,banker then dealer. Up
to max 3 cards each. Also there be rules for when the banker takes a
card or not. Eg if the palyers dealt another ace, then deal all posible
cards for dealer with 2A, and out comes. Thaen again for Player A2 etc,
through to AK. Starting agian with 22 for dealer etc. At the momment Im
using excel to do this, but its slow.
Regards Robert

Nov 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Robert,

Are you perchance trying to calculate the probability of who is the most
likely winner, or just need a program that keeps track of which cards have
already been dealt?

The latter is easy if you use a List or ArrayList and just remove the card
as it is dealt. The former is quite a bit more complex.

This article may give you some useful hints, if not the solution.

http://www.codeproject.com/csharp/blackjack.asp

On Tue, 28 Nov 2006 10:44:28 +0100, Ro********@yahoo.co.uk
<Ro********@yahoo.co.ukwrote:
Hi, could somebody in the right direction to write a program to deal
cards. What I want to do is:
With an 8 deck of cards. I know the player has an ace, the dealer has a
2, is deal every possible scenario, going player,banker then dealer. Up
to max 3 cards each. Also there be rules for when the banker takes a
card or not. Eg if the palyers dealt another ace, then deal all posible
cards for dealer with 2A, and out comes. Thaen again for Player A2 etc,
through to AK. Starting agian with 22 for dealer etc. At the momment Im
using excel to do this, but its slow.
Regards Robert


--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 28 '06 #2

P: n/a
Thakyou for your reply. Yes Im trying to calculate the likely winner,
and the odds to match. Thanks for the link, should keep me busy for a
while.
Regards Robert

Morten Wennevik wrote:
Hi Robert,

Are you perchance trying to calculate the probability of who is the most
likely winner, or just need a program that keeps track of which cards have
already been dealt?

The latter is easy if you use a List or ArrayList and just remove the card
as it is dealt. The former is quite a bit more complex.

This article may give you some useful hints, if not the solution.

http://www.codeproject.com/csharp/blackjack.asp

On Tue, 28 Nov 2006 10:44:28 +0100, Ro********@yahoo.co.uk
<Ro********@yahoo.co.ukwrote:
Hi, could somebody in the right direction to write a program to deal
cards. What I want to do is:
With an 8 deck of cards. I know the player has an ace, the dealer has a
2, is deal every possible scenario, going player,banker then dealer. Up
to max 3 cards each. Also there be rules for when the banker takes a
card or not. Eg if the palyers dealt another ace, then deal all posible
cards for dealer with 2A, and out comes. Thaen again for Player A2 etc,
through to AK. Starting agian with 22 for dealer etc. At the momment Im
using excel to do this, but its slow.
Regards Robert

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.