{ "info": { "author": "aohajin", "author_email": "maohaijian@xiimoon.com", "bugtrack_url": null, "classifiers": [], "description": "Copyright (c) 2018 Mao, Haijian\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n\r\nDescription: # \u6597\u5730\u4e3b\u660e\u724c\u6b8b\u5c40\u89e3\u7b54\u5de5\u5177\r\n [![PyPI Version](https://img.shields.io/badge/PyPI-0.1.5-orange.svg)](https://pypi.org/project/doudizhu-resolver/)\r\n \r\n \u57fa\u4e8eLarry He\u5148\u751f\u63d0\u4f9b\u7684[\u6597\u5730\u4e3b\u5f15\u64ce](https://github.com/onestraw/doudizhu)\u7684\u4e00\u4e2a\u73a9\u5177\u6b8b\u5c40\u89e3\u7b54\u5de5\u5177\r\n \r\n \u5199\u8fd9\u4e2a\u7684\u539f\u56e0\u7eaf\u7cb9\u662f\u5728\u864e\u6251\u770b\u4e86\u4e2a\u5e16\u5b50\u7136\u540e\u89c9\u5f97\u6709\u8da3\r\n \r\n \u6ca1\u600e\u4e48\u4f18\u5316\uff0c\u6027\u80fd\u6bd4\u8f83\u5dee\r\n \r\n ## \u9996\u5148\u662f\u4e00\u4e9b\u5171\u8bc6\r\n - [\u7b56\u6885\u6d1b\u5b9a\u7406](https://en.wikipedia.org/wiki/Zermelo%27s_theorem_(game_theory)) \u4e8c\u4eba\u7684\u6709\u9650\u6e38\u620f\u4e2d\uff0c\u5982\u679c\u53cc\u65b9\u7686\u62e5\u6709\u5b8c\u5168\u7684\u8d44\u8baf\uff0c\u5e76\u4e14\u8fd0\u6c14\u56e0\u7d20\u5e76\u4e0d\u7275\u6d89\u5728\u6e38\u620f\u4e2d\uff0c\u90a3\u5148\u884c\u6216\u540e\u884c\u8005\u5f53\u4e00\u5fc5\u6709\u4e00\u65b9\u6709\u5fc5\u80dc/\u5fc5\u4e0d\u8d25\u7684\u7b56\u7565\u3002\r\n - \u6597\u5730\u4e3b\u6ca1\u6709\u548c\u5c40\uff0c\u6b8b\u5c40\u53ea\u8003\u8651\u53cc\u4eba\u535a\u5f08\uff0c\u660e\u724c\u662f\u5b8c\u5168\u8d44\u8baf\uff0c\u5e76\u4e14\u4e0d\u5b58\u5728\u8fd0\u6c14\u3002\u56e0\u6b64\u4efb\u4f55\u6b8b\u5c40\u5148\u624b\u65b9\u8981\u4e48\u5fc5\u80dc\uff0c\u8981\u4e48\u5fc5\u8d25\u3002\r\n \r\n ## \u672c\u5de5\u5177\u80fd\u5e72\u561b\r\n \u63d0\u4f9b\u4e86\u4e24\u4e2a\u529f\u80fd\u51fd\u6570\u548c\u4e00\u4e2a\u8f85\u52a9\u51fd\u6570\r\n - is_winable : \u7ed9\u51fa\u5148\u540e\u624b\u65b9\u7684\u624b\u724c\uff0c\u5224\u65ad\u80dc\u8d1f\uff0cTrue\u8868\u793a\u5148\u624b\u5fc5\u80dc\uff0c\u5426\u5219\u5148\u624b\u5fc5\u8d25\r\n - find_strategy : \u7ed9\u51fa\u5148\u540e\u624b\u65b9\u7684\u624b\u724c\uff0c\u4ee5\u53ca\u4e0a\u4e00\u8f6e\u7684\u51fa\u724c\uff08\u53ef\u9009\uff09\uff0c\u6253\u5370\u5148\u624b\u65b9\u5fc5\u80dc\u7684\u53ef\u80fd\u51fa\u724c\u65b9\u5f0f\uff0c\u5982\u679c\u6ca1\u6709\u5219\u6253\u5370\u4f60\u5df2\u7ecf\u8f93\u4e86\r\n - clear_cache : \u6e05\u7f13\u5b58\uff0c\u56e0\u4e3a\u6548\u7387\u95ee\u9898\u8ba1\u7b97\u4f1a\u7f13\u5b58\u6240\u6709\u7684\u4e2d\u95f4\u7ed3\u679c\uff0c\u8fd9\u4e2a\u4f1a\u6e05\u7406\u4e00\u4e0b\u867d\u7136\u5e76\u6ca1\u6709\u4ec0\u4e48\u5375\u7528\r\n \r\n ## \u6251\u514b\u7684\u8868\u793a\r\n ### 15\u79cd\u70b9\u6570\r\n \r\n '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A', '2', 'BJ', 'CJ'\r\n \r\n - BJ: Black Joker \u5c0f\u738b/\u82b1/\u9b3c\r\n - CJ: Colored Joker \u5927\u738b/\u82b1/\u9b3c\r\n \r\n ### 4\u79cd\u82b1\u8272\r\n \r\n 's': spades \u9ed1\u6843 \u2660\r\n 'h': hearts \u7ea2\u5fc3 \u2764\r\n 'd': diamonds \u65b9\u5757 \u2666\r\n 'c': clubs \u6885\u82b1 \u2663\r\n \r\n ### \u724c\u8868\u5b57\u7b26\u4e32\r\n \r\n '2c': \u5355\u5f20[ 2 \u2663 ]\r\n '2h-2s-2d-2c-BJ-CJ': \u56db\u4e2a2\u5e26\u4e24\u738b[ 2 \u2764 ] , [ 2 \u2660 ] , [ 2 \u2666 ] , [ 2 \u2663 ] , [ BJ ] , [ CJ ]\r\n '3c-4d-5h-6s-7s-8h-9h': \u987a\u5b50[ 3 \u2663 ] , [ 4 \u2666 ] , [ 5 \u2764 ] , [ 6 \u2660 ] , [ 7 \u2660 ] , [ 8 \u2764 ] , [ 9 \u2764 ]\r\n \r\n ## Quickstart\r\n ### Installing\r\n \r\n `pip install doudizhu_resolver`\r\n \r\n ### \u864e\u6251\u4e0a\u7ed9\u7684\u7ecf\u5178\u5bf9\u5c40demo\r\n - \u5148\u624b\u65b9\u624b\u724c'2h-Qd-Qh-10d-10h-7d-7h-5d-5h-3h'\r\n - \u540e\u624b\u65b9\u624b\u724c'As-Ac-9c'\r\n - \u9996\u5148\u521d\u59cb\u5316+\u770b\u4e2a\u7ed3\u679c\r\n ```python\r\n >>> import doudizhu_resolver\r\n >>> doudizhu_resolver.find_strategy('2h-Qd-Qh-10d-10h-7d-7h-5d-5h-3h','As-Ac-9c')\r\n you have already lost.\r\n ```\r\n - \u7ed3\u679c\u662f\u5148\u624b\u65b9\u5fc5\u8d25\u5c40\r\n - \u90a3\u4e48\u6709\u4eba\u4e0d\u670d\u4e86\uff0c\u6211\u4eec\u5148\u624b\u8ddf\u7a0b\u5e8f\u5bf9\u5c40\u8bd5\u8bd5\r\n - \u9996\u5148\u51fa3h\uff0c\u770b\u7a0b\u5e8f\u600e\u4e48\u5e94\u5bf9\r\n ```\r\n >>> doudizhu_resolver.find_strategy('As-Ac-9c','2h-Qd-Qh-10d-10h-7d-7h-5d-5h','3h')\r\n all winable strategies:\r\n pass\r\n ```\r\n - \u7a0b\u5e8f\u8bf4pass\uff0c\u90a3\u4e48\u6211\u4eec\u518d\u51fa5h\r\n ```\r\n >>> doudizhu_resolver.find_strategy('As-Ac-9c','2h-Qd-Qh-10d-10h-7d-7h-5d','5h')\r\n all winable strategies:\r\n [ 9 \u2663 ]\r\n ```\r\n - \u7a0b\u5e8f\u51fa9c\uff0c\u6211\u4eec\u63a5\u7740\u51fa10h\r\n ```\r\n >>> doudizhu_resolver.find_strategy('As-Ac','2h-Qd-Qh-10d-7d-7h-5d','10h')\r\n all winable strategies:\r\n [ A \u2660 ]\r\n ```\r\n - \u7a0b\u5e8f\u51faAc\uff0c\u6211\u4eec2\uff01\r\n ```\r\n >>> doudizhu_resolver.find_strategy('As','Qd-Qh-10d-7d-7h-5d','2h')\r\n all winable strategies:\r\n pass\r\n ```\r\n - \u7a0b\u5e8f\u53ea\u80fdpass\uff0c\u7136\u540e\u724c\u5c40\u5df2\u7ecf\u975e\u5e38\u6e05\u695a\u4e86\uff0c\u7a0b\u5e8f\u53ea\u6709\u4e00\u5f20A\uff0c\u6211\u4eec\u624b\u4e0a\u4e24\u5f20\u5355\u724c\uff0c\u5df2\u7ecf\u662f\u5fc5\u8d25\u7684\u5c40\u4e86\uff0c\u5c31\u4e0d\u7528\u518d\u5f80\u4e0b\u8dd1\u4e86\r\n ### \u6d4b\u8bd5\u4e00\u4e9b\u5176\u4ed6\u7684case\r\n ```\r\n >>> doudizhu_resolver.find_strategy('Qd-Qh-10d-10h', '3s')\r\n all winable strategies:\r\n [ 10 \u2764 ]\r\n [ Q \u2764 ]\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n >>> doudizhu_resolver.find_strategy('Qd-Qh-10d-10h', 'As-3s')\r\n all winable strategies:\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n >>> doudizhu_resolver.find_strategy('2h-Qd-Qh-10d-10h', 'As-3s')\r\n all winable strategies:\r\n [ 10 \u2764 ]\r\n [ Q \u2764 ]\r\n [ 2 \u2764 ]\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n >>> doudizhu_resolver.find_strategy('2h-Qd-Qh-10d-10h-3h', 'As-3s')\r\n all winable strategies:\r\n [ 3 \u2764 ]\r\n [ 10 \u2764 ]\r\n [ Q \u2764 ]\r\n [ 2 \u2764 ]\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n >>> doudizhu_resolver.find_strategy('2h-Qd-Qh-10d-10h-7d-7h-5d-5h-3h', 'As-3s')\r\n all winable strategies:\r\n [ 3 \u2764 ]\r\n [ 5 \u2764 ]\r\n [ 7 \u2764 ]\r\n [ 10 \u2764 ]\r\n [ Q \u2764 ]\r\n [ 2 \u2764 ]\r\n [ 5 \u2764 ], [ 5 \u2666 ]\r\n [ 7 \u2764 ], [ 7 \u2666 ]\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n >>> doudizhu_resolver.find_strategy('2h-Qd-Qh-10d-10h-7d-7h-5d-5h-3h', 'As-9s')\r\n all winable strategies:\r\n [ 3 \u2764 ]\r\n [ 10 \u2764 ]\r\n [ Q \u2764 ]\r\n [ 2 \u2764 ]\r\n [ 5 \u2764 ], [ 5 \u2666 ]\r\n [ 7 \u2764 ], [ 7 \u2666 ]\r\n [ 10 \u2666 ], [ 10 \u2764 ]\r\n [ Q \u2666 ], [ Q \u2764 ]\r\n ```\r\n \r\nPlatform: UNKNOWN\r\nClassifier: Intended Audience :: Developers\r\nClassifier: License :: OSI Approved :: MIT License\r\nClassifier: Operating System :: MacOS :: MacOS X\r\nClassifier: Operating System :: Microsoft :: Windows\r\nClassifier: Operating System :: POSIX\r\nClassifier: Programming Language :: Python :: 3\r\nClassifier: Topic :: Software Development :: Libraries :: Python Modules\r\nClassifier: Programming Language :: Python :: Implementation :: PyPy\r\nClassifier: Programming Language :: Python :: Implementation :: CPython\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aohajin/doudizhu_resolver", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "doudizhu-resolver", "package_url": "https://pypi.org/project/doudizhu-resolver/", "platform": "", "project_url": "https://pypi.org/project/doudizhu-resolver/", "project_urls": { "Homepage": "https://github.com/aohajin/doudizhu_resolver" }, "release_url": "https://pypi.org/project/doudizhu-resolver/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "doudizhu puzzle resolver", "version": "0.1.2" }, "last_serial": 4867590, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "3aa9ecf39b0bd71e494f8f93fcc1749e", "sha256": "b8adec5117b3aa8aad3b72bee947e7ac9223cc73909c78b5724f1e3d9b4e3956" }, "downloads": -1, "filename": "doudizhu_resolver-0.1.2.tar.gz", "has_sig": true, "md5_digest": "3aa9ecf39b0bd71e494f8f93fcc1749e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15161, "upload_time": "2019-02-26T01:12:36", "url": "https://files.pythonhosted.org/packages/08/6e/b65c4cef05dab66524d46172495a40d507501404d672ef3c592fba517c79/doudizhu_resolver-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3aa9ecf39b0bd71e494f8f93fcc1749e", "sha256": "b8adec5117b3aa8aad3b72bee947e7ac9223cc73909c78b5724f1e3d9b4e3956" }, "downloads": -1, "filename": "doudizhu_resolver-0.1.2.tar.gz", "has_sig": true, "md5_digest": "3aa9ecf39b0bd71e494f8f93fcc1749e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15161, "upload_time": "2019-02-26T01:12:36", "url": "https://files.pythonhosted.org/packages/08/6e/b65c4cef05dab66524d46172495a40d507501404d672ef3c592fba517c79/doudizhu_resolver-0.1.2.tar.gz" } ] }