asp的随机数问题
<%
function GetRnd(min,max)
Randomize
GetRnd=Int((max - min + 1) * Rnd + min)
end function
dim i,tj,max,bj,sj,zf
bj=-1
max=0
tj=0
for i = 0 to 99999
if tj>3 then
if GetRnd(0,9)>4 then
zf=bj
else
zf=GetRnd(0,1)
end if
else
zf=GetRnd(0,1)
end if
response.write "<br />" & zf
response.write "------"
if bj=-1 then
bj=zf
else
if bj=zf then
tj=tj+1
else
if tj>max then max=tj
bj=zf
tj=0
end if
end if
for j=0 to tj
response.write tj &"-"
next
next
response.write "<br /><br />" & max
%>
加Randomize 循环内总是循环重复.
不加.整页怎么刷新换浏览器都是一样的......
asp搞个随机数就不可能吗