hit-and-blow
Switch游戏 - 猜颜色 自动解算器。
猜颜色是《世界游戏大全51》中的一款小游戏。本仓库复现了该游戏的玩法,并添加了“自动解算”功能。
Functions
已支持四种模式:
- 游戏模式 (
game.py):复现基本功能,可在命令行体验游戏玩法 - 自动解算 (
auto_play.py):计算答案的可行域,使用寻优策略逐步逼近答案 - 实验模式 (
experiment.py):多次重复自动解算过程,用于统计寻优策略的性能 - 作弊模式 (
hacker.py):和朋友联机时获得指引,快人一步得出答案 ( `д´)
Usage
可通过两种方式运行代码:
1)通过 pypi 下载运行
import switch_hacker
g = switch_hacker.game.Game()
g.main()
2)本地运行:以作弊模式为例
- 在
src目录下新建hack.py文件 - 将以下代码贴入文件中保存
- 在命令行中执行
python hack.py
# hack.py
import switch_hacker
hk = switch_hacker.hacker.Hacker()
hk.main()
Tree
文件结构
├── README.md
├── pyproject.toml
└── src
├── switch_hacker
│ ├── __init__.py
│ ├── base.py: 通用函数集合
│ ├── game.py: 命令行游戏
│ ├── auto_play.py: 自动解算器
│ ├── experiment.py: 实验统计模块
│ ├── hacker.py: 作弊模块
│ └── strategy.py: 寻优策略
└── test
└── example.py: 示例代码
Log
- 命令行游戏
- 自动解算器
- 实验统计模块
- 作弊模块
- 强化学习
Appendix
游戏的命令行实现:
Metadata
Release files for switch-hacker 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| switch_hacker-0.0.1.tar.gz | 261.7 kB | Without provenance | Details for switch_hacker-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| switch_hacker-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for switch_hacker-0.0.1-py3-none-any.whl |
Total release size: 271.6 kB
Release files / switch_hacker-0.0.1.tar.gz
| Download URL | switch_hacker-0.0.1.tar.gz |
|---|---|
| Size | 261.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6d512dd36a6f1a0753fbf53907859525f77702f752e7883d2f6956b8743627a8
|
|
BLAKE2b-256 checksum How to use checksums |
419761d7d8c40bb183d88df35c2484b477dccb2c9544d0b99a3e7390824c090d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / switch_hacker-0.0.1-py3-none-any.whl
| Download URL | switch_hacker-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94176cc1e13cf7392228627e18843ce3ca8f6a371b428fa57cacbbf4578c63dc
|
|
BLAKE2b-256 checksum How to use checksums |
f8e0aef30785b97288b357de12432df8753fc601ed0090ffb12dcfca906babfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for switch-hacker 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.