60行js代码达成俄罗丝方块_javascript本领_脚本之家

2019-12-05 22:20栏目:竞技宝竞猜
TAG:

这是我之前网上看到的,很牛逼的一位大神写的,一直膜拜中

var map=eval.join;var tatris=[[0x6600],[0x2222,0xf00],[0xc600,0x2640],[0x6c00,0x4620],[0x4460,0x2e0,0x6220,0x740],[0x2260,0xe20,0x6440,0x4700],[0x2620,0x720,0x2320,0x2700]];var keycom={"38":"rotate","37":"move","39":"move"};var dia, pos, bak, run;function start(){ dia=tatris[~~]; bak=pos={fk:[],y:0,x:4,s:~~}; rotate{ document.onkeydown=null; clearInterval; alert;}function update{ bak={fk:pos.fk.slice,y:pos.y,x:pos.x,s:pos.s}; if return; for(var i=0,a2=""; i<22; i++) a2+=map[i].toString+"<br/>"; for if/.test.replace a2=a2.substr*15-RegExp.$_.length-4)+RegExp.$1+a2.slice; document.getElementById.innerHTML=a2.replace.replace;}function is(){ for if((pos.fk[i]&map[pos.y+i])!=0) return pos=bak;}function rotate{ var f=dia[pos.s=%dia.length]; for pos.fk[i]=<<pos.x; update;}function down{ for(var i=0; i<4 && pos.y+i<22; i++) if((map[pos.y+i]|=pos.fk[i])==0xfff) map.splice, map.unshift; if return over; } update{ pos.x+=k; for pos.fk[i]*=t; update;}document.onkeydown=function{ eval(keycom[.keyCode]);};start();run=setInterval;

以上所述就是本文的全部内容,希望大家能够喜欢。

版权声明:本文由龙竞技官网发布于竞技宝竞猜,转载请注明出处:60行js代码达成俄罗丝方块_javascript本领_脚本之家