• 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: Graff <email@hidden>
  • Date: Tue, 02 Nov 2004 02:53:31 -0500

On Nov 2, 2004, at 2:04 AM, kai wrote:


On Tue, 02 Nov 2004 00:08:29 -0500, Graff wrote:

About the same speed as my version, 10000 shuffles on my machine takes 37 seconds for yours, 37 for mine, 75 for Michelle's.

(dual 2 gHz G5, running in Script Editor with no other windows open)

- Ken

On Nov 1, 2004, at 10:40 PM, Tim Mansour wrote:

I haven't timed this Michelle, but my two cents worth is a technique I used to use on a HP programmable calculator once upon a time ...

Some nifty shuffling routines there from Ken and Tim - which I've 'borrowed' from here:


-----------

script deck
property cards : {"AS", "KS", "QS", "JS", "10S", "9S", "8S", "7S", "6S", "5S", "4S", "3S", "2S", "AH", "KH", "QH", "JH", "10H", "9H", "8H", "7H", "6H", "5H", "4H", "3H", "2H", "AD", "KD", "QD", "JD", "10D", "9D", "8D", "7D", "6D", "5D", "4D", "3D", "2D", "AC", "KC", "QC", "JC", "10C", "9C", "8C", "7C", "6C", "5C", "4C", "3C", "2C"}
end script


repeat with n from 1 to 52
	set r to random number from 1 to 52
	set rItem to item r of deck's cards
	set nItem to item n of deck's cards
	set item r of deck's cards to nItem
	set item n of deck's cards to rItem
end repeat

set north to items 1 thru 13 of deck's cards
set east to items 14 thru 26 of deck's cards
set south to items 27 thru 39 of deck's cards
set west to items 40 thru 52 of deck's cards

-----------

Also not timed, because I'm out of time. Thanks for the exercise, Michelle. G'night, folks. :-)

That speeds things up a bit, 10000 shuffles now take 25 seconds verses 37 for my shuffle.


- Ken


_______________________________________________ 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
  • Follow-Ups:
    • Re: Bridge anyone? [not off topic]
      • From: Bernard Bernu <email@hidden>
References: 
 >Re: Bridge anyone? [not off topic] (From: kai <email@hidden>)

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