[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: RandomList.xsl from FXSL-xslt2

Subject: Re: RandomList.xsl from FXSL-xslt2
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 2 Oct 2009 05:57:42 -0700
Re:  RandomList.xsl from FXSL-xslt2
On Fri, Oct 2, 2009 at 1:23 AM, Jesper Tverskov <jesper@xxxxxxxxxxx> wrote:
> Hi List
>
> I'm trying to get RandomList.xsl from FXSL-xslt2 working.
>
> The test file provided by FXSL, testRandomList2.xsl, works well for
> shuffling a deck of cards. But the order of the 52 cards is always the
> same.

This is a FAQ.

You need a seed to generate a sequence of random numbers and if you
always start with the same seed, you'll always get the same random
sequence.

In order to have a different seed each time you need it, use the current time.

For example, if you need to make 100 shuffles, first get a sequence of
100 numbers (using the current time as the seed for the generation of
the sequence).

Then use each of these 100 numbers to generate a shuffle.



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.