Re: Bridge anyone? [not off topic]
Re: Bridge anyone? [not off topic]
- Subject: Re: Bridge anyone? [not off topic]
- From: Graff <email@hidden>
- Date: Wed, 03 Nov 2004 20:13:05 -0500
On Nov 3, 2004, at 7:16 PM, Nigel Garvey wrote:
Graff wrote on Wed, 03 Nov 2004 12:43:17 -0500:
Well here's a more traditional method for shuffling a deck: cutting
and
riffling. Basically this cuts the deck at a random point, places the
bottom cut on the top and then splits the deck into two equal halves
and interleaves them. According to most of the literature the deck
will be random after 7 riffles. I get 10000 shuffles in 15 seconds
for
this unoptimized script on my dual 2gHz G5. Anyone care at taking a
crack at optimizing this to see if it can get faster?
On my system, 1000 of your 7-riffle shuffles take about 35 seconds. In
the following version, they take about 30. It doesn't physically "cut
the
pack", but works out where each card would have been if it had. I'm not
100% sure I've got the calculation right, but it hasn't errored yet.
Odd, I just ran your version and my version side-by-side and got pretty
much the same time for each, about 15 seconds for 10000 shuffles. I'm
running under a stock AppleScript installation, no extra OSAX and I'm
running the script from Script Editor.
I wonder why your script took 14% less time than my script when it was
run in your environment, I can't think of anything offhand that would
cause that much of a change.
- 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