Re: Bridge anyone? [not off topic]
Re: Bridge anyone? [not off topic]
- Subject: Re: Bridge anyone? [not off topic]
- From: David Andrews <email@hidden>
- Date: Wed, 10 Nov 2004 22:29:06 -0500
Here is a simplified version where cards are picked at random and dealt out sorted (all in just two loops):
set deck to {"AS", "KS", "QS", "JS", "XS", "9S", "8S", "7S", "6S", "5S", "4S", "3S", "2S", "AH", "KH", "QH", "JH", "XH", "9H", "8H", "7H", "6H", "5H", "4H", "3H", "2H", "AD", "KD", "QD", "JD", "XD", "9D", "8D", "7D", "6D", "5D", "4D", "3D", "2D", "AC", "KC", "QC", "JC", "XC", "9C", "8C", "7C", "6C", "5C", "4C", "3C", "2C"}
set dealt to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52}
copy {dealt, dealt, dealt, {}} to {north, east, south, west}
repeat 13 times
set c to (some integer of dealt)
set item c of dealt to missing value
set item c of north to item c of deck
set c to (some integer of dealt)
set item c of dealt to missing value
set item c of east to item c of deck
set c to (some integer of dealt)
set item c of dealt to missing value
set item c of south to item c of deck
end repeat
set north to every text of north
set east to every text of east
set south to every text of south
set dealt to every integer of dealt
repeat with c in dealt
set end of west to item c of deck
end repeat
{north, east, south, west}
-->{{"KS", "9S", "6S", "JD", "XD", "8D", "5D", "3D", "9C", "8C", "5C", "4C", "2C"}, {"AS", "5S", "KH", "JH", "7H", "5H", "4H", "AD", "4D", "2D", "JC", "6C", "3C"}, {"QS", "7S", "4S", "3S", "2S", "AH", "XH", "KD", "7D", "6D", "AC", "QC", "XC"}, {"JS", "XS", "8S", "QH", "9H", "8H", "6H", "3H", "2H", "QD", "9D", "KC", "7C"}}
David A
On Nov 9, 2004, at 11:49 AM, Nigel Garvey wrote:
David Andrews wrote on Mon, 8 Nov 2004 21:17:43 -0500:
copy {emptyHand, emptyHand, emptyHand, {}} to {north, east, south, west}
The emptyHand(s) are not required. -- DA
An interesting development. *Implied* random selection of one hand's
cards. Seems to work. :-)
NG
_______________________________________________
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