This wouldn't really be random.  It would ensure that the same number
doesn't come up two times in a row, but that's not random.

According to m-w.com random (as an adjective, which is how we're using it)
is "being or relating to a set or to an element of a set each of whose
elements has equal probability of occurrence"

The key words here being "equal probability of occurrence".  By putting that
number in a list you make that numbers chance of beign used 0.  Therefore
the next number is no longer random.  

I'm not saying that your solution isn't what this person needs but the
number isn't completely random.  Just like Jim McAtee said you have the
chance of one number coming up ten, a hundred, even a thousand times in a
row.  Is it likely that will happen?  No, but it could.  The smaller the set
of numbers to choose from the more likely that is to happen.  It's the same
as you were taught in school when you learned averages.  Just because you
flip a quarter 100 times doesn't mean you'll get 50 heads and 50 tails.  Try
it.

--K

> -----Original Message-----
> From: Mark Warrick [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 20, 2000 4:14 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CF-Talk] Random Images-Resources for Information?
> 
> 
> Les,
> 
> There's no reason why it would not other than the law of 
> averages itself.  Perhaps the gods don't like all the numbers 
> on your machine.
> 
> Forget about it.  You've got a solution.
> 
> ---mark
> 
> --------------------------------------------------------------
> Mark Warrick
> Phone: (714) 547-5386
> Efax.com Fax: (801) 730-7289
> Personal Email: [EMAIL PROTECTED]
> Personal URL: http://www.warrick.net 
> Business Email: [EMAIL PROTECTED]
> Business URL: http://www.fusioneers.com
> ICQ: 346566
> --------------------------------------------------------------
> 
> 
> > -----Original Message-----
> > From: Les Mizzell [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 20, 2000 2:28 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [CF-Talk] Random Images-Resources for Information?
> > 
> > 
> > Thanks - will try this and see what happens.
> > 
> > What nobody has told me yet though...is WHY *DOESN'T* "<cfparam
> > name="imageswap" default="#randrange(1,7)#">" return 1 
> through 7 randomly?
> > 
> > Les Mizzell
> > ***********
> > Some people say I'm too apathetic.
> > But why should I care?
> > 
> > > -----Original Message-----
> > > From: Mark Warrick [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, September 20, 2000 2:26 AM
> > > To: [EMAIL PROTECTED]
> > > Cc: [EMAIL PROTECTED]
> > > Subject: RE: [CF-Talk] Random Images-Resources for Information?
> > >
> > >
> > > Les,
> > >
> > > Forget what you've heard about randrange not really being random.
> > >  The following piece of code GUARANTEES that the number 
> WILL be random.
> > >
> > >
> > > <!-- begin  -->
> > >
> > > <cfapplication name="randrange" clientmanagement="Yes"
> > > sessionmanagement="Yes" setclientcookies="Yes" 
> clientstorage="Registry">
> > >
> > > <cfparam name="session.randrangelist" default="">
> > >
> > > <cfset newnum = RandRange(1,7)>
> > >
> > > <cfloop condition="session.randrangelist contains newnum">
> > >   <cfset newnum = RandRange(1,7)>
> > > </cfloop>
> > >
> > > <cfset session.randrangelist =
> > > "#ListAppend(session.randrangelist, newnum)#">
> > >
> > > <cfoutput>
> > > List: #session.randrangelist#<br>
> > > Current Random Number: #newnum#
> > > </cfoutput>
> > >
> > > <cfif ListLen(session.randrangelist) gt 6>
> > >   <cfset session.randrangelist = "">
> > > </cfif>
> > > <!-- end  -->
> > >
> > > --------------------------------------------------------------
> > > Mark Warrick
> > > Phone: (714) 547-5386
> > > Efax.com Fax: (801) 730-7289
> > > Personal Email: [EMAIL PROTECTED]
> > > Personal URL: http://www.warrick.net
> > > Business Email: [EMAIL PROTECTED]
> > > Business URL: http://www.fusioneers.com
> > > ICQ: 346566
> > > --------------------------------------------------------------
> > >
> > >
> > > > -----Original Message-----
> > > > From: Les Mizzell [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, September 19, 2000 9:14 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RE: [CF-Talk] Random Images-Resources for Information?
> > > >
> > > >
> > > > Well, in the process of trying to further understand 
> the random image
> > > > question, I've haven't been able to find much 
> information on random
> > > > functions at all.
> > > >
> > > > "Mastering Cold Fusion 4" doesn't even mention it
> > > > "Cold Fusion 4.0" Web Application Construction Kit (Forta) 
> > mentions the
> > > > tags, but doesn't really give any insight into the use
> > > > Nothing on the Allaire site except the product documentation
> > > >
> > > > ....anybody want to point me towards a good source?
> > > > Why isn't "randrange(1,7)" really all that random?
> > > >
> > > > Les Mizzell
> > > > ***********
> > > > Some people say I'm too apathetic.
> > > > But why should I care?
> > > >
> > > > 
> ------------------------------------------------------------------
> > > > ------------
> > > > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> > > > To Unsubscribe visit
> > > > 
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
> > > > _talk or send a message to 
> [EMAIL PROTECTED] with
> > > > 'unsubscribe' in the body.
> > >
> > > ------------------------------------------------------------------
> > > ------------
> > > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> > > To Unsubscribe visit
> > http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/cf_tal
> k or send
> a message to [EMAIL PROTECTED] with 
> 'unsubscribe' in the
> body.
> 
> --------------------------------------------------------------
> ----------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit 
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=list
s/cf_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to