{"id":1773,"date":"2017-08-14T15:18:26","date_gmt":"2017-08-14T07:18:26","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1773"},"modified":"2017-08-14T15:18:26","modified_gmt":"2017-08-14T07:18:26","slug":"javascript%e5%ae%9e%e7%8e%b0%e4%b8%80%e5%9d%97%e9%bb%91%e7%99%bd%e4%ba%94%e5%ad%90%e6%a3%8b%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1773","title":{"rendered":"JavaScript\u5b9e\u73b0\u4e00\u5757\u9ed1\u767d\u4e94\u5b50\u68cb\u6e38\u620f"},"content":{"rendered":"<p>\n\t<a href=\"https:\/\/baike.baidu.com\/item\/\u4e94\u5b50\u68cb\/130266\" name=\"\u4e94\u5b50\u68cb\" target=\"_blank\" title=\"\u4e94\u5b50\u68cb\">\u4e94\u5b50\u68cb<\/a>\u5927\u5bb6\u90fd\u4e0d\u964c\u751f\u5427\u3002\u4ee5\u524d\u6211\u4eec\u73a9\u7684\u53ef\u80fd\u662fapp\u7248\u7684\uff0c\u4f46\u662f\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u5757web\u7248\u7684\u4e94\u5b50\u68cb\u3002\u672c\u6587\u5236\u4f5c\u7684\u9ed1\u767d\u4e94\u5b50\u68cb\u6e38\u620f\u4e5f\u7b97\u662f\u4e00\u5757HTML5\u6e38\u620f\u5427\u3002\n<\/p>\n<p>\n\t\u4e0b\u9762\u6211\u4eec\u5148\u6765\u770b\u770b\u6211\u7684<a href=\"https:\/\/baike.baidu.com\/item\/\u4e94\u5b50\u68cb\/130266\" name=\"\u4e94\u5b50\u68cb\" target=\"_blank\" title=\"\u4e94\u5b50\u68cb\">\u4e94\u5b50\u68cb<\/a>\u7684\u8fd0\u884c\u6548\u679c\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u4e94\u5b50\u68cb\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201708\/14\/1502693650_333543.png\" style=\"width: 910px;height: 605px\" \/>\n<\/p>\n<p>\n\t\u600e\u4e48\u6837\u770b\u8d77\u6765\u662f\u4e0d\u662f\u5f88\u9ad8\u5927\u4e0a\u3002\u5b9e\u9645\u4e0a\u5b83\u7684\u5b9e\u73b0\u8fc7\u7a0b\u4e00\u70b9\u4e5f\u4e0d\u96be\u3002\u6211\u4eec\u5148\u4ece\u4e94\u5b50\u68cb\u7684\u89c4\u5219\u8bf4\u8d77\u5427\u3002\n<\/p>\n<p>\n\t\u4e94\u5b50\u68cb\u901a\u5e38\u53cc\u65b9\u5206\u522b\u4f7f\u7528\u9ed1\u767d\u4e24\u8272\u7684\u68cb\u5b50\uff0c\u4e0b\u5728\u68cb\u76d8\u76f4\u7ebf\u4e0e\u6a2a\u7ebf\u7684\u4ea4\u53c9\u70b9\u4e0a\uff0c\u5148\u5f62\u62105\u5b50\u8fde\u7ebf\u8005\u83b7\u80dc\u3002\n<\/p>\n<p>\n\t\u6839\u636e\u4e0a\u9762\u7684\u89c4\u5219\uff0c\u6211\u4eec\u8bf4\u8bf4\u6211\u4eec\u4e94\u5b50\u68cb\u5b9e\u73b0\u7684\u6b65\u9aa4\uff1a\n<\/p>\n<ul>\n<li>\n\t\t\u5148\u8981\u5b9e\u73b0\u4e00\u4e2a15*15\u7684\u68cb\u724c\u3002\n\t<\/li>\n<li>\n\t\t\u5269\u4e0b\u7684\u5c31\u662f\u903b\u8f91\u3002\u63a7\u5236\u8c01\u5148\u8d70\uff0c\u5b9e\u65f6\u5224\u65ad\u8f93\u8d62\u3002\n\t<\/li>\n<\/ul>\n<p>\n\t\u4e0b\u9762\u662f\u5168\u90e8\u7684\u5b9e\u73b0\u4ee3\u7801\uff1a\n<\/p>\n<pre class=\"brush:xml;\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html;&quot;&gt;\r\n\t&lt;title&gt;\u4e1a\u4f59\u8349www.xttblog.com\u4e94\u5b50\u68cb&lt;\/title&gt;\r\n\t&lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;reset.css&quot;&gt;\r\n\t&lt;script type=&quot;text\/javascript&quot; src=&quot;CookieHandle.js&quot;&gt;&lt;\/script&gt;\r\n\t&lt;script type=&quot;text\/javascript&quot; src=&quot;jquery-1.7.2.js&quot;&gt;&lt;\/script&gt;\r\n\t&lt;style&gt;\r\n\t.wrapper {\r\n\twidth: 600px;\r\n\tposition: relative;\r\n}\r\n\/* \u68cb\u76d8 *\/\r\ndiv.chessboard {\r\n\tmargin: 30px 0 0 50px;\r\n\twidth: 542px;\r\n\tbackground: url(chessboard.png) no-repeat 14px 14px rgb(250, 250, 250);\r\n\toverflow: hidden;\r\n\tbox-shadow: 2px 2px 8px #888;\r\n\t-webkit-box-shadow: 2px 2px 8px #888;\r\n\t-moz-box-shadow: 2px 2px 8px #888;\r\n}\r\ndiv.chessboard div {\r\n\tfloat: left;\r\n\twidth: 36px;\r\n\theight: 36px;\r\n\tborder-top: 0px solid #ccc;\r\n\tborder-left: 0px solid #ccc;\r\n\tborder-right: 0;\r\n\tborder-bottom: 0;\r\n\tcursor: pointer;\r\n}\r\n\/* \u68cb\u5b50 *\/\r\ndiv.chessboard div.black {\r\n\tbackground: url(black.png) no-repeat 4px 4px;\r\n}\r\ndiv.chessboard div.white {\r\n\tbackground: url(white.png) no-repeat 4px 4px;\r\n}\r\ndiv.chessboard div.hover {\r\n\tbackground: url(hover.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-up {\r\n\tbackground: url(hover_up.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-down {\r\n\tbackground: url(hover_down.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-up-left {\r\n\tbackground: url(hover_up_left.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-up-right {\r\n\tbackground: url(hover_up_right.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-left {\r\n\tbackground: url(hover_left.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-right {\r\n\tbackground: url(hover_right.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-down-left {\r\n\tbackground: url(hover_down_left.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.hover-down-right {\r\n\tbackground: url(hover_down_right.png) no-repeat 1px 1px;\r\n}\r\ndiv.chessboard div.white-last {\r\n\tbackground: url(white_last.png) no-repeat 4px 4px;\r\n}\r\ndiv.chessboard div.black-last {\r\n\tbackground: url(black_last.png) no-repeat 4px 4px;\r\n}\r\n\r\n\/* \u53f3\u4fa7 *\/\r\n\r\ndiv.operating-panel {\r\n\tposition: absolute;\r\n\tleft: 610px;\r\n\ttop: 150px;\r\n\twidth: 200px;\r\n\ttext-align: center;\r\n}\r\n.operating-panel a {\r\n\tdisplay: inline-block;\r\n\tpadding: 10px 15px;\r\n\tmargin-bottom: 39px;\r\n\tmargin-right: 8px;\r\n\tmargin-left: 8px;\r\n\tbackground: rgb(100, 167, 233);\r\n\ttext-decoration: none;\r\n\tcolor: #333;\r\n\tfont-weight: bold;\r\n\tfont-size: 16px;\r\n\tfont-family: &quot;\u5fae\u8f6f\u96c5\u9ed1&quot;, &quot;\u5b8b\u4f53&quot;;\r\n}\r\n.operating-panel a:hover {\r\n\tbackground: rgb(48, 148, 247);\r\n\ttext-decoration: none;\r\n}\r\n.operating-panel a.disable, .operating-panel a.disable:hover {\r\n\tcursor: default;\r\n\tbackground: rgb(197, 203, 209);\r\n\tcolor: rgb(130, 139, 148);\r\n}\r\n.operating-panel a.selected {\r\n\tborder: 5px solid #F3C242;\r\n\tpadding: 5px 10px;\r\n}\r\n#result_tips {\r\n\tcolor: #CE4242;\r\n\tfont-size: 26px;\r\n\tfont-family: &quot;\u5fae\u8f6f\u96c5\u9ed1&quot;;\r\n}\r\n#result_info {\r\n\tmargin-bottom: 26px;\r\n}\r\n\t&lt;\/style&gt;\r\n\t&lt;script&gt;\r\n\t\t$(document).ready(function() {\r\n\tfiveChess.init();\r\n});\r\nvar fiveChess = {\r\n\tNO_CHESS: 0,\r\n\tBLACK_CHESS: -1,\r\n\tWHITE_CHESS: 1,\r\n\tchessArr: [],\t\/\/\u8bb0\u5f55\u68cb\u5b50\r\n\tchessBoardHtml: &quot;&quot;,\r\n\thumanPlayer: &quot;black&quot;,\t\/\/\u73a9\u5bb6\u68cb\u5b50\u989c\u8272\r\n\tAIPlayer: &quot;white&quot;,\t\/\/AI\u68cb\u5b50\u989c\u8272\r\n\tisPlayerTurn: true, \/\/\u8f6e\u5230player\u4e0b\u68cb\r\n\ttotalGames: cookieHandle.getCookie(&quot;totalGames&quot;) || 0,\t\/\/\u603b\u5c40\u6570\r\n\twinGames: cookieHandle.getCookie(&quot;winGames&quot;) || 0,\t\/\/\u73a9\u5bb6\u8d62\u5c40\u6570\r\n\tisGameStart: false,\t\/\/\u6e38\u620f\u5df2\u7ecf\u5f00\u59cb\r\n\tisGameOver: false, \/\/\u6e38\u620f\u7ed3\u675f\r\n\tplayerLastChess: [], \/\/\u73a9\u5bb6\u6700\u540e\u4e0b\u5b50\u4f4d\u7f6e\r\n\tAILastChess: [], \/\/AI\u6700\u540e\u4e0b\u5b50\u4f4d\u7f6e\r\n\r\n\tinit: function () {\r\n\t\tthis.chessBoardHtml = $(&quot;div.chessboard&quot;).html();\r\n\t\tvar _fiveChess = this;\r\n\t\t\/\/\u53f3\u4fa7\u64cd\u4f5c\u6309\u94ae\r\n\t\t$(&quot;.operating-panel a&quot;).click(function (event) {\r\n\t\t\tevent.preventDefault();\r\n\t\t\tvar id = $(this).attr(&quot;id&quot;);\r\n\t\t\tif (_fiveChess.isGameStart &amp;&amp; id !== &quot;replay_btn&quot; ) { return; }\t\/\/\u6b63\u5728\u6e38\u620f \u4e0d\u64cd\u4f5c\r\n\t\t\tswitch (id) {\r\n\t\t\t\tcase &quot;black_btn&quot;:\r\n\t\t\t\t\t_fiveChess.humanPlayer = &quot;black&quot;;\r\n\t\t\t\t\t_fiveChess.AIPlayer = &quot;white&quot;;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase &quot;white_btn&quot;:\r\n\t\t\t\t\t_fiveChess.humanPlayer = &quot;white&quot;;\r\n\t\t\t\t\t_fiveChess.AIPlayer = &quot;black&quot;;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase &quot;first_move_btn&quot;:\r\n\t\t\t\t\t_fiveChess.isPlayerTurn = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase &quot;second_move_btn&quot;:\r\n\t\t\t\t\t_fiveChess.isPlayerTurn = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase &quot;replay_btn&quot;:\r\n\t\t\t\t\t_fiveChess.resetChessBoard();\r\n\t\t\t\t\tif (_fiveChess.isGameStart) {\t\/\/\u70b9\u91cd\u73a9\r\n\t\t\t\t\t\t_fiveChess.gameOver();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\t\/\/\u70b9\u5f00\u59cb\r\n\t\t\t\t\t\t_fiveChess.gameStart();\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (id !== &quot;replay_btn&quot;) {\r\n\t\t\t\t$(this).addClass(&quot;selected&quot;).siblings().removeClass(&quot;selected&quot;);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.resetChessBoard();\r\n\t\t$(&quot;#result_info&quot;).html(&quot;\u80dc\u7387\uff1a&quot; + (this.winGames * 100 \/ this.totalGames | 0) + &quot;%&quot;);\r\n\t},\r\n\t\/\/\u91cd\u7f6e\u68cb\u76d8\r\n\tresetChessBoard: function () {\r\n\t\t$(&quot;div.chessboard&quot;).html(this.chessBoardHtml);\r\n\t\t$(&quot;#result_tips&quot;).html(&quot;&quot;);\r\n\t\tthis.isGameOver = false;\r\n\t\tthis.isPlayerTurn = $(&quot;#first_move_btn&quot;).hasClass(&quot;selected&quot;);\r\n\t\t\/\/\u521d\u59cb\u5316\u68cb\u5b50\u72b6\u6001\r\n\t\tvar i, j;\r\n\t\tfor (i = 0; i &lt; 15; i++) {\r\n\t\t\tthis.chessArr[i] = [];\r\n\t\t\tfor (j = 0; j &lt; 15; j++) {\r\n\t\t\t\tthis.chessArr[i][j] = this.NO_CHESS;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\/\/player\u4e0b\u68cb\u4e8b\u4ef6\r\n\t\tvar _fiveChess = this;\r\n\t\t$(&quot;div.chessboard div&quot;).click(function () {\r\n\t\t\tif (!_fiveChess.isPlayerTurn || _fiveChess.isGameOver) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!_fiveChess.isGameStart) {\r\n\t\t\t\t_fiveChess.gameStart();\r\n\t\t\t}\r\n\t\t\tvar index = $(this).index(),\r\n\t\t\t\ti = index \/ 15 | 0,\r\n\t\t\t\tj = index % 15;\r\n\t\t\tif (_fiveChess.chessArr[i][j] === _fiveChess.NO_CHESS) {\r\n\t\t\t\t_fiveChess.playChess(i, j, _fiveChess.humanPlayer);\r\n\t\t\t\tif (i === 0 &amp;&amp; j === 0) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-up-left&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (i === 0 &amp;&amp; j === 14) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-up-right&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (i === 14 &amp;&amp; j === 0) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-down-left&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (i === 14 &amp;&amp; j === 14) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-down-right&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (i === 0) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-up&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (i === 14) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-down&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (j === 0) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-left&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse if (j === 14) {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover-right&quot;);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$(this).removeClass(&quot;hover&quot;);\r\n\t\t\t\t}\r\n\t\t\t\t_fiveChess.playerLastChess = [i, j];\r\n\t\t\t\t_fiveChess.playerWinOrNot(i, j);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\/\/\u9f20\u6807\u5728\u68cb\u76d8\u4e0a\u79fb\u52a8\u6548\u679c\r\n\t\t$(&quot;div.chessboard div&quot;).hover(\r\n\t\t\tfunction () {\r\n\t\t\t\tif (!_fiveChess.isPlayerTurn || _fiveChess.isGameOver) { return; }\r\n\t\t\t\tvar index = $(this).index(),\r\n\t\t\t\t\ti = index \/ 15 | 0,\r\n\t\t\t\t\tj = index % 15;\r\n\t\t\t\tif (_fiveChess.chessArr[i][j] === _fiveChess.NO_CHESS) {\r\n\t\t\t\t\tif (i === 0 &amp;&amp; j === 0) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-up-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 0 &amp;&amp; j === 14) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-up-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14 &amp;&amp; j === 0) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-down-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14 &amp;&amp; j === 14) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-down-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 0) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-up&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-down&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (j === 0) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (j === 14) {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$(this).addClass(&quot;hover&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction () {\r\n\t\t\t\tif (!_fiveChess.isPlayerTurn || _fiveChess.isGameOver) { return; }\r\n\t\t\t\tvar index = $(this).index(),\r\n\t\t\t\t\ti = index \/ 15 | 0,\r\n\t\t\t\t\tj = index % 15;\r\n\t\t\t\t\tif (i === 0 &amp;&amp; j === 0) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-up-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 0 &amp;&amp; j === 14) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-up-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14 &amp;&amp; j === 0) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-down-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14 &amp;&amp; j === 14) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-down-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 0) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-up&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (i === 14) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-down&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (j === 0) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-left&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (j === 14) {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover-right&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$(this).removeClass(&quot;hover&quot;);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\tgameStart: function () {\r\n\t\tthis.totalGames++;\r\n\t\tcookieHandle.setCookie({ name: &quot;totalGames&quot;, value: this.totalGames, expiresHours: 365 * 24 });\r\n\t\t\/\/AI\u5148\u624b\r\n\t\tif (!this.isPlayerTurn) {\r\n\t\t\tthis.AImoveChess();\r\n\t\t}\r\n\t\tthis.isGameStart = true;\r\n\t\t$(&quot;.operating-panel p a&quot;).addClass(&quot;disable&quot;);\r\n\t\t$(&quot;#replay_btn&quot;).html(&quot;\u91cd\u73a9&quot;);\r\n\t},\r\n\tgameOver: function () {\r\n\t\tthis.isGameStart = false;\r\n\t\t$(&quot;.operating-panel a&quot;).removeClass(&quot;disable&quot;);\r\n\t\t$(&quot;#replay_btn&quot;).html(&quot;\u5f00\u59cb&quot;);\r\n\t\t$(&quot;#result_info&quot;).html(&quot;\u80dc\u7387\uff1a&quot; + (this.winGames * 100 \/ this.totalGames | 0) + &quot;%&quot;);\r\n\t},\r\n\r\n\t\/\/\u4e0b\u68cb i\u884c\uff0cj\u5217\uff0ccolor\u989c\u8272\r\n\tplayChess: function (i, j, color) {\r\n\t\tthis.chessArr[i][j] = color === &quot;black&quot; ? this.BLACK_CHESS : this.WHITE_CHESS;\r\n\t\tif (color === this.AIPlayer) {\r\n\t\t\t$(&quot;div.chessboard div.&quot; + color + &quot;-last&quot;).addClass(color).removeClass(color + &quot;-last&quot;);\r\n\t\t\t$(&quot;div.chessboard div:eq(&quot; + (i * 15 + j) + &quot;)&quot;).addClass(color + &quot;-last&quot;);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(&quot;div.chessboard div:eq(&quot; + (i * 15 + j) + &quot;)&quot;).addClass(color);\r\n\t\t}\r\n\t},\r\n\t\/\/\u73a9\u5bb6\u662f\u5426\u53d6\u80dc\r\n\tplayerWinOrNot: function (i, j) {\r\n\t\tvar nums = 1,\t\/\/\u8fde\u7eed\u68cb\u5b50\u4e2a\u6570\r\n\t\t\tchessColor = this.humanPlayer === &quot;black&quot; ? this.BLACK_CHESS : this.WHITE_CHESS,\r\n\t\t\tm, n;\r\n\t\t\/\/x\u65b9\u5411\r\n\t\tfor (m = j - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = j + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tthis.playerWin();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnums = 1;\r\n\t\t}\r\n\t\t\/\/y\u65b9\u5411\r\n\t\tfor (m = i - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tthis.playerWin();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnums = 1;\r\n\t\t}\r\n\t\t\/\/\u5de6\u659c\u65b9\u5411\r\n\t\tfor (m = i - 1, n = j - 1; m &gt;= 0 &amp;&amp; n &gt;= 0; m--, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j + 1; m &lt; 15 &amp;&amp; n &lt; 15; m++, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tthis.playerWin();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnums = 1;\r\n\t\t}\r\n\t\t\/\/\u53f3\u659c\u65b9\u5411\r\n\t\tfor (m = i - 1, n = j + 1; m &gt;= 0 &amp;&amp; n &lt; 15; m--, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j - 1; m &lt; 15 &amp;&amp; n &gt;= 0; m++, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tthis.playerWin();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.AImoveChess();\r\n\t},\r\n\tplayerWin: function () {\r\n\t\tthis.winGames++;\r\n\t\tcookieHandle.setCookie({ name: &quot;winGames&quot;, value: this.winGames, expiresHours: 365 * 24 });\r\n\t\tthis.showResult(true);\r\n\t\tthis.gameOver();\r\n\t},\r\n\t\/\/AI\u4e0b\u68cb\r\n\tAImoveChess: function () {\r\n\t\tthis.isPlayerTurn = false;\r\n\t\tvar maxX = 0,\r\n\t\t\tmaxY = 0,\r\n\t\t\tmaxWeight = 0,\r\n\t\t\ti, j, tem;\r\n\t\tfor (i = 14; i &gt;= 0; i--) {\r\n\t\t\tfor (j = 14; j &gt;= 0; j--) {\r\n\t\t\t\tif (this.chessArr[i][j] !== this.NO_CHESS) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\ttem = this.computeWeight(i, j);\r\n\t\t\t\tif (tem &gt; maxWeight) {\r\n\t\t\t\t\tmaxWeight = tem;\r\n\t\t\t\t\tmaxX = i;\r\n\t\t\t\t\tmaxY = j;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.playChess(maxX, maxY, this.AIPlayer);\r\n\t\tthis.AILastChess = [maxX, maxY];\r\n\t\tif ((maxWeight &gt;= 100000 &amp;&amp; maxWeight &lt; 250000) || (maxWeight &gt;= 500000)) {\r\n\t\t\tthis.showResult(false);\r\n\t\t\tthis.gameOver();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.isPlayerTurn = true;\r\n\t\t}\r\n\t},\r\n\tshowResult: function(isPlayerWin) {\r\n\t\tif (isPlayerWin) {\r\n\t\t\t$(&quot;#result_tips&quot;).html(&quot;\u606d\u559c\u4f60\u83b7\u80dc\uff01&quot;);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$(&quot;#result_tips&quot;).html(&quot;\u54c8\u54c8\uff0c\u4f60\u8f93\u54af\uff01&quot;);\r\n\t\t}\r\n\t\tthis.isGameOver = true;\r\n\t\tthis.showWinChesses(isPlayerWin);\r\n\t},\r\n\t\/\/\u6807\u8bb0\u663e\u793a\u83b7\u80dc\u68cb\u5b50\r\n\tshowWinChesses: function (isPlayerWin) {\r\n\t\tvar nums = 1,\t\/\/\u8fde\u7eed\u68cb\u5b50\u4e2a\u6570\r\n\t\t\tlineChess = [],\t\/\/\u8fde\u7eed\u68cb\u5b50\u4f4d\u7f6e\r\n\t\t\ti,\r\n\t\t\tj,\r\n\t\t\tchessColor,\r\n\t\t\tm, n;\r\n\t\tif (isPlayerWin) {\r\n\t\t\tchessColor = this.humanPlayer === &quot;black&quot; ? this.BLACK_CHESS : this.WHITE_CHESS;\r\n\t\t\ti = this.playerLastChess[0];\r\n\t\t\tj = this.playerLastChess[1];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tchessColor = this.AIPlayer === &quot;black&quot; ? this.BLACK_CHESS : this.WHITE_CHESS;\r\n\t\t\ti = this.AILastChess[0];\r\n\t\t\tj = this.AILastChess[1];\r\n\t\t}\r\n\t\t$(&quot;div.chessboard div.&quot; + this.AIPlayer + &quot;-last&quot;).addClass(this.AIPlayer).removeClass(this.AIPlayer + &quot;-last&quot;);\r\n\t\t\/\/x\u65b9\u5411\r\n\t\tlineChess[0] = [i];\r\n\t\tlineChess[1] = [j];\r\n\t\tfor (m = j - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = i;\r\n\t\t\t\tlineChess[1][nums] = m;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = j + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = i;\r\n\t\t\t\tlineChess[1][nums] = m;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tfor (k = nums - 1; k &gt;= 0; k--) {\r\n\t\t\t\tthis.markChess(lineChess[0][k] * 15 + lineChess[1][k], isPlayerWin ? this.humanPlayer : this.AIPlayer);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\/\/y\u65b9\u5411\r\n\t\tnums = 1;\r\n\t\tlineChess[0] = [i];\r\n\t\tlineChess[1] = [j];\r\n\t\tfor (m = i - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = j;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = j;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tfor (k = nums - 1; k &gt;= 0; k--) {\r\n\t\t\t\tthis.markChess(lineChess[0][k] * 15 + lineChess[1][k], isPlayerWin ? this.humanPlayer : this.AIPlayer);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\/\/\u5de6\u659c\u65b9\u5411\r\n\t\tnums = 1;\r\n\t\tlineChess[0] = [i];\r\n\t\tlineChess[1] = [j];\r\n\t\tfor (m = i - 1, n = j - 1; m &gt;= 0 &amp;&amp; n &gt;= 0; m--, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = n;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j + 1; m &lt; 15 &amp;&amp; n &lt; 15; m++, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = n;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tfor (k = nums - 1; k &gt;= 0; k--) {\r\n\t\t\t\tthis.markChess(lineChess[0][k] * 15 + lineChess[1][k], isPlayerWin ? this.humanPlayer : this.AIPlayer);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\/\/\u53f3\u659c\u65b9\u5411\r\n\t\tnums = 1;\r\n\t\tlineChess[0] = [i];\r\n\t\tlineChess[1] = [j];\r\n\t\tfor (m = i - 1, n = j + 1; m &gt;= 0 &amp;&amp; n &lt; 15; m--, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = n;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j - 1; m &lt; 15 &amp;&amp; n &gt;= 0; m++, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tlineChess[0][nums] = m;\r\n\t\t\t\tlineChess[1][nums] = n;\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (nums &gt;= 5) {\r\n\t\t\tfor (k = nums - 1; k &gt;= 0; k--) {\r\n\t\t\t\tthis.markChess(lineChess[0][k] * 15 + lineChess[1][k], isPlayerWin ? this.humanPlayer : this.AIPlayer);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tmarkChess: function (pos, color) {\r\n\t\t$(&quot;div.chessboard div:eq(&quot; + pos + &quot;)&quot;).removeClass(color).addClass(color + &quot;-last&quot;);\r\n\t},\r\n\t\/\/\u4e0b\u5b50\u5230i\uff0cj X\u65b9\u5411 \u7ed3\u679c: \u591a\u5c11\u8fde\u5b50 \u4e24\u8fb9\u662f\u5426\u622a\u65ad\r\n\tputDirectX: function (i, j, chessColor) {\r\n\t\tvar m, n,\r\n\t\t\tnums = 1,\r\n\t\t\tside1 = false,\r\n\t\t\tside2 = false;\r\n\t\tfor (m = j - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[i][m] === this.NO_CHESS) {\r\n\t\t\t\t\tside1 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = j + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[i][m] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[i][m] === this.NO_CHESS) {\r\n\t\t\t\t\tside2 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {&quot;nums&quot;: nums, &quot;side1&quot;: side1, &quot;side2&quot;: side2};\r\n\t},\r\n\t\/\/\u4e0b\u5b50\u5230i\uff0cj Y\u65b9\u5411 \u7ed3\u679c\r\n\tputDirectY: function (i, j, chessColor) {\r\n\t\tvar m, n,\r\n\t\t\tnums = 1,\r\n\t\t\tside1 = false,\r\n\t\t\tside2 = false;\r\n\t\tfor (m = i - 1; m &gt;= 0; m--) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][j] === this.NO_CHESS) {\r\n\t\t\t\t\tside1 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1; m &lt; 15; m++) {\r\n\t\t\tif (this.chessArr[m][j] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][j] === this.NO_CHESS) {\r\n\t\t\t\t\tside2 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {&quot;nums&quot;: nums, &quot;side1&quot;: side1, &quot;side2&quot;: side2};\r\n\t},\r\n\t\/\/\u4e0b\u5b50\u5230i\uff0cj XY\u65b9\u5411 \u7ed3\u679c\r\n\tputDirectXY: function (i, j, chessColor) {\r\n\t\tvar m, n,\r\n\t\t\tnums = 1,\r\n\t\t\tside1 = false,\r\n\t\t\tside2 = false;\r\n\t\tfor (m = i - 1, n = j - 1; m &gt;= 0 &amp;&amp; n &gt;= 0; m--, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][n] === this.NO_CHESS) {\r\n\t\t\t\t\tside1 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j + 1; m &lt; 15 &amp;&amp; n &lt; 15; m++, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][n] === this.NO_CHESS) {\r\n\t\t\t\t\tside2 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {&quot;nums&quot;: nums, &quot;side1&quot;: side1, &quot;side2&quot;: side2};\r\n\t},\r\n\tputDirectYX: function (i, j, chessColor) {\r\n\t\tvar m, n,\r\n\t\t\tnums = 1,\r\n\t\t\tside1 = false,\r\n\t\t\tside2 = false;\r\n\t\tfor (m = i - 1, n = j + 1; m &gt;= 0 &amp;&amp; n &lt; 15; m--, n++) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][n] === this.NO_CHESS) {\r\n\t\t\t\t\tside1 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (m = i + 1, n = j - 1; m &lt; 15 &amp;&amp; n &gt;= 0; m++, n--) {\r\n\t\t\tif (this.chessArr[m][n] === chessColor) {\r\n\t\t\t\tnums++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (this.chessArr[m][n] === this.NO_CHESS) {\r\n\t\t\t\t\tside2 = true;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn {&quot;nums&quot;: nums, &quot;side1&quot;: side1, &quot;side2&quot;: side2};\r\n\t},\r\n\t\/\/\u8ba1\u7b97\u4e0b\u5b50\u81f3i,j\u7684\u6743\u91cd\r\n\tcomputeWeight: function (i, j) {\r\n\t\tvar weight = 14 - (Math.abs(i - 7) + Math.abs(j - 7)), \/\/\u57fa\u4e8e\u68cb\u76d8\u4f4d\u7f6e\u6743\u91cd\r\n\t\t\tpointInfo = {},\t\/\/\u67d0\u70b9\u4e0b\u5b50\u540e\u8fde\u5b50\u4fe1\u606f\r\n\t\t\tchessColor = this.AIPlayer === &quot;black&quot; ? this.BLACK_CHESS : this.WHITE_CHESS;\r\n\t\t\/\/x\u65b9\u5411\r\n\t\tpointInfo = this.putDirectX(i, j, chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, true);\/\/AI\u4e0b\u5b50\u6743\u91cd\r\n\t\tpointInfo = this.putDirectX(i, j, -chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, false);\/\/player\u4e0b\u5b50\u6743\u91cd\r\n\t\t\/\/y\u65b9\u5411\r\n\t\tpointInfo = this.putDirectY(i, j, chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, true);\/\/AI\u4e0b\u5b50\u6743\u91cd\r\n\t\tpointInfo = this.putDirectY(i, j, -chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, false);\/\/player\u4e0b\u5b50\u6743\u91cd\r\n\t\t\/\/\u5de6\u659c\u65b9\u5411\r\n\t\tpointInfo = this.putDirectXY(i, j, chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, true);\/\/AI\u4e0b\u5b50\u6743\u91cd\r\n\t\tpointInfo = this.putDirectXY(i, j, -chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, false);\/\/player\u4e0b\u5b50\u6743\u91cd\r\n\t\t\/\/\u53f3\u659c\u65b9\u5411\r\n\t\tpointInfo = this.putDirectYX(i, j, chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, true);\/\/AI\u4e0b\u5b50\u6743\u91cd\r\n\t\tpointInfo = this.putDirectYX(i, j, -chessColor);\r\n\t\tweight += this.weightStatus(pointInfo.nums, pointInfo.side1, pointInfo.side2, false);\/\/player\u4e0b\u5b50\u6743\u91cd\r\n\t\treturn weight;\r\n\t},\r\n\t\/\/\u6743\u91cd\u65b9\u6848   \u72ec\uff1a\u4e24\u8fb9\u4e3a\u7a7a\u53ef\u4e0b\u5b50\uff0c\u5355\uff1a\u4e00\u8fb9\u4e3a\u7a7a\r\n\tweightStatus: function (nums, side1, side2, isAI) {\r\n\t\tvar weight = 0;\r\n\t\tswitch (nums) {\r\n\t\t\tcase 1:\r\n\t\t\t\tif (side1 &amp;&amp; side2) {\r\n\t\t\t\t\tweight = isAI ? 15 : 10;\t\/\/\u72ec\u4e00\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tif (side1 &amp;&amp; side2) {\r\n\t\t\t\t\tweight = isAI ? 100 : 50;\t\/\/\u72ec\u4e8c\r\n\t\t\t\t}\r\n\t\t\t\telse if (side1 || side2) {\r\n\t\t\t\t\tweight = isAI ? 10 : 5;\t\/\/\u5355\u4e8c\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tif (side1 &amp;&amp; side2) {\r\n\t\t\t\t\tweight = isAI ? 500 : 200;\t\/\/\u72ec\u4e09\r\n\t\t\t\t}\r\n\t\t\t\telse if (side1 || side2) {\r\n\t\t\t\t\tweight = isAI ? 30 : 20;\t\/\/\u5355\u4e09\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t\tif (side1 &amp;&amp; side2) {\r\n\t\t\t\t\tweight = isAI ? 5000 : 2000;\t\/\/\u72ec\u56db\r\n\t\t\t\t}\r\n\t\t\t\telse if (side1 || side2) {\r\n\t\t\t\t\tweight = isAI ? 400 : 100;\t\/\/\u5355\u56db\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 5:\r\n\t\t\t\tweight = isAI ? 100000 : 10000;\t\/\/\u4e94\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tweight = isAI ? 500000 : 250000;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn weight;\r\n\t}\r\n};\r\n\t&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div class=&quot;wrapper&quot;&gt;\r\n\t&lt;div class=&quot;chessboard&quot;&gt;\r\n\t\t&lt;!-- top line --&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-top chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 1 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\t\t\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 2 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 3 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 4 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 5 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 6 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 7 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 8 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 9 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 10 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 11 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 12 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- line 13 --&gt;\r\n\t\t&lt;div class=&quot;chess-left&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-middle&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-right&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;!-- bottom line  --&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom&quot;&gt;&lt;\/div&gt;\r\n\t\t&lt;div class=&quot;chess-bottom chess-right&quot;&gt;&lt;\/div&gt;\r\n\t&lt;\/div&gt;\r\n\r\n\t&lt;div class=&quot;operating-panel&quot;&gt;\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;a id=&quot;black_btn&quot; class=&quot;btn selected&quot; href=&quot;#&quot;&gt;\u9ed1\u5b50&lt;\/a&gt;\r\n\t\t\t&lt;a id=&quot;white_btn&quot; class=&quot;btn&quot; href=&quot;#&quot;&gt;\u767d\u5b50&lt;\/a&gt;\r\n\t\t&lt;\/p&gt;\r\n\t\t&lt;p&gt;\r\n\t\t\t&lt;a id=&quot;first_move_btn&quot; class=&quot;btn selected&quot; href=&quot;#&quot;&gt;\u5148\u624b&lt;\/a&gt;\r\n\t\t\t&lt;a id=&quot;second_move_btn&quot; class=&quot;btn&quot; href=&quot;#&quot;&gt;\u540e\u624b&lt;\/a&gt;\r\n\t\t&lt;\/p&gt;\r\n\t\t&lt;a id=&quot;replay_btn&quot; class=&quot;btn&quot; href=&quot;#&quot;&gt;\u5f00\u59cb&lt;\/a&gt;\r\n\t\t&lt;p id=&quot;result_info&quot;&gt;\u80dc\u7387\uff1a100%&lt;\/p&gt;\r\n\t\t&lt;p id=&quot;result_tips&quot;&gt;&lt;\/p&gt;\r\n\t&lt;\/div&gt;\r\n\t&lt;div style=&quot;display: none&quot;&gt;\r\n\t\t&lt;!-- \u56fe\u7247\u9700\u5408\u5e76 \u51cf\u5c11http\u8bf7\u6c42\u6570 --&gt;\r\n\t\t&lt;img src=&quot;black.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;white.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_up.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_down.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_up_left.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_up_right.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_left.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_right.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_down_left.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;hover_down_right.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;black_last.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t\t&lt;img src=&quot;white_last.png&quot; alt=&quot;preload&quot; \/&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\n\t\u5168\u90e8\u6e90\u7801\u5df2\u5171\u4eab\u5230\u4e86runjs\u4e0a\uff0c<a href=\"http:\/\/runjs.cn\/code\/jhp3w797\" name=\"\u4e94\u5b50\u68cb\" target=\"_blank\" title=\"\u4e94\u5b50\u68cb\">http:\/\/runjs.cn\/code\/jhp3w797<\/a><\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=1773\">JavaScript\u5b9e\u73b0\u4e00\u5757\u9ed1\u767d\u4e94\u5b50\u68cb\u6e38\u620f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u4e94\u5b50\u68cb\u5927\u5bb6\u90fd\u4e0d\u964c\u751f\u5427\u3002\u4ee5\u524d\u6211\u4eec\u73a9\u7684\u53ef\u80fd\u662fapp\u7248\u7684\uff0c\u4f46\u662f\u4eca\u5929\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u5757web\u7248\u7684\u4e94\u5b50\u68cb\u3002\u672c\u6587\u5236\u4f5c\u7684\u9ed1\u767d\u4e94 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1106,1285,1426,1293],"class_list":["post-1773","post","type-post","status-publish","format-standard","hentry","category-html5","tag-javascript","tag-js","tag-1426","tag-1293"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1773"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1773\/revisions"}],"predecessor-version":[{"id":1774,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1773\/revisions\/1774"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}