Re: Random With Odds

From: Date: Tue, 04 Jul 2000 03:03:42 +0000
Subject: Re: Random With Odds
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-4666@lists.php.net to get a copy of this message
In article <004001bfe541$85fdc920$4414fea9@catalano2>, nick4753@nozone.net ("Nick Catalano") wrote: > I am about to create a BIG script that will allow a banner to rotate.. I > want to allow the user to select a weight for each banner.. 1 showing up > 1.5x as much as 2, 2 showing up 1.5x more than 3, 3 showing up 1.5x more > than 4, etc... how would I do that?? is there a way to setup rand to take in > account the odds of picking one number, and is it possible to change those > odds?? Maybe some sort of logarithm of the output of rand(). You really can't mess with the distribution odds of rand itself... -- Richard Lynch | If this was worth $$$ to you, buy a CD US Customer Support Director | from one of the artists listed here: Zend Technologies USA | http://www.L-I-E.com/artists.htm http://www.zend.com | (this has nothing to do with Zend, duh!)

« previous php.general (#4666) next »