请教彩票中的“旋转矩阵”的算法(公式)? Web 开发 / ASP

来源:百度文库 编辑:神马文学网 时间:2024/03/29 02:03:51
‘//俺是这样:(仅取出一段,代码不规范)
dim   arrBB(7)               ‘//临时数组
dim   arrCC(3000,7)     ‘//有效组合--保存结果
strAA="1,2,3,4,5,6,7,8,9,10,11,12"           ‘//   12是变数--存入所选号码
arrAA=split(atrAA,",")
ilow=   LBound(arrAA)
ihigh=   UBound(arrAA)
response.write   "
"&"你选的是:"
for   i=ilow   to   ihigh
response.write   arrAA(i)&"   "
next
response.write   "
"
r1=1
r2=1
for   q1=1   to   ihigh+1
r1=r1*q1
next
for   q1=1   to   ihigh+1-7
r2=r2*q1
next
if   r2=0   then   r2=1
r3=r1/r2/5040
response.write   ihigh+1&"个数字按7个一组共有:   "&r3&"   个组合.
"
j=1
For   i1   =   ilow   To   ihigh-6
For   i2=i1+1   to   ihigh-5
For   i3=i2+1   to   ihigh-4
For   i4=i3+1   to   ihigh-3
For   i5=i4+1   to   ihigh-2
For   i6=i5+1   to   ihigh-1
For   i7=i6+1   to   ihigh
‘//得到数组
arrBB(1)=arrAA(i1)
arrBB(2)=arrAA(i2)
arrBB(3)=arrAA(i3)
arrBB(4)=arrAA(i4)
arrBB(5)=arrAA(i5)
arrBB(6)=arrAA(i6)
arrBB(7)=arrAA(i7)
‘//过滤
iglz=guolv(arrBB,j) ‘//调用缩水
if   iglz=1   then
response.write   j&":   "&arrBB(1)&"   "&arrBB(2)&"   "&arrBB(3)&"   "&arrBB(4)&"   "&arrBB(5)&"   "&arrBB(6)&"   "&arrBB(7)&"
"
‘//存入数组--做旋转缩水用
for   imn=1   to   7
arrCC(j,imn)=arrBB(imn)
next
j=j+1
end   if
next
next
next
next
next
next
next
function   guolv(bb,kj)
‘//旋转过滤--把已有的去掉,中7保X
ibao=5     ‘//保5
gl_tmp=1
IF   kj   >=   2     then
for   nn1=1   to   kj-1     ‘//对有效期比较
isum=0
for   nn2=1   to   7
IF   arrCC(nn1,nn2)-bb(nn2)=0   then   isum=isum+1
Next
IF   isum-ibao>=0   then
gl_tmp=0
guolv   =   gl_tmp
Exit   function
end   if
Next
End   IF
‘//旋转过滤....END............................
guolv   =   gl_tmp
end   function