Tetris

xiaoxiao2021-03-06  85

Russia </ title> <style> <! - body {}. MB {background-color: firebrick; cursor: default; height: 22px; width: 22px} .sb {background -COLOR: slategray; CURSOR: default; HEIGHT: 22px; WIDTH: 22px} .BK {BACKGROUND-COLOR: white; CURSOR: default; HEIGHT: 22px; WIDTH: 22px} .GT {BORDER-BOTTOM: deepskyblue thin solid; BORDER -Left: DeepskyBlue Thin Solid; Border-Right: DeepskyBlue Thin Solid; Border-Top: DeepskyBlue Thin Solid; Cursor: Default} -> </ style> <script> <! - var bx = new array (4); Var by = new array (4); var px = new array (4); var py = new array (4); var Mtimervar Firstview</p> <p>Function begingame () {gameState = 0; speed = 1; Outtime = 1100-speed * 100; score = 0; if (GameState! = 0) Return; firstView = true; for (j = 0; j <16; j ) For (i = 0; i <10; i ) setClass (i, j, "bk"); randbar (); gamestate = 1; play.disabled = true; window.clearinterval (mtimer); mtimer = window.setInterval "Movebar ()", OUTTIME);</p> <p>Function KeyControl () {if (GameState! = 1) Return; switch (event.keycode) {case 37: {// Left for (i = 0; i <4; i ) IF (bx [i] == 0) Return; for (i = 0; i <4; i ) IF (GetClass (BX [i] -1, by [i]) == "Sb") Return; for (i = 0; i <4; i ) SetClass (BX [I], BY [I], "BK"); for (i = 0; I <4; i ) BX [i] = BX [i] -1; for (i = 0; i <4 i ) setClass (BX [i], by [i], "mb"); Break;} case 38: {// Up var prembarx = new array (4); var prembary = new array (4); var CX = Math.Round ((BX [0] BX [1] BX [2] BX [3]) / 4); var cy = math.Round ((by [0] by [1] by [ 2] by [3]) / 4); for (i = 0; i <4; i ) {prembarx [i] = math.Round (CX-CY by [i]); prembary [i] = math .Round (CX CY-BX [I]); IF (PrembarX [i] <0 || prembarx [i]> 9 || prembary [i] <0 || prembary [i]> 15) Return; IF GetClass (PrembaryX [I], Prembary [I]) == "SB") Return;} for (i = 0; i <4; i ) setClass (BX [i], by [i], "bk"); For (i = 0; i <4; i ) { BX [I] = prembarx [i]; by [i] = prembary [i];} for (i = 0; i <4; i ) setClass (BX [i], by [i], "mb"); Break;} case 39: {// Right for (i = 0; i <4; i ) IF (BX [i] == 9) Return; for (i = 0; i <4; i ) IF (getClass BX [i] 1, by [i]) == "SB") Return; for (i = 0; i <4; i ) setClass (BX [i], by [i], "bk"); for (i = 0; i <4;</p> <p>i ) BX [I] = BX [i] 1; for (i = 0; i <4; i ) setClass (BX [i], by [i], "mb"); Break;} case 40: { // Down Movebar (); Break;}}} Function Delline () {for (i = 0; i <4; i ) setClass (BX [I], BY [I], "SB"); for (j = 0; J <16; J ) {DLINE = true; for (i = 0; i <9; i ) {ix (getClass (i, j)! = "Sb") {DLINE = false; Break;}} IF (DLINE) {score = score 100; for (k = j; k> 0; k -) for (l = 0; l <10; l ) setClass (L, K, GetClass (L, K-1) For (L = 0; L <10; L ) setClass (L, 0, "BK");}}}}}}}} randbar (); speed = Math.Floor (score / 3000) 1; Outtime = 1100-speed * 100; scorebar.innerhtml = "score:" score; speedbar.innerhtml = "speted:" speed; window.clearinterval; mtimer = window.setInterval ("Movebar ()", Outtime);}</p> <p>Function getClass (x, y) {return gamebar.children [y] .children [x] .classname;} Function setClass (x, y, cname) {gamebar.children [y] .children [x] .classname = cname; }</p> <p>Function movebar () {if (GameState! = 1) Return; Dropline = true; for (i = 0; i <4; i ) IF (by [i] == 15) Dropline = false; if (dropline) for i = 0; i <4; i ) IF (getClass (BX [i], by [i] 1) == "sb") Dropline = false; if (! dropline) {WINDOW.CLARINTERVALVAL (MTIMER); Delline ();}} For (i = 0; i <4; i ) setClass (BX [i], by [i], "bk"); for (i = 0; i <4; i ) by [i ] = By [i] 1; for (i = 0; i <4; i ) setClass (BX [i], by [i], "mb");} function pausegame () {if (GameState == 0 Return; if (event.srcelement.value == "pause") {GameState = 2; event.srcelement.value = "continue"; window.clearinterval (mtimer);} else {gamestate = 1; Event.Srcelement.Value = "Pause"; mtimer = window.setInterval ("MoveBar ()", Outtime);}}</p> <p>Function FMNU () {Return False;} Document.οncοnTextMenu = FMNU;</p> <p>Function preview () {if (previewBar.Style.Display! = "none") previewBar.Style.display = "none"; else previewBar.Style.Display = "block";}</p> <p>Function replayGame () {if (Gamestate! = 1) Return; if (! "")) Return; GameState = 0; window.clearinterval (mtimer); begingame ();} function Randbar () {randnum = math.floor (Math.random () * 20) 1; if (! firstview) for (i = 0; i <4; i ) {bx [i] = px [i]; by [i] = py [I];} switch (randnum) {case 1: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 4; PY [1] = 1; PX [2 ] = 5; PY [2] = 1; PX [3] = 6; py [3] = 1; Break;} case 2: {PX [0] = 4; py [0] = 0; PX ​​[1] = 5; PY [1] = 0; PX ​​[2] = 4; PX [2] = 1; PX [3] = 4; py [3] = 2; Break;} case 3: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; PX [1] = 0; PX ​​[2] = 6; PX [2] = 0; PX ​​[3] = 6; py [3] = 1 Break;} case 4: {PX [0] = 5; PY [0] = 0; PX ​​[1] = 5; Py [1] = 1; PX [2] = 5; PX [2] = 2; PX [3] = 4; py [3] = 2; Break;} case 5: {PX [0] = 6; py [0] = 0; PX ​​[1] = 6; PX [1] = 1; PX [2] = 4; PX [2] = 1; PX [3] = 5; py [3] = 1; Break; } Case 6: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 4; PX [1] = 1; PX [2] = 4; PY [2] = 2; PX [3 ] = 5; PY [3] = 2; Break;</p> <p>} Case 7: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 4; PX [1] = 1; PX [2] = 5; PX [2] = 0; PX ​​[3 ] = 6; PY [3] = 0; Break;} case 8: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; Py [1] = 0; PX ​​[2] = 5; PY [2] = 1; PX [3] = 5; Py [3] = 2; Break;} case 9: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; Py [1] = 0; PX ​​[2] = 5; PX [2] = 1; PX [3] = 6; py [3] = 1; Break;} case 10: {PX [0] = 5 Py [0] = 0; PX ​​[1] = 5; PX [1] = 1; PX [2] = 4; PX [2] = 1; PX [3] = 4; py [3] = 2; Break;} case 11: {PX [0] = 4; PX [0] = 1; PX [1] = 5; PX [1] = 1; PX [2] = 5; PY [2] = 0; PX [3] = 6; PY [3] = 0; Break;} case 12: { PX [0] = 4; PY [0] = 0; PX ​​[1] = 4; PX [1] = 1; PX [2] = 5; PX [2] = 1; PX [3] = 5; py [3] = 2; Break;} case 13: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; PX [1] = 0; PX ​​[2] = 6; PY [ 2] = 0; PX ​​[3] = 5; PY [3] = 1; Break;} case 14: {PX [0] = 4; Py [0] = 0; PX ​​[1] = 4; py [1 ] = 1; PX [2] = 4;</p> <p>Py [2] = 2; PX [3] = 5; Py [3] = 1; Break;} case 15: {PX [0] = 5; PY [0] = 0; PX ​​[1] = 5; PY [1] = 1; PX [2] = 4; PX [2] = 1; PX [3] = 6; PY [3] = 1; Break;} case 16: {PX [0] = 5; PY [ 0] = 0; PX ​​[1] = 5; PX [1] = 1; PX [2] = 5; PX [2] = 2; PX [3] = 4; py [3] = 1; Break;} Case 17: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; PY [1] = 0; PX ​​[2] = 4; PY [2] = 1; PX [3] = 5; PY [3] = 1; Break;} case 18: {PX [0] = 4; PY [0] = 0; PX ​​[1] = 5; PX [1] = 0; PX ​​[2] = 4; Py [2] = 1; PX [3] = 5; py [3] = 1; Break;} case 19: {PX [0] = 3; PY [0] = 0; PX ​​[1] = 4 ; Py [1] = 0; PX ​​[2] = 5; PY [2] = 0; PX [3] = 6; Py [3] = 0; Break;} case 20: {PX [0] = 5; PX [0] = 0; PX ​​[1] = 5; PY [1] = 1; PX [2] = 5; PY [2] = 2; PX [3] = 5; PY [3] = 3; Break;}} f (firstView) {FIRSTVIEW = false; randbar (); return;} for (i = 0; i <4; i ) {for (j = 0; j <4; j ) {previewBar.children [j] .children [i] .classname = "bk";}} for (i = 0; i <4; i </p> <p>) previewBar.children [py [i]]. Children [PX [i] -3] .ClassName = "MB"; for (i = 0; i <4; i ) {ix (GetClass (BX [i], by [i])! = "bk") {Alert ("Game over!"); window.clearinterval (mtimer); play.disabled = false; gamestate = 0; return;}} for (i = 0; i <4 i ) setClass (BX [i], by [i], "mb");} // -> </ script> </ head> <body bgcolor = black οnkeydοwn = "Return KeyControl ();> <> <> < Center> <p> <b> <font color = red> Russian square </ font> </ b> </ p> <Table cellspacing = 0 cellpadding = 0 class = gt border = 1 bordercolor = "Lightyellow" style = " Position: Absolute; Left: 220px; Top: 53px;> <TBODY ID = GameBar> <TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> < / TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> <TD Class = BK> </ TD> <TD Class = BK> < / TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> </ TD> <TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ TR> <Tr> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> < / TD> <</p> <p>TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> < / TR> <TR> <TD class = BK> </ TD> <TD class = BK> </ TD> <TD class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = BK> </ td> </ tr> <tr> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> < / TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> <TD Class = BK> </ TD> <TD Class = BK> < / TD> <TD class = BK> </ td> </ tr> <tr> <td class = bk> </ td> <td class = BK> </ td> <td class = BK> </ td> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> </ Tr> <TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> </ TR> <Tr> <TD Class = BK> </ TD> <TD Class = BK> </ td> <</p> <p>TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> < TD class = BK> </ td> <td class = bk> </ td> <td class = BK> </ td> </ tr> <tr> <td class = bk> </ td> <td class = BK> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = BK> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> </ tr> <tr> <td class = bk> < / TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> <TD> <TD Class = BK> </ TD> <TD Class = BK> < / TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ TR> <TR> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ tr> <tr> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK></p> <p></ td> </ tr> <tr> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = BK> </ td > <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD > <TD Class = BK> </ TD> </ Tr> <Tr> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD class = BK> </ td> </ tr> <tr> <td class = bk> </ td> <td class = bk> </ td> <td class = bk > </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk > </ td> <td class = bk> </ td> <td class = bk> </ td> </ tr> <tr> <td class = BK> </ td> <td class = bk> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ TR> </ TBODY> </ Table> </ center> <TABLE Style = "Position: absolute; top = 100px; left: 50px"> <tr> <td = scorebar style = "color: white"> score: 0 </ td> </ tr> <tr> <</p> <p>TD ID = SpeedBar Style = "Color: White"> Speed: 1 </ TD> </ TR> </ Table></p> <p><table cellspacing = 0 cellpadding = 0 class = gt border = 1 bordercolor = "Lightyellow" style = "Position: absolute; left: 570px; Top: 53px;"> <tbody id = previewbar> <tr> <td class = BK > </ td> <td class = bk> </ td> <td class = bk> </ td> <td class = bk> </ td> </ tr> <tr> <td class = bk> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ Tr> <TD> <TD Class = BK> </ TD> < TD class = BK> </ td> <td class = bk> </ td> <td class = BK> </ td> </ tr> <tr> <td class = bk> </ td> <td class = BK> </ TD> <TD Class = BK> </ TD> <TD Class = BK> </ TD> </ TR> </ TBODY> </ Table> <Table Style = "Position: Absolute; Left: 570px ; TOP: 180px; "> <tr> <TD> <input type = button id =" play "style =" width: 100px "value =" play "οnclick =" Return Begingame (); "> </ td> < / TR> <TR> <TD> <input type = button id = "pause" style = "width: 100px" value = "pause" οnclick = "οnclick = Return PauseGame ();"> </ td> </ tr> < Tr> <TD> <input type = button id = "preview" style = "width: 100px" value = "preview" οnclick = "preview ();"> </ td> </ tr> <tr> <td> <Input Type = Button ID = "Replay" style = "Width: 100px" value = "replay" οnclick = "replayGame (); "> </ td> </ tr> <tr> <</p> <p>TD> <input type = button id = "quit" style = "width: 100px" value = "quit" οnclick = "Window.close ();"> </ td> </ tr> </ table> <div style = "Position: absolute; left: 590px; Top: 390px; color: white; font-size: 9pt"> If there is a problem, please contact me <a href="mailto: Sor@263.net"> <font color = White > Contact </ font> </a> </ div> </ body> </ html> <script> function unsel () {document.execcommand ("unselect"); Window.SetTimeout ("unsel ()", 10 ); unsel (); window.οnunlοad = rel; function rel () {location.Reload (); return false;}</p> <p></ script></p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-101268.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="101268" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.045</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'yENy_2BS6Tk5pe3LubcvOOZ8m0XthAqMGUPSGuBwF_2BUD3YGK6mwuCbqvJ4qQIScPln_2Bgpu9G4p9y21bOhsswoNuw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>