这是我对彩票分析最早的尝试, 从此开始用程序预测未来的想法就一直挥之不去,当然现在已经不用这么简陋的方法了. 今后有时间贴出用神经网络做的代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
set conn=server.createobject("adodb.connection")
conn.open "DBQ="+server.mappath("cpdata.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)}"
set rs=server.createobject("adodb.recordset")
sql="select top 51 * from cqcp205 order by cp_qs desc"
rs.open sql,conn,1,1
dim cpdata(51,10)
function checkjo(f)
if f mod 2 <> 0 then
checkjo=1
else
checkjo=0
end if
end function
function jo(a,b,c,d,e)
jo=checkjo(a)+checkjo(b)+checkjo(c)+checkjo(d)+checkjo(e)
end function
function liansu(a,b,c,d,e)
dim shu
shu=1
if a+1=b then
shu=shu+1
end if
if b+1=c then
shu=shu+1
end if
if c+1=d then
shu=shu+1
end if
if d+1=e then
shu=shu+1
end if
liansu=shu
end function
for i= 1 to 51
'----------------------------对数据进行第一步的处理--------------------------------------------
cpjj=rs("cp_zj1")*rs("cp_zj1money")+rs("cp_zj2")*rs("cp_zj2money")+rs("cp_zj3")*rs("cp_zj3money")
cpand=rs("cp_number1")+rs("cp_number2")+rs("cp_number3")+rs("cp_number4")+rs("cp_number5")
cpdata(i,1)=rs("cp_qs")
cpdata(i,2)=rs("cp_number1")
cpdata(i,3)=rs("cp_number2")
cpdata(i,4)=rs("cp_number3")
cpdata(i,5)=rs("cp_number4")
cpdata(i,6)=rs("cp_number5")
cpdata(i,7)=cpjj
cpdata(i,8)=cpand
cpdata(i,9)=jo(rs("cp_number1"),rs("cp_number2"),rs("cp_number3"),rs("cp_number4"),rs("cp_number5"))
cpdata(i,10)=liansu(rs("cp_number1"),rs("cp_number2"),rs("cp_number3"),rs("cp_number4"),rs("cp_number5"))
rs.movenext
next
function show(a)
for i= 51 to 1 step -1
response.write ""&cpdata(i,a)&" "
next
end function
function color(a,j)
color=false
for xiang=2 to 6
if a=cpdata(j,xiang) then
color=true
end if
next
end function
function showcolor(a)
k=0
lianma1=0
lianma2=0
for j=51 to 1 step -1
if color(a,j)=true then
response.write ""&a&" "
if j>1 then
if color(a,j)=color(a,j-1) then
lianma1=lianma1+1
end if
end if
k=k+1
else
response.write ""&a&" "
end if
if j>1 then
if color(a,j)<>color(a,j-1) then
lianma2=lianma2+1
end if
end if
next
response.write "出现率"&k/50*100&"% "
response.write "连码率"&lianma1/50*100&"% "
response.write "变化可能性"&lianma2/50*100&"% "
end function
%>
20选5
期数 | <% show(1) %>重庆风采 20选5统计程序 |
程式设计: 石卓林 |
发行日期: 2004/7/18 |
<%=i%> | <% showcolor(i) %>|||
总奖金 | <% show(7) function showj(a) cpmoneyand=0 pingjun=0 bianhua=0 for showj7=51 to 1 step -1 cpmoneyand=cpmoneyand+cpdata(showj7,a) if showj7>1 then bianhua=bianhua+abs(cpdata(showj7,a)-cpdata(showj7-1,a)) end if next response.write "总和值"&cpmoneyand&" | " response.write "平均值"&cpmoneyand/50&" | " response.write "变化率"&int(bianhua/cpmoneyand*100)&"% | " end function showj(7) %>
---|---|---|---|
和值 | <% show(8) show9(8) %>|||
奇数 | <% show(9) function show9(a) k=0 lianma1=0 lianma2=0 k1=0 for i= 51 to 1 step -1 k=k+cpdata(i,a) if i>1 then k1=k1+abs(cpdata(i,a)-cpdata(i-1,a)) if cpdata(i,a)=cpdata(i-1,a) then lianma1=lianma1+1 else lianma2=lianma2+1 end if end if next response.write "平均值"&k/50&"变化率"&int(k1/k*100)&"% | " response.write "连码率"&lianma1/50*100&"% | " response.write "变化可能性"&lianma2/50*100&"% | " end function show9(9) %>
连数 | <% show(10) show9(10) rs.close conn.close set rs=nothing set conn=nothing '版权所有 石卓林 %>
Leave a Reply