Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!-- saved from url=(0041)http://1kchess.an3.es/play-level-advanced -->
  3. <html lang="en">
  4.  
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <title>Online Chess - Level Advanced</title>
  8. <meta name="description" content="Test your chess game skills with the world&#39;s smallest chess program. Game level: Advanced.">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  10. <!-- 1kchess.an3.es -->
  11.  
  12. <script src="./Online Chess - Level Advanced_files/ca-pub-1415407386988961.js.ladda ned"></script>
  13. <script>
  14. // aliases and constants
  15. function $(i) {
  16. return document.getElementById(i)
  17. }
  18. String.prototype.U = String.prototype.charCodeAt;
  19. M = Math.random;
  20. W = setTimeout;
  21. X = 10;
  22. Q = 15;
  23. H = 1e4
  24.  
  25.  
  26. // 2K chess (1683 bytes)
  27. b = 0;
  28. I = [];
  29. G = 120;
  30. l = [5, 3, 4, 6, 2, 4, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 13, 11, 12, 14, 10, 12, 11, 13, 0, 99, 0, 306, 297, 495, 846, -1, 0, 1, 2, 2, 1, 0, -1, -1, 1, -10, 10, -11, -9, 9, 11, 10, 20, -9, -11, -10, -20, -21, -19, -12, -8, 8, 12, 19, 21];
  31.  
  32. function P(w, c, h, e, S, s) {
  33. var t, o, L, E, d, O = e,
  34. N = -H * H,
  35. K = 78 - h << X,
  36. p, g, n, m, A, q, r, C, J, a = y ? -X : X;
  37. y ^= 8;
  38. G++;
  39. d = w || s && s >= h && P(0, 0, 0, 21, 0, 0) > H;
  40. do {
  41. if (o = I[p = O]) {
  42. q = o & Q ^ y;
  43. if (q < 7) {
  44. A = q-- & 2 ? 8 : 4;
  45. C = o - 9 & Q ? [53, 47, 61, 51, 47, 47][q] : 57;
  46. do {
  47. r = I[p += l[C]];
  48. if (!w | p == w) {
  49. g = q | p + a - S ? 0 : S;
  50. if (!r & (!!q | A < 3 || !!g) || (r + 1 & Q ^ y) > 9 && q | A > 2) {
  51. if (m = !(r - 2 & 7)) return y ^= 8, I[G--] = O, K;
  52. J = n = o & Q;
  53. E = I[p - a] & Q;
  54. t = q | E - 7 ? n : (n += 2, 6 ^ y);
  55. while (n <= t) {
  56. L = r ? l[r & 7 | 32] - h - q : 0;
  57. if (s) L += (1 - q ? l[(p - p % X) / X + 37] - l[(O - O % X) / X + 37] + l[p % X + 38] * (q ? 1 : 2) - l[O % X + 38] + (o & 16) / 2 : !!m * 9) + (!q ? !(I[p - 1] ^ n) + !(I[p + 1] ^ n) + l[n & 7 | 32] - 99 + !!g * 99 + (A < 2) : 0) + !(E ^ y ^ 9);
  58. if (s > h || 1 < s & s == h && L > Q | d) {
  59. I[p] = n, I[O] = m ? (I[g] = I[m], I[m] = 0) : g ? I[g] = 0 : 0;
  60. L -= P(s > h | d ? 0 : p, L - N, h + 1, I[G + 1], J = q | A > 1 ? 0 : p, s);
  61. if (!(h || s - 1 | B - O | i - n | p - b | L < -H)) return F(), G--, u = J;
  62. J = q - 1 | A < 7 || m || !s | d | r | o < Q || P(0, 0, 0, 21, 0, 0) > H;
  63. I[O] = o;
  64. I[p] = r;
  65. m ? (I[m] = I[g], I[g] = 0) : g ? I[g] = 9 ^ y : 0
  66. }
  67. if (L > N || s > 1 && L == N && !h && M() < .5) {
  68. I[G] = O;
  69. if (s > 1) {
  70. if (h && c - L < 0) return y ^= 8, G--, L;
  71. if (!h) i = n, B = O, b = p
  72. }
  73. N = L
  74. }
  75. n += J || (g = p, m = p < O ? g - 3 : g + 2, I[m] < Q | I[m + O - p] || I[p += p - O]) ? 1 : 0
  76. }
  77. }
  78. }
  79. } while (!r & q > 2 || (p = O, q | A > 2 | o > Q & !r && ++C * --A))
  80. }
  81. }
  82. } while (++O > 98 ? O = 20 : e - O);
  83. return y ^= 8, G--, N + H * H && N > -K + 1924 | d ? N : 0
  84. }
  85. B = i = y = u = 0;
  86. while (B++ < 120) I[B - 1] = B % X ? B / X % X < 2 | B % X < 2 ? 7 : B / X & 4 ? 0 : l[i++] | 16 : 7;
  87.  
  88. function F() {
  89. B = b;
  90. for (p = 21; p < 99; ++p)
  91. if (q = $(p)) {
  92. q.innerHTML = "\xa0\u265f\u265a\u265e\u265d\u265c\u265b \u2659\u2654\u2658\u2657\u2656\u2655".charAt(I[p] & Q);
  93. q.lang = p - B
  94. }
  95. }
  96. F();
  97.  
  98. function V(s) {
  99. i = (I[s] ^ y) & Q;
  100. if (i > 8) {
  101. b = s;
  102. F()
  103. } else if (B && i < 9) {
  104. b = s;
  105. i = I[B] & Q;
  106. if ((i & 7) == 1 & (b < 29 | b > 90)) i = 14 ^ y;
  107. P(0, 0, 0, 21, u, 1);
  108. if (y) W("P(0,0,0,21,u,3),P(0,0,0,21,u,1)", 250)
  109. }
  110. }
  111. </script>
  112.  
  113. <style>
  114. html {
  115. font: 1em/1.3 georgia, serif;
  116. text-align: center
  117. }
  118.  
  119. body {
  120. position: relative;
  121. box-sizing: border-box;
  122. max-width: 38em;
  123. margin: 0 auto;
  124. padding: 1px 0 3em
  125. }
  126.  
  127. p#menu {
  128. margin: .4em 0;
  129. font: 1.75em cambria;
  130. color: #665
  131. }
  132.  
  133. p#menu a {
  134. display: inline-block;
  135. padding: .2em .5em;
  136. white-space: nowrap
  137. }
  138.  
  139. p#menu a:hover {
  140. background: AntiqueWhite
  141. }
  142.  
  143. p span {
  144. white-space: nowrap
  145. }
  146.  
  147. a {
  148. color: #385bc2;
  149. text-decoration: none
  150. }
  151.  
  152. a:hover {
  153. color: #b53b3b
  154. }
  155.  
  156. div#info {
  157. padding: 0 .5em;
  158. border: thin solid #385bc2;
  159. border-radius: .5em
  160. }
  161.  
  162. table {
  163. margin: 0 auto 1em
  164. }
  165.  
  166. td {
  167. width: 1.04em;
  168. height: 1.04em;
  169. overflow: hidden;
  170. font: 3em/1 "MS Gothic", "Segoe UI Symbol", "DejaVu Sans";
  171. background: Beige
  172. }
  173.  
  174. tr:nth-child(odd) td:nth-child(even),
  175. tr:nth-child(even) td:nth-child(odd) {
  176. background: Tan
  177. }
  178.  
  179. table {
  180. margin-top: .5em
  181. }
  182.  
  183. td {
  184. font-size: 4em;
  185. cursor: pointer
  186. }
  187.  
  188. td[lang='0'] {
  189. outline: thin solid #a00;
  190. color: #800
  191. }
  192.  
  193. .side_ads {
  194. position: absolute;
  195. top: .5em;
  196. width: 160px;
  197. height: 600px
  198. }
  199.  
  200. .side_ads.left {
  201. left: -180px
  202. }
  203.  
  204. .side_ads.right {
  205. right: -180px
  206. }
  207.  
  208. .ad_mobile {
  209. display: block
  210. }
  211.  
  212. @media (min-width:40em) {
  213. table {
  214. border: solid IndianRed;
  215. border-width: 0 1em
  216. }
  217. .ad_mobile {
  218. display: none
  219. }
  220. }
  221.  
  222. @media (max-width:40em) {
  223. body {
  224. width: 100%
  225. }
  226. p#menu small {
  227. display: none
  228. }
  229. div#info {
  230. margin-left: .5em;
  231. margin-right: .5em
  232. }
  233. table {
  234. box-shadow: .05em .05em .1em #666
  235. }
  236. .side_ads {
  237. display: none
  238. }
  239. }
  240. </style>
  241.  
  242. </head>
  243.  
  244. <body>
  245.  
  246. <table>
  247. <tbody>
  248. <tr>
  249. <td onclick="V(21)" id="21">♜</td>
  250. <td onclick="V(22)" id="22">♞</td>
  251. <td onclick="V(23)" id="23">♝</td>
  252. <td onclick="V(24)" id="24">♛</td>
  253. <td onclick="V(25)" id="25">♚</td>
  254. <td onclick="V(26)" id="26">♝</td>
  255. <td onclick="V(27)" id="27">♞</td>
  256. <td onclick="V(28)" id="28">♜</td>
  257. </tr>
  258. <tr>
  259. <td onclick="V(31)" id="31">♟</td>
  260. <td onclick="V(32)" id="32">♟</td>
  261. <td onclick="V(33)" id="33">♟</td>
  262. <td onclick="V(34)" id="34">♟</td>
  263. <td onclick="V(35)" id="35">♟</td>
  264. <td onclick="V(36)" id="36">♟</td>
  265. <td onclick="V(37)" id="37">♟</td>
  266. <td onclick="V(38)" id="38">♟</td>
  267. </tr>
  268. <tr>
  269. <td onclick="V(41)" id="41"></td>
  270. <td onclick="V(42)" id="42"></td>
  271. <td onclick="V(43)" id="43"></td>
  272. <td onclick="V(44)" id="44"></td>
  273. <td onclick="V(45)" id="45"></td>
  274. <td onclick="V(46)" id="46"></td>
  275. <td onclick="V(47)" id="47"></td>
  276. <td onclick="V(48)" id="48"></td>
  277. </tr>
  278. <tr>
  279. <td onclick="V(51)" id="51"></td>
  280. <td onclick="V(52)" id="52"></td>
  281. <td onclick="V(53)" id="53"></td>
  282. <td onclick="V(54)" id="54"></td>
  283. <td onclick="V(55)" id="55"></td>
  284. <td onclick="V(56)" id="56"></td>
  285. <td onclick="V(57)" id="57"></td>
  286. <td onclick="V(58)" id="58"></td>
  287. </tr>
  288. <tr>
  289. <td onclick="V(61)" id="61"></td>
  290. <td onclick="V(62)" id="62"></td>
  291. <td onclick="V(63)" id="63"></td>
  292. <td onclick="V(64)" id="64"></td>
  293. <td onclick="V(65)" id="65"></td>
  294. <td onclick="V(66)" id="66"></td>
  295. <td onclick="V(67)" id="67"></td>
  296. <td onclick="V(68)" id="68"></td>
  297. </tr>
  298. <tr>
  299. <td onclick="V(71)" id="71"></td>
  300. <td onclick="V(72)" id="72"></td>
  301. <td onclick="V(73)" id="73"></td>
  302. <td onclick="V(74)" id="74"></td>
  303. <td onclick="V(75)" id="75"></td>
  304. <td onclick="V(76)" id="76"></td>
  305. <td onclick="V(77)" id="77"></td>
  306. <td onclick="V(78)" id="78"></td>
  307. </tr>
  308. <tr>
  309. <td onclick="V(81)" id="81">♙</td>
  310. <td onclick="V(82)" id="82">♙</td>
  311. <td onclick="V(83)" id="83">♙</td>
  312. <td onclick="V(84)" id="84">♙</td>
  313. <td onclick="V(85)" id="85">♙</td>
  314. <td onclick="V(86)" id="86">♙</td>
  315. <td onclick="V(87)" id="87">♙</td>
  316. <td onclick="V(88)" id="88">♙</td>
  317. </tr>
  318. <tr>
  319. <td onclick="V(91)" id="91">♖</td>
  320. <td onclick="V(92)" id="92">♘</td>
  321. <td onclick="V(93)" id="93">♗</td>
  322. <td onclick="V(94)" id="94">♕</td>
  323. <td onclick="V(95)" id="95">♔</td>
  324. <td onclick="V(96)" id="96">♗</td>
  325. <td onclick="V(97)" id="97">♘</td>
  326. <td onclick="V(98)" id="98">♖</td>
  327. </tr>
  328. </tbody>
  329. </table>
  330.  
  331. <ins class="adsbygoogle ad_mobile" data-ad-client="ca-pub-1415407386988961" data-ad-slot="2403511195" data-ad-format="auto" data-adsbygoogle-status="done"></ins>
  332. <script async="" src="./Online Chess - Level Advanced_files/adsbygoogle.js.ladda ned"></script>
  333. <script>
  334. (adsbygoogle = window.adsbygoogle || []).push({});
  335. </script>
  336.  
  337. <p id="menu">
  338. <a href="http://1kchess.an3.es/" title="Click here to go back to game level selection (this game will NOT be saved).">« 1kChess</a> &nbsp; [ level: 3 ] &nbsp; <a href="http://1kchess.an3.es/play-level-advanced#info" onclick="with(document.getElementById(&#39;info&#39;)){style.display=style.display?&#39;&#39;:&#39;none&#39;}">( <b>?</b> )</a>
  339. </p>
  340. <div id="info" style="display:none">
  341. <p>
  342. In this level the computer will think a little while longer. For experts only! ;-)</p>
  343. <p>
  344. › To make your move, click on a white piece and then click on the target square.<br> › Press Ctrl and +/- to increase/decrease the chessboard's size.<br> › Hit F5 to start a new game (after checkmate or not).</p>
  345. </div>
  346.  
  347.  
  348.  
  349. <p>
  350. © 2010-
  351. <script>
  352. document.write(new Date().getFullYear())
  353. </script>2016 Óscar Toledo G.
  354. <span>Modifications and this website by Andrés Moreno.</span>
  355. <br>
  356. <i>1kChess, play chess online with the only 1-kB chess game program!</i>
  357. </p>
  358.  
  359.  
  360. <p></p>
  361.  
  362. <ins class="adsbygoogle side_ads left" data-ad-client="ca-pub-1415407386988961" data-ad-slot="4519372796" data-ad-format="auto" data-adsbygoogle-status="done" style="height: 600px;"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px;background-color:transparent"><ins id="aswift_0_anchor" style="display:block;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px;background-color:transparent"><iframe width="160" height="600" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;" src="./Online Chess - Level Advanced_files/saved_resource.html"></iframe></ins></ins>
  363. </ins>
  364. <script async="" src="./Online Chess - Level Advanced_files/adsbygoogle.js.ladda ned"></script>
  365. <script>
  366. (adsbygoogle = window.adsbygoogle || []).push({});
  367. </script>
  368.  
  369. <ins class="adsbygoogle side_ads right" data-ad-client="ca-pub-1415407386988961" data-ad-slot="4519372796" data-ad-format="auto" data-adsbygoogle-status="done" style="height: 600px;"><ins id="aswift_1_expand" style="display:inline-table;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px;background-color:transparent"><ins id="aswift_1_anchor" style="display:block;border:none;height:600px;margin:0;padding:0;position:relative;visibility:visible;width:160px;background-color:transparent"><iframe width="160" height="600" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" onload="var i=this.id,s=window.google_iframe_oncopy,H=s&amp;&amp;s.handlers,h=H&amp;&amp;H[i],w=this.contentWindow,d;try{d=w.document}catch(e){}if(h&amp;&amp;d&amp;&amp;(!d.body||!d.body.firstChild)){if(h.call){setTimeout(h,0)}else if(h.match){try{h=s.upd(h,i)}catch(e){}w.location.replace(h)}}" id="aswift_1" name="aswift_1" style="left:0;position:absolute;top:0;" src="./Online Chess - Level Advanced_files/saved_resource(1).html"></iframe></ins></ins>
  370. </ins>
  371. <script async="" src="./Online Chess - Level Advanced_files/adsbygoogle.js.ladda ned"></script>
  372. <script>
  373. (adsbygoogle = window.adsbygoogle || []).push({});
  374. </script>
  375. </body>
  376.  
  377. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement