473,396 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dealing cards

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
2 4340
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kelvSYC | last post by:
I'm trying to program something along the lines of a "trading card" idea: I have a single copy of the "card" in the program, yet there may be multiple "instances" of the "card", with differing...
3
by: RR | last post by:
We have cards that are numbered consecutively. These cards are given out to different people in different sized batches. One group might get 5, the next group might get 20. What is a good...
10
by: Arun Nair | last post by:
Can any one help me with this im not getting it even after reading books because there is not much of discussion anywhere a> Implement a calss that represents a playing card. The class should...
11
by: prince99 | last post by:
i am worlking on the cards class so it can do several things. My code is as before but need to change the things to solve given problem Create a new class Deck that represents a pack of 52...
11
by: cazconv2007 | last post by:
hi i have homework due tomorrow been trying to do java homework all week and nothings happening really starting to stress out i dont understand what the program is meant to do or how to use three...
3
by: JayP | last post by:
I'm trying to shuffle a deck of card in C ++, with out having the same card twice. And I'm supposed to give each player 5 cards. And if they want, they can replace 3 cards. Right now I can assign 5...
8
by: garyrowell | last post by:
I have been at this programme for hours trying to work out what is wrong. Any help would be very much appricated. Here is the breif I received. The program This week you are going to write three...
1
by: Vneha | last post by:
import java.util.*; public class Deck { public static int numSuits = 4; public static int numRanks = 13; public static int numCards = numSuits * numRanks; private Card...
7
by: MonkeyHater | last post by:
Okay, so I am have a bit of trouble with my program. The program itself will deal two hands of cards, shuffle the deck, and then deal another two hands. At the moment I have most of the code down I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.