28,409
社区成员




<%
if request("mode")="" then
A1=20
A2=20
A3=8
else
A1=cint(request("T1")) : if A1=0 then A1=20
A2=cint(request("T2")) : if A2=0 then A2=20
A3=cint(request("T3")) : if A3=0 then A3=8
if 48-(A1+A2+A3) <0 then
A2=A3+(48-(A1+A2+A3))
end if
end if
dim arr(48),a,b,c
a=A1
b=A2
c=A3
for i1=0 to a+b+c-1
if i1<=a-1 then
arr(i1) ="庄"
elseif i1>a-1 and i1<=a+b-1 then
arr(i1)="闲"
else
arr(i1)="和"
end if
next
str=join(arr)
str=replace(str," ","")
arr_Rnd=GetRnd(1,(a+b+c)) '产生指定个数不重复的48个数
'显示
for i=0 to ubound(arr_rnd) ' a+b+c -1
ARR(i)=Mid(str,arr_rnd(i),1)
response.Write i+1 &"=" &ARR(i) & "|"
next
'分组显示:分组“闲”与“和”及“庄”与“和”在一行显示
response.Write("<hr color=red>分组显示:分组“闲”与“和”及“庄”与“和”在一行显示<br>")
for i=0 to a+b+c-1
if arr(i)="和" or arr(i)="庄" then
response.Write(i+1 &">"& arr(i) )
else
response.Write("<br>"&i+1 &">"& arr(i) )
end if
next
'打乱48(不重的48RND),返回数组
'Rem no copy Number
Function GetRnd(lowerNum,upperNum)
Dim unit,RndNum,Fun_X
unit = upperNum - lowerNum
Redim MyArray(unit)
For Fun_I=0 To unit
myArray(Fun_I)= lowerNum + Fun_I
Next
For Fun_I=0 To round(unit)
RndNum = getRndNumber(Fun_I,unit)
Fun_X = myArray(RndNum)
myArray(RndNum)=myArray(Fun_I)
myArray(Fun_I)=Fun_X
Next
GetRnd = myArray
End Function
function getRndNumber(lowerbound,upperbound)
Randomize
getRndNumber=Int((upperbound-lowerbound+1)*Rnd+lowerbound)
end function
%>
<%
if request("mode")="" then
A1=20
A2=20
A3=8
else
A1=cint(request("T1")) : if A1=0 then A1=20
A2=cint(request("T2")) : if A2=0 then A2=20
A3=cint(request("T3")) : if A3=0 then A3=8
if 48-(A1+A2+A3) <0 then
A2=A3+(48-(A1+A2+A3))
end if
end if
dim arr(48),a,b,c
a=A1
b=A2
c=A3
for i1=0 to a+b+c-1
if i1<=a-1 then
arr(i1) ="庄"
elseif i1>a-1 and i1<=a+b-1 then
arr(i1)="闲"
else
arr(i1)="和"
end if
next
str=join(arr)
str=replace(str," ","")
arr_Rnd=GetRnd(1,(a+b+c)) '产生指定个数不重复的48个数
'显示
for i=0 to ubound(arr_rnd) ' a+b+c -1
ARR(i)=Mid(str,arr_rnd(i),1)
response.Write i+1 &"=" &ARR(i) & "|"
next
'分组显示:分组“闲”与“和”及“庄”与“和”在一行显示
response.Write("<hr color=red>分组显示:分组“闲”与“和”及“庄”与“和”在一行显示<br>")
for i=0 to a+b+c-1
if i=0 then
ff="0"
end if
if arr(i)="和" then
f0 = i+1&"=<font color=red>"&arr(i)&"</font>"
response.Write f0
elseif arr(i)="庄" then
if ff="2" then
f1 = "<br>"&i+1&"="&arr(i)
else
f1 = i+1&"="&arr(i)
end if
response.Write f1
ff = "1"
elseif arr(i)="闲" then
if ff="1" then
f2 = "<br>"&i+1&"="&arr(i)
else
f2 = i+1&"="&arr(i)
end if
response.Write f2
response.Write f2
ff = "2"
end if
next
'打乱48(不重的48RND),返回数组
'Rem no copy Number
Function GetRnd(lowerNum,upperNum)
Dim unit,RndNum,Fun_X
unit = upperNum - lowerNum
Redim MyArray(unit)
For Fun_I=0 To unit
myArray(Fun_I)= lowerNum + Fun_I
Next
For Fun_I=0 To round(unit)
RndNum = getRndNumber(Fun_I,unit)
Fun_X = myArray(RndNum)
myArray(RndNum)=myArray(Fun_I)
myArray(Fun_I)=Fun_X
Next
GetRnd = myArray
End Function
function getRndNumber(lowerbound,upperbound)
Randomize
getRndNumber=Int((upperbound-lowerbound+1)*Rnd+lowerbound)
end function
%>
<%arr=array(1,2,3,3,2,1,1,2,1,1)
j=0
for i=0 to ubound(arr)
if i=0 then'i=0时说明是第一个参数,直接输出,不做任何判断
response.Write(arr(i))
else'否则执行下面的判断语句
if arr(i)=1 then '当前数组值如果等于1则执行下面判断和输出语句
if arr(i-1)<>2 then'如果当前数组值的前一个不等于2则不需要换行,否则换行
response.Write(","&arr(i) )
else
response.Write("<br>"&arr(i))
end if
elseif arr(i)=2 then'当前数组值如果等于2则执行下面判断和输出语句
if arr(i-1)<>1 then'如果当前数组值的前一个不等于1则不需要换行,否则换行
response.Write(","&arr(i) )
else
response.Write("<br>"&arr(i))
end if
elseif arr(i)=3 then'当前数值等于3时,不需要换行,直接输出
response.Write(","&arr(i))
end if
end if
next
%>
<%arr=array(1,2,3,3,2,1,1,2,1,1)
j=0
for i=0 to ubound(arr)
if i=0 then'i=0时说明是第一个参数,直接输出,不做任何判断
response.Write(arr(i)&"," )
else'否则执行下面的判断语句
if arr(i)=1 then '当前数组值如果等于1则执行下面判断和输出语句
if arr(i-1)<>2 then'如果当前数组值的前一个不等于2则不需要换行,否则换行
response.Write(arr(i)&"," )
else
response.Write("<br>"&arr(i)&"," )
end if
elseif arr(i)=2 then'当前数组值如果等于2则执行下面判断和输出语句
if arr(i-1)<>1 then'如果当前数组值的前一个不等于1则不需要换行,否则换行
response.Write(arr(i)&"," )
else
response.Write("<br>"&arr(i)&"," )
end if
elseif arr(i)=3 then'当前数值等于3时,不需要换行,直接输出
response.Write(arr(i)&"," )
end if
end if
next
%>