From 5763774e891ab1d53239a71ce339124f5ab46e9e Mon Sep 17 00:00:00 2001 From: roger Date: Fri, 7 Apr 2023 09:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BA=A2=E7=90=83=E7=9A=84?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=92=8C=E5=8F=98=E9=87=8F=E5=90=8D=EF=BC=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E7=9B=B8=E5=AF=B9=E6=9B=B4=E6=B8=85=E6=99=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- red_forecast.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/red_forecast.py b/red_forecast.py index 2477899..46ebeb2 100644 --- a/red_forecast.py +++ b/red_forecast.py @@ -98,15 +98,19 @@ def get_red_forecast(_all_data, _red_data_dict, _red_data, range_num=1): else: _red_forecast_dict[_r] = _sum _red_forecast_dict = dict_rate(dict_sort(_red_forecast_dict, 'val', True)) + n = 1 for k, v in _red_forecast_dict.items(): + if n == 12 or n == 23: + print('-' * 10) print(f"{k}-{v}") + n += 1 _red_forecast_list = [] for _red, __ in _red_forecast_dict.items(): _red_forecast_list.append(_red) - print('高概率红球推荐:') - print(', '.join(sorted(_red_forecast_list[0:6]))) + # print('高概率红球推荐:') + # print(', '.join(sorted(_red_forecast_list[0:6]))) # 产生随机数 red_index_list = get_random_index() @@ -154,16 +158,16 @@ def update_red_forecast_db(): def get_random_index(): # 产生随机数 - random_small, random_middle, random_big = -1, -1, -1 - while random_small < 0 or random_middle < 0 or random_big < 0: - random_small = random.randint(0, 2) - random_big = random.randint(1, 6 - random_small) - random_middle = 6 - random_small - random_big - # print(random_small, random_middle, random_big) - small_red_index_list = [n[0] - 1 for n in new_num(11, random_small)[0:random_small]] + random_high, random_middle, random_low = -1, -1, -1 + while random_high < 0 or random_middle < 0 or random_low < 0: + random_high = random.randint(0, 2) + random_low = random.randint(1, 6 - random_high) + random_middle = 6 - random_high - random_low + print('分布区间(高概率区,中概率区,低概率区):', random_high, random_middle, random_low) + high_red_index_list = [n[0] - 1 for n in new_num(11, random_high)[0:random_high]] middle_red_index_list = [n[0] - 1 + 10 for n in new_num(11, random_middle)[0:random_middle]] - big_red_index_list = [n[0] - 1 + 20 for n in new_num(11, random_big)[0:random_big]] - red_index_list = sorted(small_red_index_list + middle_red_index_list + big_red_index_list) + low_red_index_list = [n[0] - 1 + 20 for n in new_num(11, random_low)[0:random_low]] + red_index_list = sorted(high_red_index_list + middle_red_index_list + low_red_index_list) # print(red_index_list) return red_index_list @@ -172,3 +176,4 @@ if __name__ == "__main__": # 实现获取含有这个数的下一期或几期中数字的概率 # 实现获取含有所以数据的总出现概率 update_red_forecast_db() + # print(get_random_index())