Re: Search for an algorithm to deal cards with preset conditions



moi wrote:
On Mon, 31 Mar 2008 14:05:43 +0200, Volker Lenhardt wrote:

Sorry for the delay, Stan.

stan schrieb:

Can you post a specfic example?

I don't know: an example of what?


I think he meant an example of the (kind of) restrictions you want o
impose on the dealing. e.g:
{
North has 6 spades, but the highest one is a Jack.
East has 4 spades, including KQ
South has 4 aces and 4 tens,
...
}



State the constraints;
List a valid example of the deal;

I'm still not convinced the specificataion is complete and clear enough
to start coding yet.

There are to be dialogs to choose presets for all 4 hands, explicit
(e.g. strong opening hand, AQ of hearts) or combined (e.g. slam, major
suit fit). Here there will be procedures to validate the input. The
values have to be sound.

Here you make the mistake of assuming domain-knowledge.
Most people here know the playing cards, few of them know bridge, or
bidding. I don't, for instance. Your qualification "strong hand" means
nothing to me, for instance.

Next step: specify suit lengths and point counts out of these presets as
rules for the deal:
minLength[hand][suit]
maxLength[hand][suit]
minStrength[hand][suit]
maxStrength[hand][suit]

This means that there has to be some sort of preselection. I don't know

I am sorry; you are diving into implementation details here.
Too soon, IMHO ... First state the rules, please.

I know I'll need patience and a lot of time - and sometimes the help of
experienced programmers.

All of moi's points above are right on target, especially about
implementing a solution to a problem that isn't well specified.

Have you seen this site:

http://www.rpbridge.net/xbp3.htm

He seems to have put a lot of thought into the task you are trying.

He also has this page:

http://www.rpbridge.net/7z68.htm

Which seems to cover the probability issue. I can't vouch or the
correctness of anything on the site, but on a quick glance it does seem
viable.

.