10 lines
No EOL
30 KiB
HTML
10 lines
No EOL
30 KiB
HTML
|
|
<html>
|
|
|
|
<head>
|
|
<title>Nintendo DS Browser Games</title>
|
|
<meta name="viewport" content="width=device-width" />
|
|
|
|
|
|
<style type="text/css" media="screen,handheld">body,#c{overflow:hidden}body,#n{font-size:17px}#c,#d,#e{font-size:11px}#a,#n,#q,.c div{font-weight:bold}a,#c{color:#fff}#a,#b,#c,#s,#s *,#g,#g *,#d,#e,#h,#i,#j{position:absolute}#a{top:10px;left:270px;padding-bottom:10px;border-bottom:1px solid}#b{top:190px;left:0px;width:256px;padding:5px}#c{top:0;left:0;width:256px;height:176px}#p a{display:block;width:100px;padding:4px;margin:3px;background:#555}#o,#p{display:none}#s{top:3px;left:183px}#g{top:6px;left:3px;width:164px;height:164px;border:2px inset #aaa}#f{top:13px;left:13px;width:34px;height:34px;background:#000 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAABmCAMAAACZULOKAAAAB3RJTUUH1wYRCiI6yCNZKQAAAC1QTFRFBAMASDoBdGkmkHQDrJEZy64m9NQ2%2BeVg%2FfaQyrpQqaJbgn1Cf3tFvb2S%2Fv7jK36hQQAAAAlwSFlzAAAewQAAHsEBw2lUUwAAAcZJREFUSMftlstuxCAMRWMDARuY%2F%2F%2FcBodXgESqumgr5a4ycMa2DFx5274nACUCuAOUJicirWAJkPtUOZohZTpAIDNAij6jhkDKfhYi9Rgjx6mVjnW0erAEEcLFfjemNWdzOSp14%2BNC4EZwCMeiteZMpaVdx2KIruj4QQmxKleS5M%2FV3N7gPSfCGih57hElxdZEDfEF2TskhuBrKe5ArCBSjC7%2FZNsQy3QSVsMG2t2oIiXRDdHX8oicJfAkIQSB1heRLxJEWgftAHpAkH3XsNVMNACeErGfx5jD%2BEFdkHJKdAFQghhV34ek4p7gM0294KDtJQ7mQnT3BDJjiVMoJjsRkuuqS5bCmCtgFs%2F6gPZHQCBUWhujtUJ4tBiA7Wd6XWpwqXij6lJ823LINxOfGn66FB79XGLHIyBsLlVzeV%2B%2BcHSpHAcqjbMzWEZElteSPqybXeregv6iS8XxDHl2qRUyuNR0oWaXGjLFlUstgkwu1cWJdy5VIX50qRj5dal3lnpnqV%2BdpfqNjuhdSgr2ZRKi8uZ6l3Ky30albHW9S%2FE4S%2FHkUj5cRynEyaX8SPjJpYZpC5Fml7LcA5qWLpVHqTRM7f%2FXpb4AMapR0XityTcAAAAASUVORK5CYII%3D') no-repeat 0 0}#n{top:66px;left:19px;width:120px;height:28px;line-height:28px;border:none}#n,#q,.c div,.e,.f{text-align:center}#q{top:30px;left:19px;width:120px}#q *{position:relative}#d,#e{left:179px;width:65px;padding:0 2px}#d{top:70px}#e{top:150px}#h,#i,#j{left:178px;width:67px}#h{top:95px}#i{top:112px}#j{top:129px}#c,#m1,#m2,#m3,#m4,#m5,#m6,#n{background:#000}#m1{top:19px;left:63px;width:17px;height:16px}#m2{top:35px;left:70px;width:3px;height:21px}#m3,#m4{top:39px;width:15px;height:11px}#m3{left:55px}#m4{left:73px}#m5,#m6{top:54px;width:16px;height:16px}#m5{left:55px}#m6{left:72px}.a{float:right;text-align:right;width:33px;padding:0 1px 0 0;border:1px inset #aaa}.b div{border:1px outset #aaa}.c div{border:1px solid;width:16px;height:16px;background:#bbb url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAA0CAIAAAGp%2BxXYAAAAB3RJTUUH2AUTFCI6wmTX3QAAAAlwSFlzAAAewQAAHsEBw2lUUwAAAOJJREFUSMflVUkSAyEI7Kf30%2FgZOWAcNkuTmaocwkVBZG0UIiIiKAsAtwwhAyciUNMi6e7EM3H0LUMUa%2FsdmxsASI7dCHnQJQs3gl%2BdBUj0mJQAgTsWfEI7aWNhljrnbrwmPMwz1m4vXf1GZNHTJ2A8a1WwFwXgfBJX6ANJh8E3OLPWzbRn964B9sVA3915fsEgNbxH0Sle%2F0HPapqQt9RjhONu3p%2FUMxzaO%2F5EXZKlfpi8U7Svnmmoqp%2BQpV6apBt%2BT%2FM4qosfLE9afzW%2BwVKntPHLBbRQvRiuUiS9lxrJab4vQkAWXT74wH0AAAAASUVORK5CYII%3D') no-repeat 0 0}.d{background:#000 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABQCAMAAACNtsODAAAAB3RJTUUH1wYCADYRBQoKmwAAADBQTFRF%2Fv7%2Bq6ur5%2BfnAAAAysrK2dnZVVVVMzMzJiYmGxsbRUVFhISEubm5eXl5lZWVaGhomRcB1gAAAAlwSFlzAAAewQAAHsEBw2lUUwAAAaNJREFUWMPt1912gyAMAOCAhh8R%2B%2F5vu5RaB60JDHq2XZgr7IHv0AQBYToPhObANAAuqBvalNKg1Xvo5%2FDjQYYoZphPfrW7pG3q0g8V0hCUS2NQJg1C35IehA4JRqFCGoJyqQJFRX1UbJBEiLphjBEf606WJMhqNKlhZqhKAkSO35t%2Brs5JgBS4o%2B1BVfIkQDofu4mFFaFbNqH7lG69UASfP0L8c8gUJbdgeqEy2ao%2F2VQom01o64cc4lOyiK4fIglW6723CiSnYat122P5601y2vZss8FmJjna9uwFlumCZChC%2BARk7p1mMwoRo1dYdYWqQQsxwVOOfECRkiFiMPg92YlaeqDEuKxqEsVDy0p%2Fyr2U37EUB%2BVMsY5c0LAuzVDImZcF6YkKrZAJTljZPpjrpf33kEf5BGmFHGqDNakBIsfeD0o3CCVnqkpVyON%2Bc5RP7Cp0OOle2n%2F2Z05xw%2F0pVDiUJ0ESoRdHlCTozZEkATpxBImHTh1eYiHGYWvHQazDSQwkOIzEzchY4XVwpndja4gLuqBPQ2okHp9QqQlX%2FF58AfXhPWoZ9MqOAAAAAElFTkSuQmCC') no-repeat 44px 5px}.e{top:90px;border-bottom:2px solid #fff;height:12px;width:8px}.f{width:13px;background:#555}.g div{width:7px;height:7px}.h div{width:9px;height:9px}.i div{width:19px;height:19px;background:#263 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAA5CAMAAAGUvtA4AAAAB3RJTUUH2AUTFiguIdU%2FRAAAADlQTFRFIWMxUoxje6WEhK2M5%2B%2Fn%2F%2F%2F%2FKWs5tc69vc69IWsxjK2Uc6WEGEopEEIhEDkYAAgAAAAACCEQEDEYSRl9wQAAAAlwSFlzAAALEwAACxMBAJqcGAAAANRJREFUOMvdUtkSgyAMjJQUDxDt%2F39szQEGq2Of%2BtAdZZacGw2AxZLkxY0jQutb6AH%2F4SAkiaAA4Yjo%2BYRbUHziVCkgXOt45IPqoFT7quYNVuq0Fs2q21ATYIGoGpRhESfTysXD7xBTLD9HhdcZorIIs7KXsYGZtZItaY7HFm6bzREJPGbYhxcfsn9ng7IBoGfSN1X%2BEynzR8yp3TCF7lFeLDLo2lukC9tZ7mmPUy1X6Jxznbk%2FQ1lrDE8xTWgxcRa2oArjwTZexNU9Kdty1Vf1Paq%2BN1kkEcjX4CC0AAAAAElFTkSuQmCC') no-repeat 0 0}</style><script>var b=new Array(new Array(65535,64575,63519,61839,58311,58311,58311,58311,58311,58311,58311,58311,61839,63519,64575,65535),new Array(0,28662,28662,28662,28662,28662,28662,28662,24582,32766,24582,24678,24678,24678,24676,1),new Array(0,32766,30750,26606,32758,32762,32762,32762,32762,32762,25594,28662,28654,28702,32766,0),new Array(65535,65535,65535,65535,65408,227,6599,40079,36383,53055,65343,58383,65535,65535,65535,65535),new Array(65535,65535,64639,64639,65087,65087,65311,65311,65423,58255,49607,49607,49635,58339,65535,65535),new Array(6,9,9,6),new Array(15,9,9,15),new Array(6,4,2,6),new Array(15,15,15,15),new Array(21,10,21,10,21),new Array(0,14,0,14,0),new Array(14,12,10,6,14),new Array(31,17,17,17,31),new Array(31,31,31,31,31),new Array(24,27,7,14,13),new Array(21,42,21,42,21,42),new Array(30,28,26,22,14,30),new Array(0,31,16,18,30,0),new Array(51,33,0,51,51,51),new Array(63,12,0,0,33,51),new Array(63,51,45,33,45,45),new Array(63,33,33,33,33,63),new Array(63,51,33,33,51,63),new Array(28,54,34,34,34,54,28)),c=new Array("#640000","#006400","#006464","#000064","#640064","#646400"),d=new Array("acrimonious","agnostic","allegiance","almighty","ameliorate","amplify","angular","annihilate","antiseptic","aqueduct","aqueous","archaic","articulate","audit","authoritative","authority","balance","bamboozle","benefactor","blatant","bogus","boisterous","boomerang","brawn","breakthrough","breeze","brevity","bystander","candle","career","cat","cataclysm","caviar","cavort","ceiling","celluloid","censorious","chair","charity","chivalrous","chopstick","chrysalis","cinch","clientele","clown","cohort","collarbone","comb","commendable","compendium","complex","comprehensive","conclusive","conifer","conscientious","consider","considerate","consumer","copse","craft","cranberry","craving","crystal","cycle","deferential","democrat","denouement","determinate","dictaphone","diffidence","disruption","dog","earth","ecstasy","elliptical","encrust","enormity","entanglement","errand","escalator","escutcheon","ethereal","expect","extinguish","extradition","faint","fastidious","fickle","final","flamboyant","forethought","forthright","fortunate","fuchsia","gem","giraffe","glimmer","gnarly","gorgon","gown","gregarious","gristle","gymnast","handmaiden","hangman","heinous","honeysuckle","hourse","hypocritical","illustrious","inert","infallible","inset","insipid","invoke","jailbait","jeopardy","jewellery","jinx","job","jocund","limited","lizard","lumberjack","machine","magnet","magnitude","marvellous","mischievous","mississippi","mitre","mollycoddle","monkey","motif","mouse","mud","mummify","nautical","navy","nicotine","nimbleness","nonplussed","nuisance","oblique","obliterate","obsequious","obstreperous","obviate","ochre","ocular","opalescent","origami","ostensible","outrun","oxymoron","pandemonium","paraphernalia","parsimony","paste","pawnbroker","pedestrian","pendulous","peremptory","perfunctory","pernicious","perpetrate","personable","phlegm","phone","pickpocket","pillow","pitchfork","placebo","plural","poltergeist","porpoise","preamble","precarious","precipitous","preclude","predicament","preposterous","presumptuous","prevaricate","printing","propensity","provisional","psychotic","pugnacious","pyre","question","rabbit","ramshackle","rattlesnake","reciprocate","recrimination","redoubtable","relegate","relinquish","remonstrate","repository","reprehensible","resolution","resplendent","restitution","retaliation","retribution","revision","rhetoric","rhythm","saccharine","salubrious","segue","skulduggery","skyscraper","slaughter","soothsayer","spangle","stamp","suburb","supreme","suspect","sympathy","tearjerker","think","tiny","transcribe","triumph","turbine","turpentine","turquoise","twelve","twitch","unassuming","underscore","undertaker","underwrite","unobtrusive","urban","vernacular","viaduct","vitality","vitriol","wally","waterfront","watertight","whistle","winceyette","windpipe","womb","wonder","workhorse","worthwhile","wriggle","wrought","yet","yummy","zany","zoom"),e=new Array("blue","green","red","navy","maroon","teal","purple","#000"),f=new Array("blue","orange","red","cyan","green","magenta","yellow"),g=new Array(new Array(28928,4400,18176,12832),new Array(29696,12560,5888,8752),new Array(61440,4369,61440,4369),new Array(9984,8992,29184,4880),new Array(25344,4896,25344,4896),new Array(13824,8976,13824,8976),new Array(13056,13056,13056,13056)),h,i,j,k,l,m,n,o,p,q=15,r,s,t,u,v,w,x,y,z,_a,_b,_c,_d,_e,_f=3,_g=1,_h,_i,_j,_k,a=1,_n,_o,_l,_m;Element.prototype.A=function(a,b,c){var d="",e=this.ownerDocument.createElement(a);if(b)for(d in b)e[d]=b[d];if(c)e.appendChild(this.ownerDocument.createTextNode(c));this.appendChild(e);return e};Element.prototype.B=function(){while(this.firstChild)this.removeChild(this.firstChild);return this};function G(p){if(p>0&&h>0)return;h=p;document.getElementById("p").style.display=(p==0?"block":"none");document.getElementById("d").style.display=(p==1||p==2||p==3||p==6?"block":"none");document.getElementById("e").style.display=(p==1||p==2||p==3||p==6?"block":"none");document.getElementById("h").style.display=(p==1||p==2||p==4||p==5||p==6?"block":"none");document.getElementById("i").style.display=(p==1||p==2||p==4||p==5||p==6?"block":"none");document.getElementById("j").style.display=(p==1||p==2?"block":"none");switch(p){case -1:var b=document.getElementById("g").A("div",{id:"q"});b.A("p",null,"Nintendo DS Browser Games");b.A("p").A("a",{href:"http://my.opera.com/rkm/"},"by rkm");b.A("p").A("a",{href:"javascript:G(0)"},"Click here to start");b=b.A("div");b.style.top="200px";b.A("div",{className:"c"}).A("div");b.A("div",{className:"d"});b.A("div",{className:"i"}).A("div");D(0);break;case 0:document.getElementById("a").innerText="Nintendo DS Browser Games";document.getElementById("b").innerText="";break;case 1:H();break;case 2:M();break;case 3:S();break;case 4:U();break;case 5:W();break;case 6:_A();break}document.getElementById("o").style.display=(p==0?"none":"block");if(p==2){window.addEventListener("keydown",Q,false);window.addEventListener("keyup",R,false)}else{window.removeEventListener("keydown",Q,false);window.removeEventListener("keyup",R,false)}if(p==4||p==5) window.addEventListener("keypress",F,false);else window.removeEventListener("keypress",F,false)}function C(){var i,b,c,e;switch(h){case 1:document.getElementById("s").className="b";m=0;I();break;case 2:q=parseInt(prompt("Please enter the number of mines you want.(10-80)",q),10);if(isNaN(q))q=15;else if(q<10)q=10;else if(q>80)q=80;r=q;s=0;t=100;document.getElementById("k").innerText=r;document.getElementById("l").innerText=t;document.getElementById("m").innerText=0;l=new Array();k=new Array();document.getElementById("g").style.display="none";for(b=0;b<10;b++)for(i=0;i<10;i++){e=document.getElementById("g"+b.toString(11)+i.toString(11));e.B();e.style.borderColor="#fff #000 #000 #fff";e.style.backgroundPosition="0px 0px";l[i+b*10]=0}document.getElementById("g").style.display="block";D(0);u=-1;if(window.v)clearTimeout(v);_m=false;break;case 3:x=d[Math.floor(Math.random()*d.length)].toUpperCase();s=0;w=0;for(i=1;i<7;i++)document.getElementById("m"+i).style.display="block";c=document.getElementById("t");c.B();for(i=0;i<x.length;i++){e=c.A("div",{className:"e"});e.innerHTML=" ";e.style.left=((i*10)+80-x.length*5)+"px"}c=document.getElementById("r");for(i=0;i<c.childNodes.length;i++)c.childNodes[i].style.display="block";y="";D(0);_m=false;break;case 4:_f=parseInt(prompt("Please choose the level of difficulty.(1-5)",_f),10);if(isNaN(_f))_f=1;else if(_f<1)_f=1;else if(_f>10)_f=5;_h=_f-(_f>5?5:0);_d=0;document.getElementById("k").innerText=_f;document.getElementById("l").innerText=_d;l=new Array(200,201,202);c=document.getElementById("g");c.style.display="none";for(i=0;i<c.childNodes.length;i++)c.childNodes[i].style.background="#111";document.getElementById("ga0").style.background="#ddd";document.getElementById("ga1").style.background="#ddd";document.getElementById("ga2").style.background="#ddd";E(false);c.style.display="block";document.getElementById("d").style.display="none";document.getElementById("e").style.display="none";_a=10;_b=2;_c=39;j=0;_l=new Array();D(0);V();break;case 5:_g=parseInt(prompt("Please choose the initial speed.(1-50)",_g),10);if(isNaN(_g))_g=1;else if(_g<1)_g=1;else if(_g>50)_g=50;_h=_g;_d=0;_k=0;u=0;document.getElementById("k").innerText=_d;document.getElementById("l").innerText=_h;c=document.getElementById("g");c.style.display="none";for(i=0;i<c.childNodes.length;i++)c.childNodes[i].style.background="#111";E(false);c.style.display="block";c=document.getElementById("s");c.B();c.className="h";for(b=0;b<4;b++)for(i=0;i<4;i++){e=c.A("div",{id:"s"+(b*4+i).toString(16)});e.style.top=(b*10+10)+"px";e.style.left=(i*10+10)+"px"}document.getElementById("d").style.display="none";document.getElementById("e").style.display="none";_j=Math.floor(Math.random()*7);k=new Array();l=new Array();for(i=0;i<23;i++)l[i]=4097;l[23]=8191;Z();_l=new Array();X();break;case 6:a=parseInt(prompt("Do you want to play black(1), white(2), both(3), none(4)?",a),10);if(isNaN(a))a=1;else if(a<1||a>8)a=1;o=0;_d=new Array(2,2);document.getElementById("k").innerText=_d[0];document.getElementById("l").innerText=_d[1];document.getElementById("g").style.display="none";k=new Array();_o=new Array();for(i=0;i<100;i++){k[i]=(i==44||i==55?(a<5?1:0):(i==45||i==54?(a<5?0:1):-1));_o[i]=(i==44||i==45||i==54||i==55?5:(i==34||i==35||i==43||i==46||i==53||i==56||i==64||i==65?6:(i==33||i==36||i==63||i==66?7:8)));if(i>10&&i<89)if(i%10!=0&&i%10!=9)document.getElementById("g"+i).style.backgroundPosition="0px "+(-19*(1+k[i]))+"px"}_n=_D();document.getElementById("g").style.display="block";D(0);if(window.v)clearTimeout(v);_m=false;if(a%2==0)_E();break}}function D(e){var a=document.getElementById("f");if(a==null){a=document.getElementById("s").B().A("div",{id:"f"});a.parentNode.className=""}a.style.backgroundPosition="0px "+(-34*e)+"px"}function E(b){if(b)document.getElementById("g").A("div",{id:"n"},"GAME OVER");else{var a=document.getElementById("n");if(a)document.getElementById("g").removeChild(a)}}function F(e){_l.push(e.keyCode)}function H(){document.getElementById("a").innerText="Panel Puzzle";document.getElementById("b").innerText="Match the large picture to the small picture. Click on a panel to invert it and its the surrounding panels.";document.getElementById("h").firstChild.innerText="Turns";document.getElementById("i").firstChild.innerText="Level";document.getElementById("j").firstChild.innerText="Lives";document.getElementById("g").className="b";C()}function I(){var a,d,v,e,f,g,w,r,s,t,u;n=3;p=new Array();m++;if(m%100==0){j=5+m/100;k=b[(m/100)%5];i=k.length}else{if(m<3)k=b[8];else{e=Math.floor(Math.random()*10000);if(e<4000)k=b[5+(e%4)];else if(e<7000)k=b[9+(e%(m>200?6:5))];else if(e<9600)k=b[15+(e%8)];else k=b[23]}i=k.length;if(m<4)j=1;else if(m<7)j=2;else if(m>500&&i>4)j=Math.floor(Math.random()*5)+1;else if(m>100&&i>4)j=Math.floor(Math.random()*4)+1;else j=Math.floor(Math.random()*3)+1}o=(j>5?c[0]:c[j]);document.getElementById("k").innerText=j;document.getElementById("l").innerText=m;document.getElementById("m").innerText=3;r=j;s=i*i;l=new Array();for(v=0;v<i;v++)l[v]=k[v];for(v=0;v<2;v++){w=(v==0?"s":"g");t=Math.round((v==0?60:160)/i);g=document.getElementById(w);g.B();for(d=0;d<i;d++)for(a=0;a<i;a++){f=g.A("div",{id:w+d.toString(16)+a.toString(16)});f.style.top=(d*t)+"px";f.style.left=(a*t)+"px";f.style.width=t+"px";f.style.height=t+"px";if(v==1){f.addEventListener("click",function(){J(this)},false);if(Math.random()<r/s){K(d,a,false);r--}s--}}u=(v==0?k:l);for(d=0;d<i;d++)for(a=0;a<i;a++)document.getElementById(w+d.toString(16)+a.toString(16)).style.backgroundColor=((u[d]&Math.pow(2,a))>0?"#fff":o)}_m=false}function J(a){var d,e,f,g=true;if(_m)return;_m=true;p.push(a);e=parseInt(a.id.substring(1,2),16);d=parseInt(a.id.substring(2,3),16);K(e,d,true);j--;document.getElementById("k").innerText=j;for(f=0;f<i;f++)if(l[f]!=k[f]){g=false;break}if(g)window.setTimeout(I,500);else if(j==0)window.setTimeout(function(){L(0)},500);else window.setTimeout(function(){_m=false},250)}function K(a,d,e){var f,g,q,r=Math.max(0,a-1),s=Math.min(i-1,a+1),t=Math.max(0,d-1),u=Math.min(i-1,d+1);q=(1+(d>0?.5:0)+(d<i-1?2:0))*Math.pow(2,d);for(g=r;g<=s;g++){l[g]=l[g]^q;if(e)for(f=t;f<=u;f++)document.getElementById("g"+g.toString(16)+f.toString(16)).style.backgroundColor=((l[g]&Math.pow(2,f))>0?"#fff":o)}}function L(a){var d,e,f,g;if(a<6){for(e=0;e<i;e++){g=k[e]^l[e];for(d=0;d<i;d++)if((g&Math.pow(2,d))>0){f=document.getElementById("g"+e.toString(16)+d.toString(16));switch(a%2){case 0:f.style.backgroundColor="red";break;case 1:f.style.backgroundColor=((l[e]&Math.pow(2,d))>0?"#fff":o);break}}}window.setTimeout(function(){L(a+1)},200)}else if(p.length>0){if(n>1){f=p.pop();f.className=(f.className=="x"?"":"x");e=parseInt(f.id.substring(1,2),16);d=parseInt(f.id.substring(2,3),16);K(e,d,true);j++;document.getElementById("k").innerText=j;window.setTimeout(function(){L(a+1)},400)}else{document.getElementById("m").innerText=0;E(true);D(2)}}else{n--;document.getElementById("m").innerText=n;_m=false}}function M(){var i,j,c=document.getElementById("g"),b;document.getElementById("a").innerText="Minesweeper";document.getElementById("b").innerText="Find all the mines as quickly as possible without uncovering any of them. Uncover a square by clicking it. If you uncover a mine, you lose the game. If a number appears on a square, it indicates how many mines are in the eight squares that surround the numbered one. To mark a square you suspect contains a mine, hold the UP key and click on it. If you are uncertain about a square, hold the UP key and click on it twice to mark it with a question mark.";document.getElementById("h").firstChild.innerText="Mines";document.getElementById("i").firstChild.innerText="Unkn.";document.getElementById("j").firstChild.innerText="Time";c.B();c.className="c";for(j=0;j<10;j++)for(i=0;i<10;i++){b=c.A("div",{id:"g"+j.toString(11)+i.toString(11)});b.style.top=(j*16)+"px";b.style.left=(i*16)+"px";b.addEventListener("click",function(){N(this)},false)}C()}function N(b){if(_m)return;var c=parseInt(b.id.substring(1,2),11),d=parseInt(b.id.substring(2,3),11),f=c*10+d,g,m,n;if(k[f]<0)return;if(z){switch(l[f]){case 0:b.style.backgroundPosition="0px -13px";r--;t--;break;case 1:b.style.color="#000";b.style.backgroundPosition="0px 0px";b.innerText="?";r++;t++;break;case 2:b.B();break}l[f]=(l[f]+1)%3}else{if(s==0){var minesleft=q;n=0;for(m=0;m<10;m++)for(g=0;g<10;g++){if(!(g==d&&m==c)&&Math.random()<minesleft/(99-n)){k[n]=1;minesleft--}else k[n]=0;n++}P()}switch(k[f]){case 0:O(c,d);if(s+q==100){_m=true;n=0;for(m=0;m<10;m++)for(g=0;g<10;g++){if(k[n]==1&&l[n]!=1){b=document.getElementById("g"+m.toString(11)+g.toString(11));b.style.backgroundPosition="0px -13px"}n++}r=0;t=0;D(1)}break;case 1:_m=true;n=0;for(m=0;m<10;m++)for(g=0;g<10;g++){if((k[n]==1&&l[n]!=1)||(k[n]==0&&l[n]==1)){b=document.getElementById("g"+m.toString(11)+g.toString(11));b.style.borderColor="gray lightgray lightgray gray";b.style.backgroundPosition="0px "+(-13*(3-k[n]))+"px";if(k[n]==0){r++;t++}}n++}D(2);break}}document.getElementById("k").innerText=r;document.getElementById("l").innerText=t}function O(c,d){var f,g,n;if(c<0||c>9||d<0||d>9)return;g=c*10+d;if(k[g]<0||l[g]==1)return;f=document.getElementById("g"+c.toString(11)+d.toString(11));f.style.borderColor="gray lightgray lightgray gray";f.B();k[g]=-1;s++;t--;n=0;if(c>0){if(d>0)if(k[g-11]==1)n++;if(k[g-10]==1)n++;if(d<9)if(k[g-9]==1)n++}if(d>0)if(k[g-1]==1)n++;if(d<9)if(k[g+1]==1)n++;if(c<9){if(d>0)if(k[g+9]==1)n++;if(k[g+10]==1)n++;if(d<9)if(k[g+11]==1)n++}if(n>0){f.style.color=e[n-1];f.innerText=n}else{O(c-1,d-1);O(c-1,d);O(c-1,d+1);O(c,d-1);O(c,d+1);O(c+1,d-1);O(c+1,d);O(c+1,d+1)}}function P(){if(h!=2||_m)return;u++;document.getElementById("m").innerText=u;v=window.setTimeout(P,1000)}function Q(e){if(e.keyCode==38) z=!z}function R(e){z=false}function S(){var i,c=document.getElementById("g"),b;document.getElementById("a").innerText="Hang Man";document.getElementById("b").innerText="Guess the word before the man is hung. Click on a letter to guess that letter";c.B();c.className="d";for(i=1;i<7;i++)c.A("div",{id:"m"+i});c.A("div",{id:"t"});c=c.A("div",{id:"r"});for(i=0;i<26;i++){b=c.A("div",{className:"f"},String.fromCharCode(65+i));b.style.top=(110+Math.floor(i/9)*15)+"px";b.style.left=((i%9)*15+13)+"px";b.addEventListener("click",function(){T(this)},false)}C()}function T(b){var i,d=b.innerHTML;if(_m)return;if(y.indexOf(d)>-1)return;y+=d;if(x.indexOf(d)>-1){for(i=0;i<x.length;i++)if(x.charAt(i)==d){document.getElementById("t").childNodes[i].innerText=d;s++}if(s==x.length){_m=true;D(1)}}else{w++;document.getElementById("m"+w).style.display="none";if(w==6){_m=true;for(i=0;i<x.length;i++)document.getElementById("t").childNodes[i].innerText=x.charAt(i);D(2)}}b.style.display="none"}function U(){var i,b,c=document.getElementById("g"),a;document.getElementById("a").innerText="Snake";document.getElementById("b").innerText="Use the direction pad to control the snake. Eat the apple (red block) to gain points, but watch out for the walls and yourself.";document.getElementById("h").firstChild.innerText="Level";document.getElementById("i").firstChild.innerText="Score";c.B();c.className="g";for(b=0;b<20;b++)for(i=0;i<20;i++){a=c.A("div",{id:"g"+b.toString(20)+i.toString(20)});a.style.top=(b*8)+"px";a.style.left=(i*8)+"px"}C()}function V(){var i,a,b=false;while(_l.length>0){a=_l.shift();if((Math.abs(_c-a)%2)==1){_c=a;break}}switch(_c){case 37:_b--;b=(_b<0);break;case 38:_a--;b=(_a<0);break;case 39:_b++;b=(_b>19);break;case 40:_a++;b=(_a>19);break}if(_f>5&&b){b=false;_b=(_b+20)%20;_a=(_a+20)%20}if(!b){a=_a*20+_b;for(i=0;i<l.length;i++)if(a==l[i]){b=true;break}}if(b){E(true);D(2);document.getElementById("d").style.display="block";document.getElementById("e").style.display="block"}else{document.getElementById("g"+(a<20?"0":"")+a.toString(20)).style.background="#ddd";l.push(a);j--;if(j>0&&a==_e){_d+=Math.ceil(j/8)*_h;document.getElementById("l").innerText=_d;j=0}else{if(j==0&&a!=_e)document.getElementById("g"+(_e<20?"0":"")+_e.toString(20)).style.background="#111";else if(j<-10){j=40;do{a=Math.floor(Math.random()*400);b=false;for(i=0;i<l.length;i++)if(a==l[i]){b=true;break}}while(b);_e=a;document.getElementById("g"+(a<20?"0":"")+a.toString(20)).style.background="red"}a=l.shift();document.getElementById("g"+(a<20?"0":"")+a.toString(20)).style.background="#111"}window.setTimeout(V,400-_h*40-(_h==5?20:0))}}function W(){var i,j,c=document.getElementById("g"),a;document.getElementById("a").innerText="Tetris";document.getElementById("b").innerText="Use the direction pad to move and rotate pieces. LEFT and RIGHT moves the piece sideways. UP rotates the piece, while DOWN moves the piece downwards. Press the A button to make the piece drop quickly to the bottom. Gain points by creating horizontal rows of blocks with no gaps. Each such row will disappear, and the blocks above will fall down. The more rows you make disappear with one piece, the more points you get. You will also gain points by making pieces drop faster by using either the DOWN or A button. The game is over when the falling blocks pile up to the top of the playing area. We are trying to make it so the screen does not move around. We will have that update soon.";document.getElementById("h").firstChild.innerText="Score";document.getElementById("i").firstChild.innerText="Speed";c.B();c.className="g";for(j=0;j<20;j++)for(i=0;i<11;i++){a=c.A("div",{id:"g"+j.toString(20)+i.toString(11)});a.style.top=(j*8)+"px";a.style.left=(36+i*8)+"px"}C()}function X(){var i,j,a,r,c,b=true,d=new Array(),e;a=22;for(j=22;j>2;j--){while(k[a]==8191&&a>3)a--;if(k[a]==4097)break;if(a<j){k[j]=k[a];for(i=1;i<12;i++)document.getElementById("g"+(j-3).toString(20)+(i-1).toString(11)).style.background=document.getElementById("g"+(a-3).toString(20)+(i-1).toString(11)).style.background}a--}if(j>a){_d+=Math.round(Math.pow(j-a,3)*93.33-Math.pow(j-a,2)*490+(j-a)*876.67-440);for(j;j>a;j--){k[j]=4097;for(i=1;i<12;i++)document.getElementById("g"+(j-3).toString(20)+(i-1).toString(11)).style.background="#111"}document.getElementById("k").innerText=_d}while(_l.length>0){e=_l.shift();switch(e){case 13:while(Y(1,0,0))_k++;break;case 37:Y(0,-1,0);break;case 38:Y(0,0,1);break;case 39:Y(0,1,0);break;case 40:if(Y(1,0,0))_k++;break}}u++;if(u==600){if(_h<50)_h++;document.getElementById("l").innerText=_h;u=0}if(_h>29||u%(31-_h)==0)b=Y(1,0,0);for(i=0;i<24;i++)d[i]=k[i];r=g[_i][_c];c=Math.pow(2,_b);d[_a]|=(c*(r&15));d[_a+1]|=(c*((r&240)>>4));d[_a+2]|=(c*((r&3840)>>8));d[_a+3]|=(c*((r&61440)>>12));for(j=3;j<24;j++)if(d[j]!=l[j]){for(i=1;i<12;i++)if(((d[j]^l[j])&Math.pow(2,i))>0)document.getElementById("g"+(j-3).toString(20)+(i-1).toString(11)).style.background=((d[j]&Math.pow(2,i))>0?f[_i]:"#111");l[j]=d[j]}if(_a<0&&!b){E(true);D(2);document.getElementById("d").style.display="block";document.getElementById("e").style.display="block"}else{if(!b)Z();window.setTimeout(X,_h>29?(50-_h)*10:0)}}function Y(a,b,c){var d=_a+a,e=_b+b,f=(_c+c)%4,r=g[_i][f],c=Math.pow(2,e);if(((k[d]&(c*(r&15)))==0)&&((k[d+1]&(c*((r&240)>>4)))==0)&&((k[d+2]&(c*((r&3840)>>8)))==0)&&((k[d+3]&(c*((r&61440)>>12)))==0)){_a=d;_b=e;_c=f;return true}return false}function Z(){var i;for(i=0;i<24;i++)k[i]=l[i];_a=-1;_b=5;_c=0;_i=_j;_j=(_j+1)%7;for(i=0;i<16;i++)document.getElementById("s"+i.toString(16)).style.background=((g[_j][0]&Math.pow(2,i))>0?f[_j]:"#000");if(_k>0){_d+=_k;_k=0;document.getElementById("k").innerText=_d}}function _A(){var i,j,c=document.getElementById("g"),b;document.getElementById("a").innerText="Reversi";document.getElementById("b").innerText="Each reversi piece has a black and a white side. On your turn, you place one piece on the board with your color facing up. You must place the piece so that one or more of your opponent's pieces is flanked by your pieces. All of the opponent's pieces between your pieces are then turned over to become your color. The object of the game is to own more pieces than your opponent when the game is over. The game is over when neither player is able to make a move. Usually this means the board is full.";document.getElementById("h").firstChild.innerText="Black";document.getElementById("i").firstChild.innerText="White";c.B();c.className="i";_c=new Array(-11,-10,-9,-1,1,9,10,11);for(j=0;j<8;j++)for(i=0;i<8;i++){b=c.A("div",{id:"g"+(j+1)+(i+1)});b.style.top=(j*20)+"px";b.style.left=(i*20)+"px";b.addEventListener("click",function(){_B(this)},false)}C()}function _B(a){if(_m)return;if(_n[o][a.id])_C(_n[o][a.id]-1)}function _C(m){var i,t=_n[o].m[m];for(i=0;i<8;i++)_o[t[0]/1+_c[i]]--;for(i=0;i<t.length;i++){k[t[i]]=o;document.getElementById("g"+t[i]).style.backgroundPosition="0px "+(-19*(1+o))+"px"}_d[o]+=t.length;_d[o^1]-=t.length-1;document.getElementById("k").innerText=_d[0];document.getElementById("l").innerText=_d[1];_n=_D();if(_n[o^1].m.length>0)o=o^1;else if(_n[o].m.length>0)alert((o==0?"White":"Black")+" has to pass.");else{if((a-1)%4<2){i=(_d[1]-_d[0])*((a%4)-1.5);D(i>0?1:(i<0?2:0))}alert("Game over. "+(_d[0]>_d[1]?"Black won.":(_d[1]>_d[0]?"White won.":"It's a draw.")));return}if(a%4==(o^1)+1||a%4==0)_E()}function _D(){var b,i,j,l,g,h;b=new Array({"m":[]},{"m":[]});for(i=11;i<89;i+=2)for(i;i%10<9;i++){if(k[i]==-1&&_o[i]<8){for(j=0;j<8;j++)for(g=1;;g++){l=i+g*_c[j];if(k[l]<0)break;if(l<11||l>88||l%10==0||l%10==9)break;if(g==1)h=k[l]^1;if(k[l]==h){if(!b[h]["g"+i]){b[h].m.push(new Array([i]));b[h]["g"+i]=b[h].m.length}for(g--;g>0;g--)b[h].m[b[h].m.length-1].push(i+g*_c[j]);break}}}}return b}function _E(){_m=true;v=window.setTimeout(function(){var i,j,h,b,c,d=Math.floor(_n[o].m.length*Math.random()),e=-1E6,f,t=_d[0]+_d[1],g;if(t>6)for(j=0;j<_n[o].m.length;j++){h=_n[o].m[j];f=0;for(i=0;i<8;i++)_o[h[0]/1+_c[i]]--;for(i=0;i<h.length;i++){k[h[i]/1]=o;if(h[i]/1>21&&h[i]/1<78&&h[i]/1%10!=1&&h[i]/1%10!=8)f-=(i>0?2:1)*_o[h[i]/1]}f*=-.059*t+5.38+(t<16?4*Math.random()-2:0);c=_D();f+=(c[o].m.length-c[o^1].m.length)*(-7.65E-4*t*t-.044*t+8.34+(t<16?4*Math.random()-2:0));if(h[0]==11||h[0]==18||h[0]==81||h[0]==88)f+=-.00114*t*t*t+.0937*t*t-1.82*t+29.6;if(h[0]<19)f+=_F(11,1);if(h[0]>80)f+=_F(81,1);if(h[0]%10==1)f+=_F(11,10);if(h[0]%10==8)f+=_F(18,10);if((k[11]<0&&h[0]==22)||(k[18]<0&&h[0]==27)||(k[81]<0&&h[0]==72)||(k[88]<0&&h[0]==77))f+=.0066*t*t-.016*t-39;g=0;for(i=0;i<c[o^1].m.length;i++){b=c[o^1].m[i];if(b[0]==11||b[0]==18||b[0]==81||b[0]==88)f+=-60+(t>56?(t-56)*6:0);if(b.length==_d[o]+h.length+1)f-=200;if(b.length>g)g=b.length}f+=(h.length-g)*(.0015*t*t+.0054*t+.7);for(i=0;i<8;i++)_o[h[0]/1+_c[i]]++;k[h[0]/1]=-1;for(i=1;i<h.length;i++)k[h[i]/1]=o^1;if(f>e){e=f;d=j}}_C(d);_m=false},0)}function _F(a,b,deb,move){var j,l,i,n,q,r,p,c=0;for(j=1;j>-2;j-=2){l=(j>0?0:7);if(k[a+b*l]<0&&k[a+b*(l+j)]>=0){p=0;q=true;for(i=1;i<8;i++){n=k[a+b*(l+j*i)];r=n<0;if(r!=q)p=p*6+(r?1:3*(o^n)+1);else p+=(r?1:((o^n)+p+1)%2);q=r;if(p==6||p==1123||p==194||p==191||p==1177||p==9979){c+=40;break}if(p==13||p==259||p==45||p==47||p==50||p==9997||p==54||p==58||p==331||p==313){c-=40;break}if(p==295){c+=10;break}if(p==1141||p==1129||p==913){c-=20;break}}if(p==980||p==32660)c+=40;if(p==43||p==1555||p==1567||p==1987||p==55)c-=40;if(p==12||p==35||p==8)c-=10}}return c}</script></head><body onload="G(0)"><div id="a"></div><div id="b"></div><div id="c"><div id="p"><a onclick="G(1)">Panel Puzzle</a><a onclick="G(2)">Minesweeper</a><a onclick="G(3)">Hang Man</a><a onclick="G(4)">Snake</a><a onclick="G(5)">Tetris</a><a onclick="G(6)">Reversi</a></div><div id="o"><div id="g"></div><div id="s"></div><input id="d"type="button"value="New Game"onclick="if(this.style.display!='none')C()"/><div id="h"><span></span><div id="k"class="a"></div></div><div id="i"><span></span><div id="l"class="a"></div></div><div id="j"><span></span><div id="m"class="a"></div></div><input id="e"type="button"value="Menu"onclick="if(this.style.display!='none')G(0)"/></div></div><!-- --><script type="text/javascript" src="http://images.webs.com/static/global/js/webs/usersites/escort.js"></script><script type="text/javascript">if(typeof(urchinTracker)=='function'){_uacct="UA-230305-2";_udn="none";_uff=false;urchinTracker();}</script></body></html>
|
|
|