• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bridge anyone? [not off topic]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bridge anyone? [not off topic]


  • Subject: Re: Bridge anyone? [not off topic]
  • From: Nigel Garvey <email@hidden>
  • Date: Tue, 2 Nov 2004 20:48:04 +0000

I wrote just now:

>And of course that handler can be optimised still further:  :-)
>
>  on NewDeal()
>    set new_hands to {{}, {}, {}, {}}
>    set nh to {1, 2, 3, 4}
>    repeat with c in cards
>      set h to (some integer of nh)
>      set hi to item h of new_hands
>      set end of hi to contents of c
>      if (count hi) is 13 then set item h of nh to missing value
>    end repeat
>  end NewDeal

Better still, use references to the properties:

  on NewDeal()
    set new_hands to {{}, {}, {}, {}}
    set nh to {1, 2, 3, 4}
    repeat with c from 1 to 52
      set h to (some integer of nh)
      set end of item h of my new_hands to item c of my cards
      if (count item h of my new_hands) is 13 then set item h of nh to
missing value
    end repeat
  end NewDeal


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

  • Prev by Date: Re: Bridge anyone? [not off topic]
  • Next by Date: Re: Trouble Getting Into AppleScript
  • Previous by thread: Re: Bridge anyone? [not off topic]
  • Next by thread: Re: Bridge anyone? [not off topic]
  • Index(es):
    • Date
    • Thread