pyjzq
这是一个基于命令行的井字棋游戏。
安装
pip install pyjzq
使用方法
在Python代码中使用 你可以在Python代码中导入并使用这个包。以下是一个简单的示例:
from pyjzq import TicTacToe, play, HumanPlayer
def main():
# 创建游戏实例
game = TicTacToe()
# 创建玩家实例
x_player = HumanPlayer('X')
o_player = HumanPlayer('O')
# 开始游戏
play(game, x_player, o_player)
if __name__ == "__main__":
main()
示例输出
以下是运行上述代码时的示例输出:
| 0 | 1 | 2 |
| 3 | 4 | 5 |
| 6 | 7 | 8 |
X makes a move to square 0
| X | | |
| | | |
| | | |
O makes a move to square 1
| X | O | |
| | | |
| | | |
...
X wins!
开发
如果你想要为这个项目做出贡献,你可以按照以下步骤进行开发和测试:
克隆仓库
git clone https://github.com/tianhukj/pyjzq.git
创建虚拟环境并安装依赖
cd pyjzq
python -m venv venv
source venv/bin/activate # Windows 上使用 `venv\Scripts\activate`
pip install -r requirements.txt
运行测试
python main.py
许可证
该项目使用 MIT 许可证
#贡献
欢迎贡献!请阅读 CONTRIBUTING.md 了解详细的贡献流程。
反馈
如果你有任何问题或建议,请通过 Issues 页面反馈。
Metadata
Release files for pyjzq 0.2
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 | |
|---|---|---|---|---|
| pyjzq-0.2.tar.gz | 4.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyjzq-0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.7 kB
Release files / pyjzq-0.2.tar.gz
| Download URL | pyjzq-0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d94fd1b85fd19531888d43a05157c0382278a394ba277798112ab1868cc170f2
|
|
BLAKE2b-256 checksum How to use checksums |
aca53ac78bc22ab255a2a8bdc307683b07c0e3242378bd1dec6a2a1b567861ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Release files / pyjzq-0.2-py3-none-any.whl
| Download URL | pyjzq-0.2-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa408c0b5e48e6a7da78b459a9ed67f3499063d1af9fed89b4fb93faa3228224
|
|
BLAKE2b-256 checksum How to use checksums |
45f1e630581c4ce2d13988c2f44db1b9ad7d03145dc1178e74497be4b797d8c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Security for pyjzq 0.2
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.