重庆风采20选5彩票中奖统计
这是我对彩票分析最早的尝试, 从此开始用程序预测未来的想法就一直挥之不去,当然现在已经不用这么简陋的方法了. 今后有时间贴出用神经网络做的代码
<%@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 "<td align=center bgcolor=#cccccc>"&cpdata(i,a)&"</td>"
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 "<td align=center bgcolor=#FF0000>"&a&"</td>"
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 "<td align=center bgcolor=#aacccc>"&a&"</td>"
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 "<td nowrap align=center bgcolor=#00ccff>出现率"&k/50*100&"%</td>"
response.write "<td nowrap align=center bgcolor=#00ccff>连码率"&lianma1/50*100&"%</td>"
response.write "<td nowrap align=center bgcolor=#00ccff>变化可能性"&lianma2/50*100&"%</td>"
end function
%>
<html>
<head>
<title>20选5</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<table width="0" border="1" cellpadding="0" cellspacing="0">
<tr>
<td align="center">期数</td>
<% show(1) %>
<td align="center" bgcolor=#ccccff>重庆风采<br>20选5统计程序</td>
<td align="center" bgcolor=#ccccff>程式设计:<br>石卓林</td>
<td align="center" bgcolor=#ccccff>发行日期:<br>2004/7/18</td>
</tr>
<%
for i= 1 to 20
%>
<tr>
<td align="center" ><%=i%></td>
<% showcolor(i) %>
</tr>
<% next %>
<tr>
<th align="center" nowrap >总奖金</th>
<%
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 "<td nowrap align=center bgcolor=#00cccc>总和值"&cpmoneyand&"</td>"
response.write "<td nowrap align=center bgcolor=#00cccc>平均值"&cpmoneyand/50&"</td>"
response.write "<td nowrap align=center bgcolor=#00cccc>变化率"&int(bianhua/cpmoneyand*100)&"%</td>"
end function
showj(7)
%>
</tr>
<tr>
<th align="center" nowrap >和值</th>
<% show(8)
show9(8)
%>
</tr>
<tr>
<th align="center" nowrap >奇数</th>
<% 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 "<td nowrap align=center bgcolor=#00cccc>平均值"&k/50&"变化率"&int(k1/k*100)&"%</td>"
response.write "<td nowrap align=center bgcolor=#00cccc>连码率"&lianma1/50*100&"%</td>"
response.write "<td nowrap align=center bgcolor=#00cccc>变化可能性"&lianma2/50*100&"%</td>"
end function
show9(9)
%>
</tr>
<tr>
<th align="center" nowrap>连数</th>
<% show(10)
show9(10)
rs.close
conn.close
set rs=nothing
set conn=nothing
'版权所有 石卓林 %>
</tr>
</table>
</body>
</html>