Re: A puzzle
Re: A puzzle
- Subject: Re: A puzzle
- From: KOENIG Yvan <email@hidden>
- Date: Fri, 21 Nov 2008 18:39:23 +0100
Le 21 nov. 2008 à 18:25, Anthony Sharman a écrit :
Everyone is timing this puzzle but no one is saying what machine
they are using. Mr Fuller's 30 seconds is 53 seconds on my G5.
On my G5 2 x 2 GHz under Mac OS X 10.4.11, it required 31 seconds.
In fact what is interesting here, from my point of view, is that 1 is
a text item while other digits aren't.
On 21 Nov 2008, at 18:17, Luther Fuller wrote:
And this cuts it down to 30 sec ...
set startTime to (current date)
set AppleScript's text item delimiters to {"1"}
set counter to 0
repeat with i from 0 to 999999
set counter to (counter + (count (text items of (i as text))) - 1)
end repeat
(current date) - startTime
display dialog (counter as text) & return & the result & " sec"
Yvan KOENIG (from FRANCE vendredi 21 novembre 2008 18:39:15)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >A puzzle (From: Michelle Steiner <email@hidden>) |
| >Re: A puzzle (From: Luther Fuller <email@hidden>) |
| >Re: A puzzle (From: Anthony Sharman <email@hidden>) |