Thread: Choose random
View Single Post
05-25-2006, 09:49 PM
#5
.Nick is offline .Nick
.Nick's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 1,159
iTrader: 3 / 100%
 

.Nick is on a distinguished road

  Old

PHP Code:

$cnt 
count($games);

while(
$l <= 3// note the 3 here
{
    
$random rand(0$cnt);
    if (
$games[$random] != $adcode) {
        
$games[$random] = $adcode;
        
$l++;
    }

Why is that an infinite loop?