一键导入
lottery-prediction
根据往期体彩大乐透数据,预测本期大乐透5注号码
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
根据往期体彩大乐透数据,预测本期大乐透5注号码
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Develop 2D games in Godot including sprites, tilemaps, cameras, lighting, and parallax backgrounds. Use this skill when building 2D platformers, top-down games, implementing tilemap-based levels, 2D camera systems, day/night cycles, or any 2D-specific game feature.
Develop 3D games in Godot including meshes, lighting, cameras, environments, and 3D model importing. Use this skill when building 3D scenes, setting up lighting rigs, configuring cameras, importing glTF/FBX models, implementing 3D character controllers, or working with the 3D rendering pipeline.
Create and manage animations in Godot using AnimationPlayer, AnimationTree, Tween, and AnimatedSprite2D. Use this skill when building character animations, UI transitions, sprite frame animations, tween-based effects, or animation state machines.
Implement audio in Godot including sound effects, music playback, audio buses, and 3D spatial audio. Use this skill when setting up audio players, managing audio buses, creating music systems with crossfade, pooling audio sources, or adding positional audio to 2D/3D scenes.
Export and deploy Godot projects to Windows, Linux, macOS, Android, iOS, and Web platforms. Use this skill when configuring export presets, setting up CI/CD pipelines, preparing release builds, optimizing for target platforms, or distributing games to Steam, itch.io, or mobile stores.
Write, debug, and optimize GDScript code for Godot Engine 4.x. Use this skill when creating scripts, fixing GDScript errors, connecting signals, configuring export variables, setting up node references, or implementing character movement and game logic in GDScript.
| name | lottery-prediction |
| description | 根据往期体彩大乐透数据,预测本期大乐透5注号码 |
lottery-prediction
根据往期体彩大乐透数据,预测本期大乐透5注号码
本技能通过在线获取历史大乐透开奖数据,利用多种算法分析号码出现规律,生成5注预测号码供参考。
本技能按以下步骤依次执行,完整实现从数据获取到预测输出的全流程:
脚本位置: scripts/data_fetcher.py
功能概述: 从体彩官方API获取大乐透历史开奖数据,支持缓存机制和异常处理。
数据源配置:
https://webapi.sporttery.cn/gateway/lottery/getHistoryPageListV1.qrygameNo=85 (大乐透)核心方法:
fetch_history(count) - 获取指定期数的历史数据_generate_mock_data(count) - 生成模拟数据(当API请求失败时)save_to_file(data, filename) - 保存数据到JSON文件load_from_file(filename) - 从JSON文件加载数据异常处理:
数据格式:
{
"period": "2026001",
"date": "2026-01-25",
"front": [1, 8, 15, 22, 29],
"back": [3, 9]
}
脚本位置: scripts/analyzer.py
功能概述: 对历史数据进行多维度分析,生成详细的统计报告。
分析方法:
输出结构:
{
'front': {
'total': {1: 15, 2: 12, ...}, # 各号码出现次数
'frequency': {1: 0.15, 2: 0.12, ...}, # 出现频率
'high_frequency': [(17, 25), (23, 24), ...], # 高频号及次数
'low_frequency': [(35, 5), (1, 6), ...] # 低频号及次数
},
'back': {...} # 后区类似结构
}
输出结构:
{
'front': {
'intervals': {'01-05': [1,2,3,4,5], ...},
'distribution': {'01-05': 45, '06-10': 52, ...}
},
'back': {...}
}
输出结构:
{
'front': {
'avg_odd': 2.5, # 平均奇数个数
'avg_even': 2.5, # 平均偶数个数
'common_patterns': [('3:2', 35), ('2:3', 28), ...] # 常见组合
},
'back': {...}
}
输出结构:
{
'values': [85, 92, 78, ...], # 所有期数的和值
'statistics': {
'min': 55,
'max': 145,
'avg': 98.5,
'median': 97,
'std': 18.3
},
'common_sums': [(95, 8), (97, 7), ...], # 常见和值
'recent_trends': [85, 92, ...], # 最近10期
'recommended_range': [80, 117] # 推荐和值范围
}
输出结构:
{
'front': {
'all_miss': {1: 5, 2: -1, ...}, # -1表示本期已出现
'long_miss': [31, 35, ...], # 长期遗漏的号码
'top_miss': [(35, 28), (31, 25), ...] # 按遗漏次数排序
},
'back': {...}
}
核心方法:
analyze_all() - 执行所有分析算法generate_report() - 生成格式化的分析报告脚本位置: scripts/predictor.py
功能概述: 基于分析结果,使用多种策略生成预测号码。
预测策略:
核心方法:
predict(count) - 生成指定注数的预测validate_prediction(prediction) - 验证预测号码有效性format_prediction(prediction, index) - 格式化单注预测generate_summary(predictions) - 生成预测摘要验证规则:
脚本位置: scripts/lottery_main.py
功能概述: 整合数据获取、分析和预测功能,提供统一的命令行接口。
执行流程:
1. 解析命令行参数
↓
2. 数据获取 (data_fetcher)
- 检查是否使用缓存
- 获取指定期数的历史数据
- 可选保存到缓存
↓
3. 数据分析 (analyzer)
- 执行5种分析算法
- 生成分析结果
↓
4. 预测生成 (predictor)
- 使用多种策略生成预测号码
- 验证预测有效性
↓
5. 输出结果
- 文本格式或JSON格式
- 可选显示详细分析报告
命令行参数:
| 参数 | 说明 | 默认值 |
|---|---|---|
-p, --periods | 分析的期数 | 100 |
-n, --numbers | 生成的预测注数 | 5 |
-f, --format | 输出格式(text/json) | text |
--show-analysis | 显示详细数据分析报告 | False |
--use-cache | 使用缓存的历史数据 | False |
--save-cache | 保存数据到缓存 | False |
--cache-file | 缓存文件路径 | lottery_history.json |
使用示例:
# 基本用法
python scripts/lottery_main.py
# 分析最近150期,生成8注预测
python scripts/lottery_main.py -p 150 -n 8
# 输出JSON格式
python scripts/lottery_main.py -f json
# 使用缓存并显示详细分析
python scripts/lottery_main.py --use-cache --show-analysis
# 保存数据到缓存
python scripts/lottery_main.py --save-cache
输出格式:
文本格式 (默认):
============================================================
【大乐透预测号码】
============================================================
期次:2026001(下一期预测)
分析期数:100 期
推荐5注号码:
第1注:03 09 17 24 31 + 04 08 [均衡策略]
第2注:05 12 19 26 33 + 02 11 [冷热策略]
...
预测依据:
- 高频号前区: [17, 23, 29, 05, 12]
- 高频号后区: [04, 09, 11]
...
注:仅供娱乐参考,理性投注
============================================================
JSON格式:
{
"period": "2026001",
"analysis_periods": 100,
"predictions": [
{"front": ["03", "09", ...], "back": ["04", "08"], "strategy": "均衡策略"},
...
],
"analysis": {...},
"disclaimer": "仅供娱乐参考,理性投注"
}
生成清晰的预测结果,包含:
【大乐透预测号码】
期次:XXXXXXX(最新期次)
推荐5注号码:
第1注:01 08 15 22 29 + 03 09
第2注:05 12 18 25 33 + 04 11
第3注:02 09 16 23 30 + 05 07
第4注:07 14 21 28 35 + 02 08
第5注:04 11 17 24 31 + 06 12
预测依据:
- 高频号:xx, xx, xx
- 低频号:xx, xx, xx
- 奇偶比:xx:xx
- 和值范围:xx-xx
- 遗补号码:xx, xx
注:仅供娱乐参考,理性投注
直接运行主程序使用默认设置:
python scripts/lottery_main.py
使用命令行参数自定义预测:
# 分析最近150期
python scripts/lottery_main.py --periods 150
# 生成8注预测
python scripts/lottery_main.py --numbers 8
# 输出JSON格式
python scripts/lottery_main.py --format json
# 显示详细数据分析报告
python scripts/lottery_main.py --show-analysis
# 使用缓存数据(避免重复下载)
python scripts/lottery_main.py --use-cache
# 保存数据到缓存
python scripts/lottery_main.py --save-cache
# 组合使用多种选项
python scripts/lottery_main.py -p 200 -n 10 -f json --show-analysis --save-cache
# 测试体彩官方API连接性
python scripts/test_sporttery_api.py
# 测试数据获取模块
python scripts/data_fetcher.py
# 测试数据分析模块
python scripts/analyzer.py
# 测试预测生成模块
python scripts/predictor.py
requests - HTTP请求,获取在线数据json - JSON数据处理argparse - 命令行参数解析collections - 高级数据结构(Counter, defaultdict)statistics - 统计计算random - 随机数生成re - 正则表达式解析HTMLpathlib - 路径操作lottery-prediction/
├── SKILL.md # 技能说明文档(本文件)
└── scripts/ # 可执行脚本目录
├── data_fetcher.py # 数据获取模块
├── analyzer.py # 数据分析模块
├── predictor.py # 预测生成模块
├── lottery_main.py # 主程序入口
└── test_sporttery_api.py # 体彩API测试脚本
1. data_fetcher.py - 数据获取模块
LotteryDataFetcher 类:封装所有数据获取逻辑save_to_file() 和 load_from_file()2. analyzer.py - 数据分析模块
LotteryAnalyzer 类:封装所有分析算法generate_report() 生成可读性强的分析报告3. predictor.py - 预测生成模块
LotteryPredictor 类:封装所有预测逻辑validate_prediction() 确保预测号码有效4. lottery_main.py - 主程序
UTF8Stdout 包装器5. test_sporttery_api.py - API测试脚本
┌─────────────────┐
│ 命令行参数 │
└────────┬────────┘
↓
┌─────────────────┐
│ LotteryData │
│ Fetcher │
│ ┌───────────┐ │
│ │体彩官方API│──┼──► 成功
│ ├───────────┤ │
│ │ 模拟数据 │──┼──► 兜底
│ └───────────┘ │
└────────┬────────┘
↓
┌─────────────────┐
│ LotteryAnalyzer │
│ ┌───────────┐ │
│ │频率分析 │ │
│ ├───────────┤ │
│ │区间分析 │ │
│ ├───────────┤ │
│ │奇偶分析 │ │
│ ├───────────┤ │
│ │和值分析 │ │
│ ├───────────┤ │
│ │遗漏分析 │ │
│ └───────────┘ │
└────────┬────────┘
↓
┌─────────────────┐
│ LotteryPredictor│
│ ┌───────────┐ │
│ │均衡策略 │ │
│ ├───────────┤ │
│ │冷热策略 │ │
│ ├───────────┤ │
│ │遗漏策略 │ │
│ ├───────────┤ │
│ │区间策略 │ │
│ ├───────────┤ │
│ │随机策略 │ │
│ └───────────┘ │
└────────┬────────┘
↓
┌─────────────────┐
│ 输出结果 │
│ - 文本格式 │
│ - JSON格式 │
└─────────────────┘
data_fetcher.py:支持多数据源、缓存机制analyzer.py:实现5种分析算法(频率、区间、奇偶比、和值、遗漏)predictor.py:实现5种预测策略(均衡、冷热、遗漏、区间、随机)lottery_main.py:统一命令行接口,支持多种输出格式pip install requests
# 基本预测
python scripts/lottery_main.py
# 详细分析
python scripts/lottery_main.py --show-analysis
# JSON输出
python scripts/lottery_main.py --format json
Q: 为什么显示"使用模拟数据"? A: 当体彩官方API请求失败时,系统会自动使用模拟数据继续运行,确保程序不会中断。
Q: 如何使用缓存?
A: 首次运行时使用 --save-cache 保存数据,后续运行使用 --use-cache 加载缓存数据。
Q: 预测结果是否准确? A: 本预测基于历史数据的统计分析,仅供参考。彩票开奖完全随机,无法预测准确结果。
Q: Windows终端显示乱码怎么办? A: 程序已内置UTF-8输出包装器,应能正常显示中文。如仍有问题,请确保终端编码设置为UTF-8。