• 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: Dice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dice


  • Subject: Re: Dice
  • From: kai <email@hidden>
  • Date: Fri, 29 Oct 2004 22:44:02 +0100


On Fri, 29 Oct 2004 11:23:46 -0400, Michael Sullivan wrote:

At 12:10 AM -0700 10/26/04, Michelle Steiner wrote:

[snip]

Hmm, which of the following is the fastest?

random number from 1 to 6
some word of "1 2 3 4 5 6"
some item of {1,2,3,4,5,6}

Some item is by far the fastest.

In the context of a range of 6 numbers/items. However, as I pointed out earlier, 'random number' shows speed advantages over the list-based methods as the range of numbers increases (e.g: random number from 1 to 6000).


With regard to extracting items from strings, I'd expect 'some word' to be a tad slow, due to the complexities of defining what constitutes a word. However, < some item of "123456" > (< some character of "123456" >) or < some paragraph of "1
2
3
4
5
6" > might still be worth a look (bearing in mind that item/character of a string is limited to a single character).


But none of these are nearly as fast as writing your own random number generator in applescript. :)

I developed an applemod called pseudoRand to do this because I was running monte carlo sims that needed millions of trials and I wanted them to finish in an hour or two instead of weeks.

Whatever happened to applemods anyway? The link has been saying "under construction for a year or more. Is it dead? Is that a sign of general bad things at macscripter.net?

I went to:

http://applemods.macscripter.net/

- where it said: "Currently online and working."

I found your pseudoRand applemod at:

http://applemods.macscripter.net/getMod.php?script_ID=44

The "some item" and "some word" calls vary in speed depending on the size of the list/string, which my Random(a,b) does not (whatever range you choose, it takes approximately the same time to generate a number).

This is also true of 'random number from...' - although I don't doubt that pseudoRand is faster. :-)


Thanks Michael. I look forward to playing with this when I get a moment...

---
kai

_______________________________________________
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: Dice
      • From: kai <email@hidden>
  • Prev by Date: Re: [OT] Typo, someone was asking?
  • Next by Date: Re: How to find current user?
  • Previous by thread: Re: Dice
  • Next by thread: Re: Dice
  • Index(es):
    • Date
    • Thread