Re: Bridge anyone? [not off topic]
Re: Bridge anyone? [not off topic]
- Subject: Re: Bridge anyone? [not off topic]
- From: John Baltutis <email@hidden>
- Date: Thu, 4 Nov 2004 16:36:04 -0800
On 11/04/04, Bernard Bernu <email@hidden> wrote:
> Le 3 nov. 04, ý 18:28, Emmanuel a Ècrit :
>> At 12:11 PM -0500 02/11/04, Graff wrote:
>>>>
>>>> Of the scripts I've seen so far, Bernard's is not only the fastest,
>>>> but it supplies each player's cards ready sorted! I still haven't worked
>>>> out how it works, though. :-)
>>>
>>> Interesting, but I'm not sure if it compromises the randomness of the
>>> hands or not
>>
>> Ken is right to ask. Bernard's algorithm is fast but it does not
>> provide random hands.
>>
>> For instance the probability that the owner of the 2 of clubs also own
>> the 3 of clubs is obviously much larger than 1/4.
>>
>> For example on my first test the 2, 3, 4 and 5 of clubs were in the
>> same hand.
>>
>> Emmanuel
> Emmanuel you are (of course) absolutely right. I appologize for posting
> such stupid alogorithm. The correct way is to continue to give cards at
> random to each player. Then for players with more than
> 13 cards, take at random the additional cards. Then distribute them at
> random to the players having less than 13 cards. Unfortunately,
> even if this is in average very few operations, it needs really more coding
> and it takes at the end a longer time and it looses the ordering of the
> hands. So forget it.
The proper way is to:
1. the dealer, south, shuffles the deck-- randomizing the cards
2. deal the shuffled cards, one at a time from the shuffled deck, to the
east, north, west, and south hands, until each has been dealt--preserves
the random shuffle
3. sort the four hands into suit order: spades, hearts, diamonds, and clubs.
I'll leave the scripting details to the experts.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden