nonebot-plugin-mahjong-utils


Namenonebot-plugin-mahjong-utils JSON
Version 0.4.5 PyPI version JSON
download
home_pagehttps://github.com/ssttkkl/nonebot-plugin-mahjong-utils
Summary
upload_time2023-12-05 04:45:16
maintainer
docs_urlNone
authorssttkkl
requires_python>=3.9,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            nonebot-plugin-mahjong-utils
========

## 功能

### 手牌分析

- 输入手牌代码,根据输入手牌输出向听数(未摸牌状态)、牌理(已摸牌、未和牌状态)、副露分析(未摸牌状态+他家打出的牌)或和牌分析(已摸牌、已和牌状态)。

#### 向听数分析(未摸牌状态)

输入的手牌为3k+1张时。

计算向听数与进张。一向听的手牌还会计算好型与愚型进张数。

![shanten_without_got](img/shanten_without_got.png)

#### 牌理(已摸牌状态)

输入的手牌为3k+2张,且未和牌(向听数大于-1)时。

对每种打法(包括打出与暗杠)计算向听数与进张。一向听的手牌还会计算好型与愚型进张数。

![shanten_with_got_1](img/shanten_with_got_1.png)

![shanten_with_got_2](img/shanten_with_got_2.png)

#### 副露分析(未摸牌状态+他家打出的牌)

格式:`手牌代码<上家打出的牌`、`手牌代码^对家打出的牌`或`手牌代码>下家打出的牌`,其中输入的手牌为3k+1张。

~~实际上对家打出和下家打出是一样的(不能吃),这里区分是为了命令的工整性~~

对每种打法(包括吃、碰、大明杠与PASS)计算向听数与进张。一向听的手牌还会计算好型与愚型进张数。

![furo_shanten_1](img/furo_shanten_1.png)

![furo_shanten_2](img/furo_shanten_2.png)

![furo_shanten_3](img/furo_shanten_3.png)

#### 和牌分析

输入的手牌为3k+2张,且已和牌(向听数等于-1)时。

手牌代码的最后一张牌作为所和的牌,手牌代码后可通过空格分割输入副露、自风、场风、dora、额外役。暗杠通过0990m的格式输入。

![hora_1](img/hora_1.png)

### 番符点数查询

- 输入x番y符,输出亲家/子家的自摸/荣和得点

## 配置项

### mahjong_utils_send_image

将结果以图片形式发送(若将此项设置为True,请安装nonebot-plugin-mahjong-utils[htmlrender]以安装必需依赖)

默认值:`False`

## Special Thanks

-  [nonebot/nonebot2](https://github.com/nonebot/nonebot2)
-  [ssttkkl/mahjong-utils](https://github.com/ssttkkl/mahjong-utils) ~~我谢我自己~~

## 在线乞讨

<details><summary>点击请我打两把maimai</summary>

![](https://github.com/ssttkkl/ssttkkl/blob/main/afdian-ssttkkl.jfif)

</details>

## LICENSE

> MIT License
> 
> Copyright (c) 2022 ssttkkl
> 
> Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
> 
> The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
> 
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ssttkkl/nonebot-plugin-mahjong-utils",
    "name": "nonebot-plugin-mahjong-utils",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "ssttkkl",
    "author_email": "huang.wen.long@hotmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8f/87/8e48da29d5623710f8b67eaaf7882762df460cf54608dad3d04270026daf/nonebot_plugin_mahjong_utils-0.4.5.tar.gz",
    "platform": null,
    "description": "nonebot-plugin-mahjong-utils\n========\n\n## \u529f\u80fd\n\n### \u624b\u724c\u5206\u6790\n\n- \u8f93\u5165\u624b\u724c\u4ee3\u7801\uff0c\u6839\u636e\u8f93\u5165\u624b\u724c\u8f93\u51fa\u5411\u542c\u6570\uff08\u672a\u6478\u724c\u72b6\u6001\uff09\u3001\u724c\u7406\uff08\u5df2\u6478\u724c\u3001\u672a\u548c\u724c\u72b6\u6001\uff09\u3001\u526f\u9732\u5206\u6790\uff08\u672a\u6478\u724c\u72b6\u6001+\u4ed6\u5bb6\u6253\u51fa\u7684\u724c\uff09\u6216\u548c\u724c\u5206\u6790\uff08\u5df2\u6478\u724c\u3001\u5df2\u548c\u724c\u72b6\u6001\uff09\u3002\n\n#### \u5411\u542c\u6570\u5206\u6790\uff08\u672a\u6478\u724c\u72b6\u6001\uff09\n\n\u8f93\u5165\u7684\u624b\u724c\u4e3a3k+1\u5f20\u65f6\u3002\n\n\u8ba1\u7b97\u5411\u542c\u6570\u4e0e\u8fdb\u5f20\u3002\u4e00\u5411\u542c\u7684\u624b\u724c\u8fd8\u4f1a\u8ba1\u7b97\u597d\u578b\u4e0e\u611a\u578b\u8fdb\u5f20\u6570\u3002\n\n![shanten_without_got](img/shanten_without_got.png)\n\n#### \u724c\u7406\uff08\u5df2\u6478\u724c\u72b6\u6001\uff09\n\n\u8f93\u5165\u7684\u624b\u724c\u4e3a3k+2\u5f20\uff0c\u4e14\u672a\u548c\u724c\uff08\u5411\u542c\u6570\u5927\u4e8e-1\uff09\u65f6\u3002\n\n\u5bf9\u6bcf\u79cd\u6253\u6cd5\uff08\u5305\u62ec\u6253\u51fa\u4e0e\u6697\u6760\uff09\u8ba1\u7b97\u5411\u542c\u6570\u4e0e\u8fdb\u5f20\u3002\u4e00\u5411\u542c\u7684\u624b\u724c\u8fd8\u4f1a\u8ba1\u7b97\u597d\u578b\u4e0e\u611a\u578b\u8fdb\u5f20\u6570\u3002\n\n![shanten_with_got_1](img/shanten_with_got_1.png)\n\n![shanten_with_got_2](img/shanten_with_got_2.png)\n\n#### \u526f\u9732\u5206\u6790\uff08\u672a\u6478\u724c\u72b6\u6001+\u4ed6\u5bb6\u6253\u51fa\u7684\u724c\uff09\n\n\u683c\u5f0f\uff1a`\u624b\u724c\u4ee3\u7801<\u4e0a\u5bb6\u6253\u51fa\u7684\u724c`\u3001`\u624b\u724c\u4ee3\u7801^\u5bf9\u5bb6\u6253\u51fa\u7684\u724c`\u6216`\u624b\u724c\u4ee3\u7801>\u4e0b\u5bb6\u6253\u51fa\u7684\u724c`\uff0c\u5176\u4e2d\u8f93\u5165\u7684\u624b\u724c\u4e3a3k+1\u5f20\u3002\n\n~~\u5b9e\u9645\u4e0a\u5bf9\u5bb6\u6253\u51fa\u548c\u4e0b\u5bb6\u6253\u51fa\u662f\u4e00\u6837\u7684\uff08\u4e0d\u80fd\u5403\uff09\uff0c\u8fd9\u91cc\u533a\u5206\u662f\u4e3a\u4e86\u547d\u4ee4\u7684\u5de5\u6574\u6027~~\n\n\u5bf9\u6bcf\u79cd\u6253\u6cd5\uff08\u5305\u62ec\u5403\u3001\u78b0\u3001\u5927\u660e\u6760\u4e0ePASS\uff09\u8ba1\u7b97\u5411\u542c\u6570\u4e0e\u8fdb\u5f20\u3002\u4e00\u5411\u542c\u7684\u624b\u724c\u8fd8\u4f1a\u8ba1\u7b97\u597d\u578b\u4e0e\u611a\u578b\u8fdb\u5f20\u6570\u3002\n\n![furo_shanten_1](img/furo_shanten_1.png)\n\n![furo_shanten_2](img/furo_shanten_2.png)\n\n![furo_shanten_3](img/furo_shanten_3.png)\n\n#### \u548c\u724c\u5206\u6790\n\n\u8f93\u5165\u7684\u624b\u724c\u4e3a3k+2\u5f20\uff0c\u4e14\u5df2\u548c\u724c\uff08\u5411\u542c\u6570\u7b49\u4e8e-1\uff09\u65f6\u3002\n\n\u624b\u724c\u4ee3\u7801\u7684\u6700\u540e\u4e00\u5f20\u724c\u4f5c\u4e3a\u6240\u548c\u7684\u724c\uff0c\u624b\u724c\u4ee3\u7801\u540e\u53ef\u901a\u8fc7\u7a7a\u683c\u5206\u5272\u8f93\u5165\u526f\u9732\u3001\u81ea\u98ce\u3001\u573a\u98ce\u3001dora\u3001\u989d\u5916\u5f79\u3002\u6697\u6760\u901a\u8fc70990m\u7684\u683c\u5f0f\u8f93\u5165\u3002\n\n![hora_1](img/hora_1.png)\n\n### \u756a\u7b26\u70b9\u6570\u67e5\u8be2\n\n- \u8f93\u5165x\u756ay\u7b26\uff0c\u8f93\u51fa\u4eb2\u5bb6/\u5b50\u5bb6\u7684\u81ea\u6478/\u8363\u548c\u5f97\u70b9\n\n## \u914d\u7f6e\u9879\n\n### mahjong_utils_send_image\n\n\u5c06\u7ed3\u679c\u4ee5\u56fe\u7247\u5f62\u5f0f\u53d1\u9001\uff08\u82e5\u5c06\u6b64\u9879\u8bbe\u7f6e\u4e3aTrue\uff0c\u8bf7\u5b89\u88c5nonebot-plugin-mahjong-utils[htmlrender]\u4ee5\u5b89\u88c5\u5fc5\u9700\u4f9d\u8d56\uff09\n\n\u9ed8\u8ba4\u503c\uff1a`False`\n\n## Special Thanks\n\n-  [nonebot/nonebot2](https://github.com/nonebot/nonebot2)\n-  [ssttkkl/mahjong-utils](https://github.com/ssttkkl/mahjong-utils) ~~\u6211\u8c22\u6211\u81ea\u5df1~~\n\n## \u5728\u7ebf\u4e5e\u8ba8\n\n<details><summary>\u70b9\u51fb\u8bf7\u6211\u6253\u4e24\u628amaimai</summary>\n\n![](https://github.com/ssttkkl/ssttkkl/blob/main/afdian-ssttkkl.jfif)\n\n</details>\n\n## LICENSE\n\n> MIT License\n> \n> Copyright (c) 2022 ssttkkl\n> \n> Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n> \n> The above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n> \n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "0.4.5",
    "project_urls": {
        "Homepage": "https://github.com/ssttkkl/nonebot-plugin-mahjong-utils",
        "Repository": "https://github.com/ssttkkl/nonebot-plugin-mahjong-utils"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7bc66c41799a03045d5fa1ec85027dd19916b02685d283fa91860aefa80259d1",
                "md5": "aebdd875310660b386157a066c44622b",
                "sha256": "e8f7eb3a2ddc93dd8e92aef4c260cc1817b60c5989c396aaf677b479e8a1b66c"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_mahjong_utils-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aebdd875310660b386157a066c44622b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 443754,
            "upload_time": "2023-12-05T04:45:12",
            "upload_time_iso_8601": "2023-12-05T04:45:12.500654Z",
            "url": "https://files.pythonhosted.org/packages/7b/c6/6c41799a03045d5fa1ec85027dd19916b02685d283fa91860aefa80259d1/nonebot_plugin_mahjong_utils-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f878e48da29d5623710f8b67eaaf7882762df460cf54608dad3d04270026daf",
                "md5": "072abe8874850b6ae255c5790c17266d",
                "sha256": "906e742b7b56bf6449f4b63ab9daa2d68842be186994daa73b72ea7254404da2"
            },
            "downloads": -1,
            "filename": "nonebot_plugin_mahjong_utils-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "072abe8874850b6ae255c5790c17266d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 427020,
            "upload_time": "2023-12-05T04:45:16",
            "upload_time_iso_8601": "2023-12-05T04:45:16.724072Z",
            "url": "https://files.pythonhosted.org/packages/8f/87/8e48da29d5623710f8b67eaaf7882762df460cf54608dad3d04270026daf/nonebot_plugin_mahjong_utils-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-05 04:45:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ssttkkl",
    "github_project": "nonebot-plugin-mahjong-utils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nonebot-plugin-mahjong-utils"
}
        
Elapsed time: 0.16670s