Re: random prob
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 50394
interpreted = N
texte = on 5/15/2003 11:06 am, Ron Ceballos at ron@specsimple.com so noted...> i'm having a bit of trouble with this code -- for the life of me i can't get> it to truly give me unique, random numbers, it always duplicates 2 values> > i've been working on it for quite a long time - please help.It sounds like you want a fixed set of numbers, in random order. I'veprobably read the problem entirely wrong. : )If so, you can create a list and shuffle its contents. I used textvariables, but you could use an array if you're on the 5.0 bus.In this example, you'd set the value for [totalNumbers] to the number of SWFfiles in your selected folder.[text]totalNumbers=30[/text][loop start=1&end=[totalNumbers]][text]number[index]=[index][/text][/loop][loop start=1&end=[totalNumbers]][math show=F]pick=floor([random format=float]*[totalNumbers])+1[/math][text]temp=[text]number[index][/text][/text][text]number[index]=[text]number[pick][/text][/text][text]number[pick]=[temp][/text][/loop][loop start=1&end=[totalNumbers]][index]: [text]number[index][/text]
[/loop]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
on 5/15/2003 11:06 am, Ron Ceballos at ron@specsimple.com so noted...> i'm having a bit of trouble with this code -- for the life of me i can't get> it to truly give me unique, random numbers, it always duplicates 2 values> > i've been working on it for quite a long time - please help.It sounds like you want a fixed set of numbers, in random order. I'veprobably read the problem entirely wrong. : )If so, you can create a list and shuffle its contents. I used textvariables, but you could use an array if you're on the 5.0 bus.In this example, you'd set the value for [totalNumbers] to the number of SWFfiles in your selected folder.[text]totalNumbers=30[/text][loop start=1&end=[totalNumbers]][text]number[index]=[index][/text][/loop][loop start=1&end=[totalNumbers]][math show=F]pick=floor([random format=float]*[totalNumbers])+1[/math][text]temp=[text]number[index][/text][/text][text]number[index]=[text]number[pick][/text][/text][text]number[pick]=[temp][/text][/loop][loop start=1&end=[totalNumbers]][index]: [text]number[index][/text]
[/loop]Rob MarquardtDesigner/Resident WireheadToast Design800 Washington Avenue NorthMinneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Rob Marquardt
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WebCatalog 4.0 has been released! (2000)
WebCat2: Formulas.db question (1997)
PIXO support (1997)
[WebDNA] Putting '&search' into URL killing all search contexts on my sites (2010)
Payment calculator ?? (2000)
Late on Friday.... brain fried (2002)
WebCat2b15MacPlugin - showing [math] (1997)
Sort Order on a page search (1997)
[WebDNA] Grep out square brackets? (2010)
when is date system date or order date? (1997)
Bug? (1997)
Logging purchases (1997)
FW: ANother SHOWIF problem (1997)
Re:Merchant and WebCat 3.0 (1998)
WebCatalog for guestbook ? (1997)
TeaRoom Search page (2000)
Problem upgrading from 3.0.8 to 4.0 on MS Windoze 98 / PWS (2000)
Repharesed: Web Site Stats (2002)
From a remote site to a store frame, can it be done? (2000)
security (1997)