version 1.2, 2000/10/05 19:24:23
|
version 1.3, 2000/10/11 20:59:43
|
Line 2
|
Line 2
|
# used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run() |
# used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run() |
# |
# |
# |
# |
|
$RANDOMINIT=0; |
|
|
sub hinton { |
sub hinton { |
return 0; |
return 0; |
} |
} |
|
|
sub random { |
sub random { |
my ($start,$end,$step)=@_; |
my ($start,$end,$step)=@_; |
|
if ( ! $RANDOMINIT ) { srand($external::randomseed); $RANDOMINIT=1; } |
my $num=1+int(($end-$start)/$step); |
my $num=1+int(($end-$start)/$step); |
my $result=$start + int(rand() * $num)*$step; |
my $result=$start + int(rand() * $num)*$step; |
return $result; |
return $result; |