{"id":97119,"date":"2022-02-17T14:55:21","date_gmt":"2022-02-17T06:55:21","guid":{"rendered":"http:\/\/www.zhushiyao.com\/?p=97119"},"modified":"2022-02-18T08:31:52","modified_gmt":"2022-02-18T00:31:52","slug":"d106dfe70a","status":"publish","type":"post","link":"http:\/\/www.zhushiyao.com\/?p=97119","title":{"rendered":"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<p style=\"text-align: left; line-height: normal;\"><span style=\"font-size: 12px; color: #888888;\">\u6765\u6e90\uff1azhuanlan.zhihu.com\/p\/35755039<br \/>\n<\/span><\/p>\n<p style=\"text-align: left; line-height: normal;\"><span style=\"font-size: 12px; color: #888888;\">\u4f5c\u8005\uff1aArtrix<\/span><\/p>\n<p style=\"line-height: normal; margin-bottom: 5px;\"><span style=\"font-size: 12px; color: #888888;\">\u9879\u76ee\uff1agithub.com\/ArtrixTech\/BoomMine<\/span><\/p>\n<hr style=\"border-style: solid; border-width: 1px 0 0; border-color: rgba(0,0,0,0.1); -webkit-transform-origin: 0 0; -webkit-transform: scale(1, 0.5); transform-origin: 0 0; transform: scale(1, 0.5);\" \/>\n<section style=\"margin-top: 15px;\"><span style=\"font-size: 15px; background-color: #ffffff; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px;\">\u7528 Python+O<\/span><span style=\"font-size: 15px; background-color: #ffffff; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px;\">penCV \u5b9e\u73b0\u4e86\u81ea\u52a8\u626b\u96f7<\/span><\/section>\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center; margin-top: 25px;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"outline: 0px; box-sizing: border-box !important; width: 526px !important; visibility: visible !important; height: auto !important;\" title=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/02\/2-1645080921.gif\" alt=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" \/><\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center;\"><span style=\"text-align: justify; outline: 0px; font-size: 14px;\">\u4e2d\u7ea7 &#8211; 0.74\u79d2 3BV\/S=60.81<\/span><\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u76f8\u4fe1\u8bb8\u591a\u4eba\u5f88\u65e9\u5c31\u77e5\u9053\u6709\u626b\u96f7\u8fd9\u4e48\u4e00\u6b3e\u7ecf\u5178\u7684\u6e38\uff08\u663e\u5361\u6d4b\u8bd5\uff09\u620f\uff08\u8f6f\u4ef6\uff09\uff0c\u66f4\u662f\u6709\u4e0d\u5c11\u4eba\u66fe\u542c\u8bf4\u8fc7\u4e2d\u56fd\u96f7\u5723\uff0c\u4e5f\u662f\u4e2d\u56fd\u626b\u96f7\u7b2c\u4e00\u3001\u4e16\u754c\u7efc\u5408\u6392\u540d\u7b2c\u4e8c\u7684\u90ed\u851a\u5609\u7684\u9876\u9876\u5927\u540d\u3002\u626b\u96f7\u4f5c\u4e3a\u4e00\u6b3e\u5728Windows9x\u65f6\u4ee3\u5c31\u5df2\u7ecf\u8bde\u751f\u7684\u7ecf\u5178\u6e38\u620f\uff0c\u4ece\u8fc7\u53bb\u5230\u73b0\u5728\u4f9d\u7136\u90fd\u6709\u7740\u5b83\u72ec\u7279\u7684\u9b45\u529b\uff1a\u5feb\u8282\u594f\u9ad8\u7cbe\u51c6\u7684\u9f20\u6807\u64cd\u4f5c\u8981\u6c42\u3001\u5feb\u901f\u7684\u53cd\u5e94\u80fd\u529b\u3001\u5237\u65b0\u7eaa\u5f55\u7684\u5feb\u611f\uff0c\u8fd9\u4e9b\u90fd\u662f\u626b\u96f7\u7ed9\u96f7\u53cb\u4eec\u5e26\u6765\u7684\u3001\u53ea\u5c5e\u4e8e\u626b\u96f7\u7684\u72ec\u4e00\u65e0\u4e8c\u7684\u5174\u594b\u70b9\u3002<\/span><\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">\u258d<strong style=\"outline: 0px;\">0x00 \u51c6\u5907<\/strong><\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u51c6\u5907\u52a8\u624b\u5236\u4f5c\u4e00\u5957\u626b\u96f7\u81ea\u52a8\u5316\u8f6f\u4ef6\u4e4b\u524d\uff0c\u4f60\u9700\u8981\u51c6\u5907\u5982\u4e0b\u4e00\u4e9b\u5de5\u5177\/\u8f6f\u4ef6\/\u73af\u5883<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">&#8211; \u5f00\u53d1\u73af\u5883<\/span><\/p>\n<ol class=\"list-paddingleft-2\" style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">Python3 \u73af\u5883 &#8211; \u63a8\u83503.6\u6216\u8005\u4ee5\u4e0a\u00a0<strong style=\"outline: 0px;\">[\u66f4\u52a0\u63a8\u8350Anaconda3\uff0c\u4ee5\u4e0b\u5f88\u591a\u4f9d\u8d56\u5e93\u65e0\u9700\u5b89\u88c5]<\/strong><\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">numpy\u4f9d\u8d56\u5e93 [\u5982\u6709Anaconda\u5219\u65e0\u9700\u5b89\u88c5]<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">PIL\u4f9d\u8d56\u5e93 [\u5982\u6709Anaconda\u5219\u65e0\u9700\u5b89\u88c5]<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">opencv-python<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">win32gui\u3001win32api\u4f9d\u8d56\u5e93<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u652f\u6301Python\u7684IDE [\u53ef\u9009\uff0c\u5982\u679c\u4f60\u80fd\u5fcd\u53d7\u7528\u6587\u672c\u7f16\u8f91\u5668\u5199\u7a0b\u5e8f\u4e5f\u53ef\u4ee5]<\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">&#8211; \u626b\u96f7\u8f6f\u4ef6<\/span><\/p>\n<section style=\"margin-top: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7; margin-bottom: 5px;\"><span style=\"outline: 0px; font-size: 15px;\"><strong style=\"outline: 0px;\">\u00b7 Minesweeper Arbiter\uff08\u5fc5\u987b\u4f7f\u7528MS-Arbiter\u6765\u8fdb\u884c\u626b\u96f7\uff01\uff09<\/strong><\/span><\/section>\n<section style=\"margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7; margin-top: 5px;\"><span style=\"outline: 0px; font-size: 15px;\">http:\/\/saolei.net\/Download\/Arbiter_0.52.3.zip<\/span><\/section>\n<section style=\"margin-top: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7; margin-bottom: 5px;\"><span style=\"outline: 0px; font-size: 15px;\">\u5f53\u7136\uff0c\u5728\u6b63\u5f0f\u5f00\u59cb\u4e4b\u524d\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u4e86\u89e3\u4e00\u4e0b\u626b\u96f7\u7684\u57fa\u7840\u77e5\u8bc6\u3002\u5982\u679c\u4e0d\u6e05\u695a\u7684\u540c\u5b66\u53ef\u4ee5\u53c2\u8003\u4e2d\u56fd\u6700\u5927\u7684\u626b\u96f7\u8bba\u575bsaolei.net\u4e2d\u7684\u6587\u7ae0\uff1a<\/span><\/section>\n<section style=\"margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7; margin-top: 5px;\"><span style=\"outline: 0px; font-size: 15px;\">http:\/\/saolei.net\/BBS\/Title.asp?Id=177<\/span><\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u597d\u5566\uff0c\u90a3\u4e48\u6211\u4eec\u7684\u51c6\u5907\u5de5\u4f5c\u5df2\u7ecf\u5168\u90e8\u5b8c\u6210\u4e86\uff01\u8ba9\u6211\u4eec\u5f00\u59cb\u5427~<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\">\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">\u258d<strong style=\"outline: 0px;\">0x01 \u5b9e\u73b0\u601d\u8def<\/strong><\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u5728\u53bb\u505a\u4e00\u4ef6\u4e8b\u60c5\u4e4b\u524d\u6700\u91cd\u8981\u7684\u662f\u4ec0\u4e48\uff1f\u662f\u5c06\u8981\u505a\u7684\u8fd9\u4ef6\u4e8b\u60c5\u5728\u5fc3\u4e2d\u642d\u5efa\u4e00\u4e2a\u6b65\u9aa4\u6846\u67b6\u3002\u53ea\u6709\u8fd9\u6837\uff0c\u624d\u80fd\u4fdd\u8bc1\u5728\u53bb\u505a\u8fd9\u4ef6\u4e8b\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5c3d\u53ef\u80fd\u7684\u505a\u5230\u6df1\u601d\u719f\u8651\uff0c\u4f7f\u5f97\u6700\u7ec8\u6709\u4e2a\u597d\u7684\u7ed3\u679c\u3002\u6211\u4eec\u5199\u7a0b\u5e8f\u4e5f\u8981\u5c3d\u53ef\u80fd\u505a\u5230\u5728\u6b63\u5f0f\u5f00\u59cb\u5f00\u53d1\u4e4b\u524d\uff0c\u5728\u5fc3\u4e2d\u6709\u4e2a\u5927\u81f4\u7684\u601d\u8def\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5bf9\u4e8e\u672c\u9879\u76ee\u800c\u8a00\uff0c\u5927\u81f4\u7684\u5f00\u53d1\u8fc7\u7a0b\u662f\u8fd9\u6837\u7684\uff1a<\/span><\/p>\n<ol class=\"list-paddingleft-2\" style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u5b8c\u6210\u7a97\u4f53\u5185\u5bb9\u622a\u53d6\u90e8\u5206<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u5b8c\u6210\u96f7\u5757\u5206\u5272\u90e8\u5206<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u5b8c\u6210\u96f7\u5757\u7c7b\u578b\u8bc6\u522b\u90e8\u5206<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u5b8c\u6210\u626b\u96f7\u7b97\u6cd5<\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u597d\u5566\uff0c\u65e2\u7136\u6211\u4eec\u6709\u4e86\u4e2a\u601d\u8def\uff0c\u90a3\u5c31\u64b8\u8d77\u8896\u5b50\u5927\u529b\u5e72\uff01<\/span><\/p>\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">&#8211; 01 \u7a97\u4f53\u622a\u53d6<\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u5176\u5b9e\u5bf9\u4e8e\u672c\u9879\u76ee\u800c\u8a00\uff0c\u7a97\u4f53\u622a\u53d6\u662f\u4e00\u4e2a\u903b\u8f91\u4e0a\u7b80\u5355\uff0c\u5b9e\u73b0\u8d77\u6765\u5374\u76f8\u5f53\u9ebb\u70e6\u7684\u90e8\u5206\uff0c\u800c\u4e14\u8fd8\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u90e8\u5206\u3002\u6211\u4eec\u901a\u8fc7Spy++\u5f97\u5230\u4e86\u4ee5\u4e0b\u4e24\u70b9\u4fe1\u606f\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">class_name = \"TMain\"<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">title_name = \"Minesweeper Arbiter \"<\/span><\/code><\/pre>\n<\/section>\n<pre style=\"outline: 0px; letter-spacing: 0.544px; background-color: #ffffff;\"><\/pre>\n<ul class=\"list-paddingleft-2\" style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">ms_arbiter.exe\u7684\u4e3b\u7a97\u4f53\u7c7b\u522b\u4e3a&#8221;TMain&#8221;<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">ms_arbiter.exe\u7684\u4e3b\u7a97\u4f53\u540d\u79f0\u4e3a&#8221;Minesweeper Arbiter &#8220;<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u6ce8\u610f\u5230\u4e86\u4e48\uff1f\u4e3b\u7a97\u4f53\u7684\u540d\u79f0\u540e\u9762\u6709\u4e2a\u7a7a\u683c\u3002\u6b63\u662f\u8fd9\u4e2a\u7a7a\u683c\u8ba9\u7b14\u8005\u56f0\u6270\u4e86\u4e00\u4f1a\u513f\uff0c\u53ea\u6709\u52a0\u4e0a\u8fd9\u4e2a\u7a7a\u683c\uff0cwin32gui\u624d\u80fd\u591f\u6b63\u5e38\u7684\u83b7\u53d6\u5230\u7a97\u4f53\u7684\u53e5\u67c4\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u672c\u9879\u76ee\u91c7\u7528\u4e86win32gui\u6765\u83b7\u53d6\u7a97\u4f53\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">hwnd = win32gui.FindWindow(class_name, title_name)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if hwnd:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">left, top, right, bottom = win32gui.GetWindowRect(hwnd)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u901a\u8fc7\u4ee5\u4e0a\u4ee3\u7801\uff0c\u6211\u4eec\u5f97\u5230\u4e86\u7a97\u4f53\u76f8\u5bf9\u4e8e\u6574\u5757\u5c4f\u5e55\u7684\u4f4d\u7f6e\u3002\u4e4b\u540e\u6211\u4eec\u9700\u8981\u901a\u8fc7PIL\u6765\u8fdb\u884c\u626b\u96f7\u754c\u9762\u7684\u68cb\u76d8\u622a\u53d6\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u6211\u4eec\u9700\u8981\u5148\u5bfc\u5165PIL\u5e93<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">from PIL import ImageGrab<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u7136\u540e\u8fdb\u884c\u5177\u4f53\u7684\u64cd\u4f5c\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">left += 15<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">top += 101<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">right -= 15<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">bottom -= 43<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">rect = (left, top, right, bottom)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">img = ImageGrab.grab().crop(rect)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u806a\u660e\u7684\u4f60\u80af\u5b9a\u4e00\u773c\u5c31\u53d1\u73b0\u4e86\u90a3\u4e9b\u5947\u5947\u602a\u602a\u7684Magic Numbers\uff0c\u6ca1\u9519\uff0c\u8fd9\u7684\u786e\u662fMagic Numbers\uff0c\u662f\u6211\u4eec\u901a\u8fc7\u4e00\u70b9\u70b9\u7ec6\u5fae\u8c03\u8282\u5f97\u5230\u7684\u6574\u4e2a\u68cb\u76d8\u76f8\u5bf9\u4e8e\u7a97\u4f53\u7684\u4f4d\u7f6e\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\"><strong style=\"outline: 0px;\">\u6ce8\u610f\uff1a\u8fd9\u4e9b\u6570\u636e\u4ec5\u5728Windows10\u4e0b\u6d4b\u8bd5\u901a\u8fc7\uff0c\u5982\u679c\u5728\u522b\u7684Windows\u7cfb\u7edf\u4e0b\uff0c\u4e0d\u4fdd\u8bc1\u76f8\u5bf9\u4f4d\u7f6e\u7684\u6b63\u786e\u6027\uff0c\u56e0\u4e3a\u8001\u7248\u672c\u7684\u7cfb\u7edf\u53ef\u80fd\u6709\u4e0d\u540c\u5bbd\u5ea6\u7684\u7a97\u4f53\u8fb9\u6846\u3002<\/strong><\/span><\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"outline: 0px; box-sizing: border-box !important; width: 286px !important; visibility: visible !important; height: auto !important;\" title=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/02\/5-1645080921.jpeg\" alt=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" \/><\/p>\n<figure style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><figcaption style=\"outline: 0px; text-align: center;\"><span style=\"outline: 0px; font-size: 15px;\">\u6a59\u8272\u7684\u533a\u57df\u662f\u6211\u4eec\u6240\u9700\u8981\u7684<\/span><\/figcaption><\/figure>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u597d\u5566\uff0c\u68cb\u76d8\u7684\u56fe\u50cf\u6211\u4eec\u6709\u4e86\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u5bf9\u5404\u4e2a\u96f7\u5757\u8fdb\u884c\u56fe\u50cf\u5206\u5272\u4e86~<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\">\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">&#8211; 02 \u96f7\u5757\u5206\u5272<\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center;\"><img decoding=\"async\" style=\"outline: 0px; box-sizing: border-box !important; width: 43px !important; visibility: visible !important; height: auto !important;\" title=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/02\/1-1645080921.jpeg\" alt=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" \/><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5728\u8fdb\u884c\u96f7\u5757\u5206\u5272\u4e4b\u524d\uff0c\u6211\u4eec\u4e8b\u5148\u9700\u8981\u4e86\u89e3\u96f7\u5757\u7684\u5c3a\u5bf8\u4ee5\u53ca\u5b83\u7684\u8fb9\u6846\u5927\u5c0f\u3002\u7ecf\u8fc7\u7b14\u8005\u7684\u6d4b\u91cf\uff0c\u5728ms_arbiter\u4e0b\uff0c\u6bcf\u4e00\u4e2a\u96f7\u5757\u7684\u5c3a\u5bf8\u4e3a16px*16px\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u77e5\u9053\u4e86\u96f7\u5757\u7684\u5c3a\u5bf8\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8fdb\u884c\u6bcf\u4e00\u4e2a\u96f7\u5757\u7684\u88c1\u526a\u4e86\u3002\u9996\u5148\u6211\u4eec\u9700\u8981\u77e5\u9053\u5728\u6a2a\u548c\u7ad6\u4e24\u4e2a\u65b9\u5411\u4e0a\u96f7\u5757\u7684\u6570\u91cf\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">block_width, block_height = 16, 16<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">  blocks_x = int((right - left) \/ block_width)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">  blocks_y = int((bottom - top) \/ block_height)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u4e4b\u540e\uff0c\u6211\u4eec\u5efa\u7acb\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4\u7528\u4e8e\u5b58\u50a8\u6bcf\u4e00\u4e2a\u96f7\u5757\u7684\u56fe\u50cf\uff0c\u5e76\u4e14\u8fdb\u884c\u56fe\u50cf\u5206\u5272\uff0c\u4fdd\u5b58\u5728\u4e4b\u524d\u5efa\u7acb\u7684\u6570\u7ec4\u4e2d\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\"><span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">def<\/span> <span class=\"code-snippet__title\" style=\"outline: 0px; max-width: 1000%;\">crop_block(hole_img, x, y)<\/span>:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\">        x1, y1 = x * block_width, y * block_height<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\">        x2, y2 = x1 + block_width, y1 + block_height<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\"><span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">return<\/span> hole_img.crop((x1, y1, x2, y2))<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\">blocks_img = [[<span class=\"code-snippet__number\" style=\"outline: 0px; max-width: 1000%;\">0<\/span> <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">for<\/span> i <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">in<\/span> range(blocks_y)] <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">for<\/span> i <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">in<\/span> range(blocks_x)]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\"><span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">for<\/span> y <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">in<\/span> range(blocks_y):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\"><span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">for<\/span> x <span class=\"code-snippet__keyword\" style=\"outline: 0px; max-width: 1000%;\">in<\/span> range(blocks_x):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%;\">        blocks_img[x][y] = crop_block(img, x, y)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5c06\u6574\u4e2a\u56fe\u50cf\u83b7\u53d6\u3001\u5206\u5272\u7684\u90e8\u5206\u5c01\u88c5\u6210\u4e00\u4e2a\u5e93\uff0c\u968f\u65f6\u8c03\u7528\u5c31OK\u5566~\u5728\u7b14\u8005\u7684\u5b9e\u73b0\u4e2d\uff0c\u6211\u4eec\u5c06\u8fd9\u4e00\u90e8\u5206\u5c01\u88c5\u6210\u4e86imageProcess.py\uff0c\u5176\u4e2d\u51fd\u6570get_frame()\u7528\u4e8e\u5b8c\u6210\u4e0a\u8ff0\u7684\u56fe\u50cf\u83b7\u53d6\u3001\u5206\u5272\u8fc7\u7a0b\u3002<\/span><\/p>\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">&#8211; 03 \u96f7\u5757\u8bc6\u522b<\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u8fd9\u4e00\u90e8\u5206\u53ef\u80fd\u662f\u6574\u4e2a\u9879\u76ee\u91cc\u9664\u4e86\u626b\u96f7\u7b97\u6cd5\u672c\u8eab\u4e4b\u5916\u6700\u91cd\u8981\u7684\u90e8\u5206\u4e86\u3002\u7b14\u8005\u5728\u8fdb\u884c\u96f7\u5757\u68c0\u6d4b\u7684\u65f6\u5019\u91c7\u7528\u4e86\u6bd4\u8f83\u7b80\u5355\u7684\u7279\u5f81\uff0c\u9ad8\u6548\u5e76\u4e14\u53ef\u4ee5\u6ee1\u8db3\u8981\u6c42\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def analyze_block(self, block, location):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    block = imageProcess.pil_to_cv(block)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    block_color = block[8, 8]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    x, y = location[0], location[1]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    # -1:Not opened<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    # -2:Opened but blank<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    # -3:Un initialized<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    # Opened<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.equal(block_color, self.rgb_to_bgr((192, 192, 192))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if not self.equal(block[8, 1], self.rgb_to_bgr((255, 255, 255))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = -2<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.is_started = True<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">else:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = -1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((0, 0, 255))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((0, 128, 0))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 2<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((255, 0, 0))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 3<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((0, 0, 128))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 4<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((128, 0, 0))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 5<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((0, 128, 128))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 6<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((0, 0, 0))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.equal(block[6, 6], self.rgb_to_bgr((255, 255, 255))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">            # Is mine<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 9<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">        elif self.equal(block[5, 8], self.rgb_to_bgr((255, 0, 0))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">            # Is flag<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">else:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 7<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    elif self.equal(block_color, self.rgb_to_bgr((128, 128, 128))):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = 8<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">else:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_num[x][y] = -3<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.is_mine_form = False<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.blocks_num[x][y] == -3 or not self.blocks_num[x][y] == -1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.is_new_start = False<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u53ef\u4ee5\u770b\u5230\uff0c\u6211\u4eec\u91c7\u7528\u4e86\u8bfb\u53d6\u6bcf\u4e2a\u96f7\u5757\u7684\u4e2d\u5fc3\u70b9\u50cf\u7d20\u7684\u65b9\u5f0f\u6765\u5224\u65ad\u96f7\u5757\u7684\u7c7b\u522b\uff0c\u5e76\u4e14\u9488\u5bf9\u63d2\u65d7\u3001\u672a\u70b9\u5f00\u3001\u5df2\u70b9\u5f00\u4f46\u662f\u7a7a\u767d\u7b49\u60c5\u51b5\u8fdb\u884c\u4e86\u8fdb\u4e00\u6b65\u5224\u65ad\u3002\u5177\u4f53\u8272\u503c\u662f\u7b14\u8005\u76f4\u63a5\u53d6\u8272\u5f97\u5230\u7684\uff0c\u5e76\u4e14\u5c4f\u5e55\u622a\u56fe\u7684\u8272\u5f69\u4e5f\u6ca1\u6709\u7ecf\u8fc7\u538b\u7f29\uff0c\u6240\u4ee5\u901a\u8fc7\u4e2d\u5fc3\u50cf\u7d20\u7ed3\u5408\u5176\u4ed6\u7279\u5f81\u70b9\u6765\u5224\u65ad\u7c7b\u522b\u5df2\u7ecf\u8db3\u591f\u4e86\uff0c\u5e76\u4e14\u505a\u5230\u4e86\u9ad8\u6548\u7387\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5728\u672c\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u5b9e\u73b0\u7684\u65f6\u5019\u91c7\u7528\u4e86\u5982\u4e0b\u6807\u6ce8\u65b9\u5f0f\uff1a<\/span><\/p>\n<ul class=\"list-paddingleft-2\" style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">1-8\uff1a\u8868\u793a\u6570\u5b571\u52308<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">9\uff1a\u8868\u793a\u662f\u5730\u96f7<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">0\uff1a\u8868\u793a\u63d2\u65d7<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">-1\uff1a\u8868\u793a\u672a\u6253\u5f00<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">-2\uff1a\u8868\u793a\u6253\u5f00\u4f46\u662f\u7a7a\u767d<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">-3\uff1a\u8868\u793a\u4e0d\u662f\u626b\u96f7\u6e38\u620f\u4e2d\u7684\u4efb\u4f55\u65b9\u5757\u7c7b\u578b<\/span><\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u901a\u8fc7\u8fd9\u79cd\u7b80\u5355\u5feb\u901f\u53c8\u6709\u6548\u7684\u65b9\u5f0f\uff0c\u6211\u4eec\u6210\u529f\u5b9e\u73b0\u4e86\u9ad8\u6548\u7387\u7684\u56fe\u50cf\u8bc6\u522b\u3002<\/span><\/p>\n<section style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<section style=\"outline: 0px;\">\n<section style=\"outline: 0px;\">\n<section style=\"padding: 5px 30px 5px 5px; outline: 0px; letter-spacing: 0.544px; border-radius: 0px 20px 20px 0px; display: inline-block; background-color: #3d85c6; color: #ffffff;\"><span style=\"outline: 0px; font-size: 16px;\"><strong style=\"outline: 0px;\"><span style=\"outline: 0px; line-height: 24px;\">&#8211; 04 \u626b\u96f7\u7b97\u6cd5\u5b9e\u73b0<\/span><\/strong><\/span><\/section>\n<\/section>\n<\/section>\n<p style=\"outline: 0px;\">\n<\/section>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\"><span style=\"outline: 0px; font-size: 15px;\">\u8fd9\u53ef\u80fd\u662f\u672c\u7bc7\u6587\u7ae0\u6700\u6fc0\u52a8\u4eba\u5fc3\u7684\u90e8\u5206\u4e86\u3002\u5728\u8fd9\u91cc\u6211\u4eec\u9700\u8981\u5148\u8bf4\u660e\u4e00\u4e0b\u5177\u4f53\u7684\u626b\u96f7\u7b97\u6cd5\u601d\u8def\uff1a<\/span><\/p>\n<ol class=\"list-paddingleft-2\" style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff;\">\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u904d\u5386\u6bcf\u4e00\u4e2a\u5df2\u7ecf\u6709\u6570\u5b57\u7684\u96f7\u5757\uff0c\u5224\u65ad\u5728\u5b83\u5468\u56f4\u7684\u4e5d\u5bab\u683c\u5185\u672a\u88ab\u6253\u5f00\u7684\u96f7\u5757\u6570\u91cf\u662f\u5426\u548c\u672c\u8eab\u6570\u5b57\u76f8\u540c\uff0c\u5982\u679c\u76f8\u540c\u5219\u8868\u660e\u5468\u56f4\u4e5d\u5bab\u683c\u5185\u5168\u90e8\u90fd\u662f\u5730\u96f7\uff0c\u8fdb\u884c\u6807\u8bb0\u3002<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u518d\u6b21\u904d\u5386\u6bcf\u4e00\u4e2a\u6709\u6570\u5b57\u7684\u96f7\u5757\uff0c\u53d6\u4e5d\u5bab\u683c\u8303\u56f4\u5185\u6240\u6709\u672a\u88ab\u6253\u5f00\u7684\u96f7\u5757\uff0c\u53bb\u9664\u5df2\u7ecf\u88ab\u4e0a\u4e00\u6b21\u904d\u5386\u6807\u8bb0\u4e3a\u5730\u96f7\u7684\u96f7\u5757\uff0c\u8bb0\u5f55\u5e76\u4e14\u70b9\u5f00\u3002<\/span><\/p>\n<\/li>\n<li style=\"outline: 0px; font-size: 15px;\">\n<p style=\"outline: 0px;\"><span style=\"outline: 0px;\">\u5982\u679c\u4ee5\u4e0a\u65b9\u5f0f\u65e0\u6cd5\u7ee7\u7eed\u8fdb\u884c\uff0c\u90a3\u4e48\u8bf4\u660e\u9047\u5230\u4e86\u6b7b\u5c40\uff0c\u9009\u62e9\u5728\u5f53\u524d\u6240\u6709\u672a\u6253\u5f00\u7684\u96f7\u5757\u4e2d\u968f\u673a\u70b9\u51fb\u3002\uff08\u5f53\u7136\u8fd9\u4e2a\u65b9\u6cd5\u4e0d\u662f\u6700\u4f18\u7684\uff0c\u6709\u66f4\u52a0\u4f18\u79c0\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4f46\u662f\u5b9e\u73b0\u76f8\u5bf9\u9ebb\u70e6\uff09<\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u57fa\u672c\u7684\u626b\u96f7\u6d41\u7a0b\u5c31\u662f\u8fd9\u6837\uff0c\u90a3\u4e48\u8ba9\u6211\u4eec\u6765\u4eb2\u624b\u5b9e\u73b0\u5b83\u5427~<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u9996\u5148\u6211\u4eec\u9700\u8981\u4e00\u4e2a\u80fd\u591f\u627e\u51fa\u4e00\u4e2a\u96f7\u5757\u7684\u4e5d\u5bab\u683c\u8303\u56f4\u7684\u6240\u6709\u65b9\u5757\u4f4d\u7f6e\u7684\u65b9\u6cd5\u3002\u56e0\u4e3a\u626b\u96f7\u6e38\u620f\u7684\u7279\u6b8a\u6027\uff0c\u5728\u68cb\u76d8\u7684\u56db\u8fb9\u662f\u6ca1\u6709\u4e5d\u5bab\u683c\u7684\u8fb9\u7f18\u90e8\u5206\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u7b5b\u9009\u6765\u6392\u9664\u6389\u53ef\u80fd\u8d85\u8fc7\u8fb9\u754c\u7684\u8bbf\u95ee\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def generate_kernel(k, k_width, k_height, block_location):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">     ls = []<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">     loc_x, loc_y = block_location[0], block_location[1]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for now_y in range(k_height):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for now_x in range(k_width):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if k[now_y][now_x]:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">                 rel_x, rel_y = now_x - 1, now_y - 1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">                 ls.append((loc_y + rel_y, loc_x + rel_x))<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">return ls<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"> kernel_width, kernel_height = 3, 3<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Kernel mode:[Row][Col]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"> kernel = [[1, 1, 1], [1, 1, 1], [1, 1, 1]]<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Left border<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if x == 0:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for i in range(kernel_height):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         kernel[i][0] = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Right border<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if x == self.blocks_x - 1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for i in range(kernel_height):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         kernel[i][kernel_width - 1] = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Top border<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if y == 0:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for i in range(kernel_width):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         kernel[0][i] = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Bottom border<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if y == self.blocks_y - 1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for i in range(kernel_width):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         kernel[kernel_height - 1][i] = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Generate the search map<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"> to_visit = generate_kernel(kernel, kernel_width, kernel_height, location)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u6211\u4eec\u5728\u8fd9\u4e00\u90e8\u5206\u901a\u8fc7\u68c0\u6d4b\u5f53\u524d\u96f7\u5757\u662f\u5426\u5728\u68cb\u76d8\u7684\u5404\u4e2a\u8fb9\u7f18\u6765\u8fdb\u884c\u6838\u7684\u5220\u9664\uff08\u5728\u6838\u4e2d\uff0c1\u4e3a\u4fdd\u7559\uff0c0\u4e3a\u820d\u5f03\uff09\uff0c\u4e4b\u540e\u901a\u8fc7generate_kernel\u51fd\u6570\u6765\u8fdb\u884c\u6700\u7ec8\u5750\u6807\u7684\u751f\u6210\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def count_unopen_blocks(blocks):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    count = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for single_block in blocks:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.blocks_num[single_block[1]][single_block[0]] == -1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">            count += 1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">return count<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def mark_as_mine(blocks):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for single_block in blocks:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.blocks_num[single_block[1]][single_block[0]] == -1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.blocks_is_mine[single_block[1]][single_block[0]] = 1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">unopen_blocks = count_unopen_blocks(to_visit)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if unopen_blocks == self.blocks_num[x][y]:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">     mark_as_mine(to_visit)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5728\u5b8c\u6210\u6838\u7684\u751f\u6210\u4e4b\u540e\uff0c\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u9700\u8981\u53bb\u68c0\u6d4b\u7684\u96f7\u5757\u201c\u5730\u5740\u7c3f\u201d\uff1ato_visit\u3002\u4e4b\u540e\uff0c\u6211\u4eec\u901a\u8fc7count_unopen_blocks\u51fd\u6570\u6765\u7edf\u8ba1\u5468\u56f4\u4e5d\u5bab\u683c\u8303\u56f4\u7684\u672a\u6253\u5f00\u6570\u91cf\uff0c\u5e76\u4e14\u548c\u5f53\u524d\u96f7\u5757\u7684\u6570\u5b57\u8fdb\u884c\u6bd4\u5bf9\uff0c\u5982\u679c\u76f8\u7b49\u5219\u5c06\u6240\u6709\u4e5d\u5bab\u683c\u5185\u96f7\u5757\u901a\u8fc7mark_as_mine\u51fd\u6570\u6765\u6807\u6ce8\u4e3a\u5730\u96f7\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def mark_to_click_block(blocks):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for single_block in blocks:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Not Mine<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if not self.blocks_is_mine[single_block[1]][single_block[0]] == 1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Click-able<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.blocks_num[single_block[1]][single_block[0]] == -1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Source Syntax: [y][x] - Converted<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if not (single_block[1], single_block[0]) in self.next_steps:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.next_steps.append((single_block[1], single_block[0]))<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">def count_mines(blocks):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    count = 0<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for single_block in blocks:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.blocks_is_mine[single_block[1]][single_block[0]] == 1:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">            count += 1<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">return count<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">mines_count = count_mines(to_visit)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if mines_count == block:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">    mark_to_click_block(to_visit)<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u626b\u96f7\u6d41\u7a0b\u4e2d\u7684\u7b2c\u4e8c\u6b65\u6211\u4eec\u4e5f\u91c7\u7528\u4e86\u548c\u7b2c\u4e00\u6b65\u76f8\u8fd1\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u3002\u5148\u7528\u548c\u7b2c\u4e00\u6b65\u5b8c\u5168\u4e00\u6837\u7684\u65b9\u6cd5\u6765\u751f\u6210\u9700\u8981\u8bbf\u95ee\u7684\u96f7\u5757\u7684\u6838\uff0c\u4e4b\u540e\u751f\u6210\u5177\u4f53\u7684\u96f7\u5757\u4f4d\u7f6e\uff0c\u901a\u8fc7count_mines\u51fd\u6570\u6765\u83b7\u53d6\u4e5d\u5bab\u683c\u8303\u56f4\u5185\u6240\u6709\u96f7\u5757\u7684\u6570\u91cf\uff0c\u5e76\u4e14\u5224\u65ad\u5f53\u524d\u4e5d\u5bab\u683c\u5185\u6240\u6709\u96f7\u5757\u662f\u5426\u5df2\u7ecf\u88ab\u68c0\u6d4b\u51fa\u6765\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5982\u679c\u662f\uff0c\u5219\u901a\u8fc7mark_to_click_block\u51fd\u6570\u6765\u6392\u9664\u4e5d\u5bab\u683c\u5185\u5df2\u7ecf\u88ab\u6807\u8bb0\u4e3a\u5730\u96f7\u7684\u96f7\u5757\uff0c\u5e76\u4e14\u5c06\u5269\u4f59\u7684\u5b89\u5168\u96f7\u5757\u52a0\u5165next_steps\u6570\u7ec4\u5185\u3002<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\"><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Analyze the number of blocks<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.iterate_blocks_image(BoomMine.analyze_block)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Mark all mines<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.iterate_blocks_number(BoomMine.detect_mine)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\"># Calculate where to click<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">self.iterate_blocks_number(BoomMine.detect_to_click_block)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\">\n<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">if self.is_in_form(mouseOperation.get_mouse_point()):<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">for to_click in self.next_steps:<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         on_screen_location = self.rel_loc_to_real(to_click)<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         mouseOperation.mouse_move(on_screen_location[0], on_screen_location[1])<\/span><\/code><code style=\"white-space: pre-wrap; outline: 0px; max-width: 1000%; text-align: left; display: flex; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;\"><span class=\"code-snippet_outer\" style=\"outline: 0px; max-width: 1000%; font-size: 15px;\">         mouseOperation.mouse_click()<\/span><\/code><\/pre>\n<\/section>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u5728\u6700\u7ec8\u7684\u5b9e\u73b0\u5185\uff0c\u7b14\u8005\u5c06\u51e0\u4e2a\u8fc7\u7a0b\u90fd\u5c01\u88c5\u6210\u4e3a\u4e86\u51fd\u6570\uff0c\u5e76\u4e14\u53ef\u4ee5\u901a\u8fc7iterate_blocks_number\u65b9\u6cd5\u6765\u5bf9\u6240\u6709\u96f7\u5757\u90fd\u4f7f\u7528\u4f20\u5165\u7684\u51fd\u6570\u6765\u8fdb\u884c\u5904\u7406\uff0c\u8fd9\u6709\u70b9\u7c7b\u4f3cPython\u4e2dFilter\u7684\u4f5c\u7528\u3002<\/span><\/p>\n<p style=\"margin-top: 20px; margin-bottom: 20px; outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; font-size: 16px; line-height: 1.7;\"><span style=\"outline: 0px; font-size: 15px;\">\u4e4b\u540e\u7b14\u8005\u505a\u7684\u5de5\u4f5c\u5c31\u662f\u5224\u65ad\u5f53\u524d\u9f20\u6807\u4f4d\u7f6e\u662f\u5426\u5728\u68cb\u76d8\u4e4b\u5185\uff0c\u5982\u679c\u662f\uff0c\u5c31\u4f1a\u81ea\u52a8\u5f00\u59cb\u8bc6\u522b\u5e76\u4e14\u70b9\u51fb\u3002\u5177\u4f53\u7684\u70b9\u51fb\u90e8\u5206\uff0c\u7b14\u8005\u91c7\u7528\u4e86\u4f5c\u8005\u4e3a&#8221;wp&#8221;\u7684\u4e00\u4efd\u4ee3\u7801\uff08\u4ece\u4e92\u8054\u7f51\u641c\u96c6\u800c\u5f97\uff09\uff0c\u91cc\u9762\u5b9e\u73b0\u4e86\u57fa\u4e8ewin32api\u7684\u7a97\u4f53\u6d88\u606f\u53d1\u9001\u5de5\u4f5c\uff0c\u8fdb\u800c\u5b8c\u6210\u4e86\u9f20\u6807\u79fb\u52a8\u548c\u70b9\u51fb\u7684\u64cd\u4f5c\u3002\u5177\u4f53\u5b9e\u73b0\u5c01\u88c5\u5728mouseOperation.py\u4e2d\uff0c\u6709\u5174\u8da3\u53ef\u4ee5\u5728\u6587\u672b\u7684Github Repo\u4e2d\u67e5\u770b\u3002<\/span><\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"outline: 0px; box-sizing: border-box !important; width: 417px !important; visibility: visible !important; height: auto !important;\" title=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/02\/2-1645080921.jpeg\" alt=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" \/><\/p>\n<p style=\"outline: 0px; font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; background-color: #ffffff; text-align: center;\"><span style=\"font-size: 14px;\">\u4f5c\u8005\u7684\u8bb0\u5f55<\/span><\/p>\n<section style=\"margin-bottom: 15px;\"><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; background-color: #ffffff;\">\u8fd9\u4e2a\u6210\u7ee9\uff0c\u8fde\u4e16\u754c\u7b2c\u4e00\u90fd\u5f97\u98a4\u6296\u5462\uff01<\/span><\/section>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img js_insertlocalimg\" title=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" src=\"http:\/\/www.zhushiyao.com\/wp-content\/uploads\/2022\/02\/9-1645080921.gif\" alt=\"\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"font-family: -apple-system, 'system-ui', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', sans-serif; font-size: 14.4px; text-align: center; background-color: #ffffff;\">\u8fd9\u5f20\u5f55\u50cf\u6700\u540e\u7684\u70b9\u51fb\u90e8\u5206\u9047\u5230\u4e86\u6b7b\u5c40\uff0c\u6700\u7ec8\u662f\u901a\u8fc7\u968f\u673a\u5b8c\u6210\u7684<\/span><\/p>\n<p style=\"margin-top: 15px;\"><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; background-color: #ffffff;\">\u7b14\u8005\u8fd8\u5b9e\u73b0\u4e86\u5728\u65b0\u5f00\u5c40\u7684\u65f6\u5019\u968f\u673a\u70b9\u51fb\u6765\u5f00\u51fa\u5c40\u9762\u7684\u529f\u80fd\uff0c\u4e0d\u8fc7\u7531\u4e8e\u6bd4\u8f83\u7b80\u5355\uff0c\u6240\u4ee5\u8be6\u7ec6\u89e3\u6790\u5c31\u4e0d\u5728\u8fd9\u91cc\u8d34\u51fa\u5566~<\/span><\/p>\n<p style=\"margin-top: 15px;\"><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; background-color: #ffffff;\">\u6ce8\u660e\u4e00\u4e0b\uff1a\u5982\u679c\u5728\u5b9e\u9a8c\u7684\u65f6\u5019\u53d1\u73b0\u4f1a\u6709\u96f7\u5757\u70b8\u6389\u7684\u60c5\u51b5\uff0c\u4e0d\u8981\u62c5\u5fc3\uff0c\u8fd9\u662f\u56e0\u4e3a\u5f53\u524d\u5df2\u7ecf\u9047\u5230\u4e86\u6b7b\u5c40\uff0c\u6ca1\u6cd5\u901a\u8fc7\u672c\u9879\u76ee\u7684\u7b97\u6cd5\u6765\u8fdb\u884c\u76f4\u63a5\u7684\u63a8\u65ad\u4e86\uff0c\u8fd9\u4e2a\u65f6\u5019\u7a0b\u5e8f\u4f1a\u968f\u673a\u8fdb\u884c\u70b9\u51fb\uff0c\u6709\u4e00\u5b9a\u51e0\u7387\u70b8\u88c2\u54e6\uff01<\/span><\/p>\n<p style=\"margin-top: 15px;\"><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; background-color: #ffffff;\">\u9879\u76ee\u5b8c\u6574\u4ee3\u7801\/GitHub\u5730\u5740\uff1a<\/span><\/p>\n<p style=\"margin-top: 15px;\"><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; font-size: 15px; letter-spacing: 0.544px; background-color: #ffffff;\">https:\/\/github.com\/ArtrixTech\/BoomMine<\/span><\/p>\n<section><\/section>\n<section><\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6765\u6e90\uff1azhuanlan.zhihu.com\/p\/35755039 \u4f5c\u8005\uff1aArtrix \u9879\u76ee\uff1agithub.co &hellip; <a href=\"http:\/\/www.zhushiyao.com\/?p=97119\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u7528Python\u5b9e\u73b0\u81ea\u52a8\u626b\u96f7\uff0c\u6311\u6218\u4e16\u754c\u7eaa\u5f55\uff01\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":97120,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/97119"}],"collection":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97119"}],"version-history":[{"count":3,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/97119\/revisions"}],"predecessor-version":[{"id":97130,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/posts\/97119\/revisions\/97130"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=\/wp\/v2\/media\/97120"}],"wp:attachment":[{"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97119"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zhushiyao.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}