def formulakillcolor(s): # 波色公式 # 72 # return Common.get(s[2], 'j') + \ # Common.get(s[3], 't') + \ # Common.get(s[4], 'j') + \ # Common.get(s[5], 't') + \ # Common.get(s[6], 't') + 1 # 153 # 76.97 # 6j 4o 1o 6h 6o 4o 2h 3h 6h 2h 3j 4hj 5t 5j 2t 1t 3t 3t # 79.61 # 0t 0h 1j 1h 1t 2o 1h 1t 3t 3t 2h 2j # 80.26 # 0h 0o 0t 1j 1t 1o 0t 0t 0j 0j 0o offset: 3 # 80.92 # 1j 4h 1j 3h 3j 4j 6j 4j 4o 3t 6t 5t 2t 6h 0h 3h 4t 3j 2j 2t 3o 4t 5o 0o 3j 1h 1o 6j 6j 1o 6h 3o 6t 5t 1j 5h 4o 4h 1o 2j 2t 0t 3j 1t 1h 2o 6j 4j 0j 4t 4j 3j 3o 2j 1t 6o 1h 1t 4j 2j 5j 6o 0o 3o 5t 1t 1t 5o 3o 5j 3h 0t 3o 4h 3o 3t 2t 5t 5j 2h 5t 5h 6t 6h 4t 6t 0t 4t 0t 5h 3o 6h 0h 6h 0h offset: 0 # 83.55 # 2j 2h 1j 0t 1j 1t 1h 2t 2t 0o 0j 0h 0t 2j 0t 0j 2o 1j 0j 1h 2t 2h 2o 2h 2t 2t 2j 2h 2h 0t 1h 2t 0j 2t 2o 2j 0h 1t 1o 2t 2h 0t 1h 2o 0o offset: 0 sorttype: 0 # 82.89 # 3o 3o 2o 0j 2h 0j 0h 1t 1o offset: 12 # 84.87 # 0j 1t 0h 1h 0t 1h 1h 1t 1h 1t 1j 1j 0j 0o 1j 1h 0t 1h 1t 0j offset: 1 # 2700 # 83.67% # 2j 2t 1h 0t 3o 5t 2t 1h 3j 0h 5t 4t 4t 5h 2t 2t 2t 1o 2o 5o 3j 0t 4j 3t 4j 4t 3j 2o 0j 1h 3t 1t 4o 4o 5j 2h 3o 2h 2h 0o offset: 6 sorttype: nosize # 73.68 return Common.get(s[2], 'h') + \ Common.get(s[3], 'j') + \ Common.get(s[4], 'h') + \ Common.get(s[5], 'j') + \ Common.get(s[6], 'j') + 1
def fixed_kill_one_tail(self, jo): """ 执行杀1尾公式 (90.67%) :param jo: :return: """ r = 0 killnexttailSeq = '' for index in range(len(jo)): killnexttail = str(jo[index][1]['six_number']['1']['number'])[1] l = len(jo) - self.outp if index == len(jo) - 1: print("=>预测杀: [" + killnexttail + "]尾") killnexttailSeq = Common.getnumber(killnexttail, 't') print("=>对应号: " + str(killnexttailSeq)) nextIndex = index + 1 if nextIndex >= len(jo): break nexttail = str(jo[nextIndex][1]['unusual_number']['number'])[1] if killnexttail != nexttail: r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killnexttail + "]尾 " + \ "开[" + nexttail + "] " + \ Common.e3p([killnexttail], nexttail)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killnexttailSeq
def formulakillsingleordouble(s): # 单双公式 (错误率太高,正确率太低,pass) # 62 return Common.get(s[1], 't') + \ Common.get(s[2], 't') + \ Common.get(s[3], 'j') + \ Common.get(s[4], 'j') + \ Common.get(s[5], 'j') + 2
def formulakillhead(s): # 杀头公式 (4个头) # 85.33% # return Common.get(s[0], 't') + \ # Common.get(s[1], 't') + \ # Common.get(s[2], 'j') + \ # Common.get(s[3], 'j') + \ # Common.get(s[4], 'j') + 3 # 90.0% return Common.get(s[0], 't') + \ Common.get(s[1], 't') + \ Common.get(s[2], 't') + \ Common.get(s[3], 'j') + \ Common.get(s[4], 'j') + 5
def kill_color_bo_formula(self, jo, sort): """ 杀波色 (75.0%) :param jo: :param sort: :return: """ r = 0 killcolorboseq = [] for index in range(len(jo)): swq = data.number_data sn = self.sortnumber.sort_number(jo[index], sort) killcolorbo = Common.color(fr.funclr(sn)) killcolorboseq = Common.getnumber(killcolorbo, 'c') l = len(jo) - self.outp if index == len(jo) - 1: print("=>预测杀: [" + killcolorbo + "]") print("=>对应号: " + str(killcolorboseq)) nextIndex = index + 1 if nextIndex >= len(jo): break pass nextnumber = jo[nextIndex][1]['unusual_number']['number'] # 下期特码 nextcolor = Common.etoc(jo[nextIndex][1]['unusual_number']['color']) # 特码波色 swq = list(set(swq) - (set(killcolorboseq))) try: if swq.index(int(nextnumber)) >= 0: r = r + 1 except: pass # if killcolorbo != nextcolor: # r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killcolorbo + "] " + \ "开[" + nextcolor + "] " + \ Common.e3p([killcolorbo], nextcolor)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killcolorboseq
def formulakilltail(sn): """ 公式杀尾 :return: """ # { 'pid': 33631, 'exp': {'offset': 4, 'expression': '0h 1t 3t 4h 5a', 'sort': 'nosize'}, 'rat': 92.142 } formula = { "expression": "0h 1t 3t 4h 5a", "offset": 4, "sorttype": "nosize" } killtail = Common.tail( Common.formula_expression_hander( formula['expression'], sortnumber.sort_number(sn, formula['sorttype']), formula['offset'])[0]) return Common.getnumber(str(killtail), 't')
def kill_head_formula(self, jo, sort): """ 执行杀1头公式 (90.0%) :param jo: 年集合 :param sort: 排序方式 默认根据落球顺序进行排序 :return: 返回最新一期杀头数字 """ r = 0 killnextheadseq = [] for index in range(len(jo)): sn = self.sortnumber.sort_number(jo[index], sort) killnexthead = str(Common.headavg(fr.funhed(sn))) l = len(jo) - self.outp if index == len(jo) - 1: print("=>预测杀: [" + killnexthead + "]头") killnextheadseq = Common.getnumber(killnexthead, 'h') print("=>对应号: " + str(killnextheadseq)) nextIndex = index + 1 if nextIndex >= len(jo): break nextnumber = jo[nextIndex][1]['unusual_number']['number'] # 下期特码 nexthead = str(nextnumber).zfill(2)[0] # 下期特码头 if killnexthead != nexthead: r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killnexthead + "]头 " + \ "开[" + nextnumber + "] " + \ Common.e3p([killnexthead], nexthead)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killnextheadseq
def kill_single_or_double(self, jo, sort): """ 杀单双 (62%) :param jo: :param sort: 推荐按照落球顺序 nosize :return: """ r = 0 killsingledoubleseq = [] for index in range(len(jo)): sn = self.sortnumber.sort_number(jo[index], sort) killsingledouble = Common.singleordouble(fr.funeob(sn)) l = len(jo) - self.outp if index == len(jo) - 1: killsingledoubleseq = Common.getnumber(killsingledouble, 's') print("=>预测杀 [" + killsingledouble + "]") print("=>对应号: " + str(killsingledoubleseq)) nextIndex = index + 1 if nextIndex >= len(jo): break nextnumber = jo[nextIndex][1]['unusual_number']['number'] # 下期特码 nextsgledu = Common.nextsingleordouble(nextnumber) if killsingledouble != nextsgledu: r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killsingledouble + "] " + \ "开[" + nextsgledu + "] " + \ Common.e3p([killsingledouble], nextsgledu)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killsingledoubleseq
def fixed_kill_one_zodiac_1(self, jo): """ # 根据指定的序列图杀一肖 :param jo: :return: """ r = 0 killnextzodiacSeq = [] for index in range(len(jo)): # 根据本期特尾获取下期将要杀掉的生肖 killnextzodiac = Common.get_next_kill_zodiac( str(jo[index][1]['unusual_number']['number'])[1]) l = len(jo) - self.outp if index == len(jo) - 1: killnextzodiacSeq = Common.getnumber(killnextzodiac, 'z') print("=>预测杀: [" + killnextzodiac + "]") print("=>对应号: " + str(killnextzodiacSeq)) nextIndex = index + 1 if nextIndex >= len(jo): break # 下期实际生肖 nextzodiac = jo[nextIndex][1]['unusual_number']['zodiac'] if killnextzodiac != nextzodiac: r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killnextzodiac + "] " + \ "开[" + nextzodiac + "] " + \ Common.e3p([killnextzodiac], nextzodiac)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killnextzodiacSeq
def fixed_kill_one_zodiac_2(self, jo): """ 根据指定的第三个生肖杀一肖 (94.67%) :param jo: :return: """ r = 0 killnextzodiacSeq = [] for index in range(len(jo)): killnextzodiac = jo[index][1]['six_number']['3']['zodiac'] l = len(jo) - self.outp if index == len(jo) - 1: print("=>预测杀: [" + killnextzodiac + "]") killnextzodiacSeq = Common.getnumber(killnextzodiac, 'z') print("=>对应号: " + str(killnextzodiacSeq)) nextIndex = index + 1 if nextIndex >= len(jo): break # 下期实际生肖 nextzodiac = jo[nextIndex][1]['unusual_number']['zodiac'] if killnextzodiac != nextzodiac: r = r + 1 if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀[" + killnextzodiac + "] " + \ "开[" + nextzodiac + "] " + \ Common.e3p([killnextzodiac], nextzodiac)) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 2)) + "%") return killnextzodiacSeq
def kill_tail_formula(self, jo): """ 执行杀1尾公式 :param jo: 年集合 :param sort: 排序方式 默认根据落球顺序进行排序 :return: 返回最新一期杀头数字 """ r = 0 killnexttailseq = [] nextIndex = 0 for index in range(len(jo)): killnexttailseq = fr.formulakilltail(jo[index]) l = len(jo) - self.outp if index == len(jo) - 1: print("=>对应号: " + str(killnexttailseq)) nextIndex += 1 if nextIndex >= len(jo): break nextnumber = int(jo[nextIndex][1]['unusual_number']['number']) # 下期特码 try: if list(set(data.number_data) - (set(killnexttailseq))).index(nextnumber) >= 0: r += 1 except: pass if index > l - 2: print(str(index + 2).zfill(3) + "期: " + \ "杀" + str(killnexttailseq) + \ " 开[" + str(nextnumber).zfill(2) + "] " + \ Common.e3p(killnexttailseq, nextnumber)) print('=>总数: ' + str((len(jo) - 1))) print('=>正确数: ' + str(r) + '次') print('=>正确率: ' + str(round((r / (len(jo) - 1)) * 100.0, 3)) + "%") return killnexttailseq
def left_and_right_extend(self, jo, killSeq, leng=3): """ 预测将要开码的数字序列尾数,也不应该在大集合中执行差集操作 :param leng: 延长长度 :return: 没有返回 """ maxright = 0 # 最大正确数 maxerror = 0 # 最大错误数 retlist = [] # 预测数组号码 rightarray = [] # 正确数数组 errorarray = [] # 错误数数组 ratarray = [] # 对错归纳数组 temparray = [] if leng > 4 or leng < 1: raise Exception("长度错误,leng小于5且大于0") for index in range(len(jo)): nextIndex = index + 1 if nextIndex >= len(jo): break number = jo[nextIndex][1]['unusual_number']['number'] cnumber = jo[index][1]['unusual_number']['number'] finalarray = self.__getseqtail(cnumber, leng) retlist = self.__getalltail(finalarray) if killSeq != None: if len(killSeq) > 0: retlist = list(set(retlist) - (set(killSeq))) try: if retlist.index(int(number)) >= 0: self.r = self.r + 1 # 最高正确数组合 maxright = maxright + 1 self.lastsetright = self.lastsetright + 1 self.lastsetrightarray.append(str(index + 2).zfill(3)) if maxright > self.mr: self.mr = maxright pass # 最高正确数组合 # 最高错误数组合 if maxerror > self.me: self.me = maxerror else: maxerror = 0 pass self.lastseterror = 0 self.lastseterrorarray = [] # 最高错误数组合 except: self.e = self.e + 1 # 最高正确数组合 if maxright > self.mr: self.mr = maxright else: maxright = 0 pass self.lastsetright = 0 self.lastsetrightarray = [] # 最高正确数组合 # 最高错误数组合 maxerror = maxerror + 1 self.lastseterror = self.lastseterror + 1 self.lastseterrorarray.append(str(index + 2).zfill(3)) if maxerror > self.me: self.me = maxerror pass # 最高错误数组合 pass temparray.append(Common.e2p(retlist, number)) if index > len(jo) - self.outp - 2: print(str(index + 2).zfill(3) + "期: " + \ "预" + str(finalarray) + "尾 " + \ "[" + str(len(retlist)) + "]个 " + \ "开[" + str(number) + "] " + \ Common.e2p(retlist, number)) pass for index in range(len(temparray)): temp = {} nextIndex = index + 1 if nextIndex >= len(temparray): # 最后一次判断 if temparray[index] == '对': rightarray.append(str(index + 2).zfill(3)) temp["对"] = rightarray self.yearrighterrordrawdataarray.append(len(rightarray)) ratarray.append(temp) else: errorarray.append(str(index + 2).zfill(3)) temp["错"] = errorarray self.yearrighterrordrawdataarray.append(len(errorarray)) ratarray.append(temp) break if temparray[index] == '对': rightarray.append(str(index + 2).zfill(3)) if temparray[nextIndex] == '错': temp["对"] = rightarray ratarray.append(temp) self.yearrighterrordrawdataarray.append(len(rightarray)) rightarray = [] if temparray[index] == '错': errorarray.append(str(index + 2).zfill(3)) if temparray[nextIndex] == '对': temp["错"] = errorarray ratarray.append(temp) self.yearrighterrordrawdataarray.append(len(errorarray)) errorarray = [] # 设置类成员属性值 self.nextnumberlist = retlist self.yearrighterrorrate.append( round((self.r / (len(jo) - 1)) * 100.0, 2)) self.yearrighterrorrate.append(100 - self.yearrighterrorrate[0]) self.totalcost = str(self.cost * len(retlist)) + '元(' + str( self.cost) + '/元)' self.expectedreturn = str((self.rate - len(retlist)) * self.cost) + '元(' + str(round(((self.rate - len(retlist)) * self.cost) / \ (self.cost * len(retlist)), 2)) + '倍)' # 输出相关的所有信息 print('==============左右(&碰撞)预测==============') print('公式总计: ' + str(len(jo)) + '/' + str(len(jo) - 1)) print('公式对错: ' + str(self.r) + '/' + str(self.e) + '/' + str(round((self.r / (len(jo) - 1)) * 100.0, 2)) + "%") print('最高连对: ' + str(self.mr) + '次') print('最新连对: ' + str(self.lastsetright) + '次') print('连对期数: ' + str(self.lastsetrightarray)) print('最高连错: ' + str(self.me) + '次') print('最新连错: ' + str(self.lastseterror) + '次') print('连错期数: ' + str(self.lastseterrorarray)) print('成本总计: ' + self.totalcost) print('预计回报: ' + self.expectedreturn) print('预测号码: ' + str(retlist) + ' 共[' + str(len(retlist)) + ']个')