精 彩 论 坛已经更名为百强频道,迁新地址www.bqpd.cn

亲爱的朋友,首先为给您带来的不便深表歉意,现因发展的需要,精彩论坛迁到新的地址http://www.bqpd.cn,还望您一如既往地支持精彩论坛,谢谢
精 彩 论 坛已经更名为百强频道,迁新地址www.bqpd.cn

论坛因发展的需要现已经迁址www.bqpd.cn,等待您的到来。谢谢


    商品名称:跟随分析II

    分享
    avatar
    一品明灯
    Admin

    帖子数 : 292
    积分 : 720
    威望 : 4
    注册日期 : 10-03-02
    年龄 : 8

    普通 商品名称:跟随分析II

    帖子 由 一品明灯 于 2010-03-11, 14:48

    商品名称:跟随分析II
    商品说明:
    对跟随分析的代码稍作修改,可以清晰了解跟随分析的号码中奖走势:



    --------------------------------------------------------------------------------
    以下内容只有回复后才可以浏览


    '==========================================================
    ' 跟 随 分 析 II
    '==========================================================
    CpParam.Add "期数", 30, "1-150"
    CpParam.Add "名次", 6, "1-10"
    Function Main()
    '===============申明或定义变量=============
    CpRowCount = CpData.RowCount '开奖期数
    CpColCount = CpData.ColCount '开奖号码个数
    CpMaxCode = CpData.MaxCode '最大号码
    CpMinCode = CpData.MinCode '最小号码
    CpCodeCount = CpData.CodeCount '号码数量

    Pub_QS = CInt(CpParam.Value("期数"))
    Pub_MC = CInt(CpParam.Value("名次"))
    '=================建表=================
    CpAna.AddField "期号", 8
    CpAna.AddField "开奖号码", CpColCount * 3
    CpAna.AddField "前" & Pub_MC & "列表", 3 * Pub_MC
    CpAna.AddField "中" & Pub_MC & "列表", 3 * Pub_MC
    CpAna.AddField "后" & Pub_MC & "列表", 3 * Pub_MC
    CpAna.AddField "前中个数", 8
    CpAna.AddField "中中个数", 8
    CpAna.AddField "后中个数", 8
    CpAna.AddField "中奖个数", 8
    CpAna.AddField "前中列表", 8
    CpAna.AddField "后中列表", 8
    CpAna.AddField "中中列表", 8
    CpAna.RowCount = CpRowCount - Pub_QS + 1
    CpAna.CreateTable()
    '==============算法主体============================
    ReDim Codes(CpColCount)
    ReDim GenSui(CpCodeCount, 1) '跟随
    Set CpSec = CreateObject("BoaoHbsActive.CpSec")
    For Row = 0 To CpRowCount - Pub_QS
    CpAna.Cell(Row , "期号") = CpData.Seq(Row + Pub_QS )
    CpAna.Cell(Row , "开奖号码") = CpData.CodeStr(Row + Pub_QS )
    PreCodesStr = CpData.CodeStr(Row)
    For i = 0 To CpColCount - 1
    Codes(i) = CpData.Code(Row + Pub_QS - 1, i) '取当期的号码
    Next
    For i = 0 To CpCodeCount - 1
    GenSui(i, 0) = i '初始化
    GenSui(i, 1) = 0
    Next
    For j = 1 To Pub_QS
    CpSec.Clear
    CpSec.Add "PreCodes=" & PreCodesStr
    For i = 0 To CpColCount - 1
    If CpSec.IsMember(0, Codes(i)) Then
    For col = 0 To CpColCount - 1
    index = CpData.Code(Row + j - 1, col) - CpMinCode
    GenSui(index, 1) = GenSui(index, 1) + 1
    Next
    End If
    Next
    PreCodesStr = CpData.CodeStr(Row + j)
    Next
    '选择排序
    For i = 0 To CpCodeCount - 2
    best_value1 = GenSui(i, 1)
    best_value2 = GenSui(i, 0)
    best_j = i
    For j = i + 1 To CpCodeCount - 1
    If GenSui(j, 1) < best_value1 Then
    best_value1 = GenSui(j, 1)
    best_value2 = GenSui(j, 0)
    best_j = j
    End If
    Next
    GenSui(best_j, 1) = GenSui(i, 1)
    GenSui(best_j, 0) = GenSui(i, 0)
    GenSui(i, 1) = best_value1
    GenSui(i, 0) = best_value2
    Next

    QLB = ""
    HLB = ""
    ZLB = ""
    For i = 1 To Pub_MC
    QLB = QLB & " " & GenSui(i - 1, 0) + 1
    HLB = HLB & " " & GenSui(CpCodeCount - i, 0) + 1
    ZLB = ZLB & " " & GenSui((CpCodeCount - Pub_MC) \ 2 + i,0) + 1
    Next
    CpAna.Cell(Row , "前" & Pub_MC & "列表") = QLB
    CpAna.Cell(Row , "中" & Pub_MC & "列表") = ZLB
    CpAna.Cell(Row , "后" & Pub_MC & "列表") = HLB
    QZGS = 0
    HZGS = 0
    ZZGS = 0
    QZLB=""
    HZLB=""
    ZZLB=""
    PreCodesStr = CpData.CodeStr(Row + Pub_QS)
    CpSec.Clear
    CpSec.Add "PreCodes=" & PreCodesStr
    For i = 1 To Pub_MC
    If CpSec.IsMember(0, GenSui(i - 1, 0) + 1) Then
    QZGS = QZGS + 1
    QZLB = QZLB & " " & GenSui(i - 1, 0) + 1
    End If
    If CpSec.IsMember(0, GenSui((CpCodeCount - Pub_MC) \ 2 + i , 0) + 1) Then
    ZZGS = ZZGS + 1
    ZZLB = ZZLB & " " & GenSui((CpCodeCount - Pub_MC) \ 2 + i, 0) + 1
    End If
    If CpSec.IsMember(0, GenSui(CpCodeCount - i, 0) + 1) Then
    HZGS = HZGS + 1
    HZLB = HZLB & " " & GenSui(CpCodeCount - i, 0) + 1
    End If
    Next
    CpAna.Cell(Row , "前中个数") = QZGS
    CpAna.Cell(Row , "后中个数") = HZGS
    CpAna.Cell(Row , "中中个数") = ZZGS
    CpAna.Cell(Row , "中奖个数") = QZGS + HZGS + ZZGS
    CpAna.Cell(Row , "前中列表") = QZLB
    CpAna.Cell(Row , "后中列表") = HZLB
    CpAna.Cell(Row , "中中列表") = ZZLB
    Next
    End Function


    _________________
    一流的条件 精彩的论坛

      目前的日期/时间是2018-04-25, 02:11