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: Tue, 2 Nov 2004 23:16:10 -0500
Try this one for speed:
-------------------------------
-- for pretty cards, <bill> email@hidden gave us:
-- black spade, white heart, white diamond & black club
set suit1 to {«data utxt2660», «data utxt2661», «data utxt2662», «data utxt2663»}
-- white spade, black heart, black diamond & white club
set suit2 to {«data utxt2664», «data utxt2665», «data utxt2666», «data utxt2667»} --< correction
set x to {"A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3", "2"}
set deck to {}
repeat with j from 1 to 4
repeat with i in x
set end of deck to ("" as Unicode text) & (contents of i) & item j of suit1
end repeat
end repeat
-- thanks Bill
set dealt to {}
repeat with n from 1 to 52
set end of dealt to n
end repeat
set hands to {}
repeat with n from 1 to 52
set c to (some integer of dealt)
set item c of dealt to missing value
set end of hands to item c of deck
end repeat
set north to items 1 thru 13 of hands
set east to items 14 thru 26 of hands
set south to items 27 thru 39 of hands
set west to items 40 thru 52 of hands
{north, east, south, west}
-------------------------------
-- suit1:
--{{"8♡", "2♠", "6♣", "K♣", "8♢", "2♡", "2♣", "J♣", "A♢", "Q♡", "5♡", "6♢", "5♣"}, {"6♡", "8♣", "9♣", "K♡", "K♢", "J♡", "9♡", "10♣", "4♠", "Q♠", "10♢", "3♠", "4♢"}, {"3♢", "4♣", "7♡", "J♢", "A♣", "2♢", "4♡", "3♣", "9♠", "J♠", "7♢", "7♣", "10♡"}, {"3♡", "5♢", "Q♣", "A♡", "A♠", "8♠", "7♠", "6♠", "10♠", "Q♢", "K♠", "9♢", "5♠"}}
-- suit2:
--{{"8♦", "3♤", "10♦", "8♥", "4♥", "7♦", "A♦", "6♧", "2♤", "9♧", "2♥", "Q♧", "Q♤"}, {"3♧", "9♦", "2♧", "2♦", "J♦", "8♧", "K♥", "9♥", "7♧", "3♦", "5♦", "4♤", "A♤"}, {"9♤", "Q♦", "K♦", "Q♥", "10♤", "5♤", "J♤", "10♥", "J♥", "J♧", "6♦", "6♤", "K♧"}, {"6♥", "4♧", "7♥", "7♤", "5♥", "A♥", "8♤", "3♥", "A♧", "5♧", "10♧", "4♦", "K♤"}}
David A _______________________________________________
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