記録表\示 


順位名  前POINT大魔王魔 王夜 魔妖 精外 道'); for(i=1; i<=5; i++){ if(gy[i]==0) u = 'PLAYER'; if(gy[i]==1) u = 'COMPUTER-3'; if(gy[i]==2) u = 'COMPUTER-1'; if(gy[i]==3) u = 'COMPUTER-2'; if(gy[i]==4) u = 'COMPUTER-4'; w2.document.write('
'+i+'位'+u+''+pt[gy[i]]+''+ss[gy[i]*5+5]+''+ss[gy[i]*5+4]+''+ss[gy[i]*5+3]+''+ss[gy[i]*5+2]+''+ss[gy[i]*5+1]); } w2.document.write('

大魔王連続防衛記録: '+rh+'


ゲームを開始、再開する際はこのウィンドウを閉じてください。
'); } function rule(){ w1 = window.open('rule.html','','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes'); if(navigator.appName=='Netscape') w1.focus(); } function deal(){ var c,i,k,r,s,t; var y = new Array(53); for(i=1; i<=53; i++) y[i] = i; for(i=1; i<=55; i++) cd[i]=0; for(i=0; i<=4; i++) display(i); for(i=1; i<=53; i++){ r = Math.ceil(Math.random()*53); c = y[i]; y[i] = y[r]; y[r] = c; } if(gn == 1){ k = Math.ceil(Math.random()*5)-1; } else{ k = (st[0]==5)*0+(st[1]==5)*1+(st[2]==5)*2+(st[3]==5)*3+(st[4]==5)*4; } for(i=0; i<=4; i++) mn[i] = 0; for(i=1; i<=55; i++){ if(k==0){ s = 'card'; if(i<=53){ cd[k*11+1+Math.floor((i-.5)/5)] = y[i]; t = y[i]; mn[k]++; } else{ cd[k*11+1+Math.floor((i-.5)/5)] = 0; t = 0; } } else{ s = 'comcard'; if(i<=53){ cd[k*11+1+Math.floor((i-.5)/5)] = y[i]; t = 1; mn[k]++; } else{ cd[k*11+1+Math.floor((i-.5)/5)] = 0; t = 0; } } document.images[parseInt(cl.substring(k*3,k*3+3))+Math.floor((i-.5)/5)].src = 'images/'+s+t+'.gif'; k++; if(k==5) k = 0; } } function sort(n){ var c,i,j; for(i=n*11+1; i<=n*11+10; i++){ for(j=i+1; j<=n*11+11; j++){ if((cd[i]>cd[j] && cd[j]!=0) || cd[i]==0){ c = cd[i]; cd[i] = cd[j]; cd[j] = c; } } } } function display(n){ var i; if(n==0){ for(i=1; i<=11; i++) document.images[parseInt(cl.substring(n*3,n*3+3))+i-1].src = 'images/card0.gif'; for(i=1; i<=11; i++) document.images[parseInt(cl.substring(n*3,n*3+3))+i-1].src = 'images/card'+cd[i]+'.gif'; } else{ for(i=1; i<=11; i++) document.images[parseInt(cl.substring(n*3,n*3+3))+i-1].src = 'images/comcard0.gif'; for(i=1; i<=mn[n]; i++) document.images[parseInt(cl.substring(n*3,n*3+3))+i-1].src = 'images/comcard1.gif'; } } function cls(){ var i; for(i=13; i<=16; i++) document.images[i].src = 'images/card0.gif'; } function mcls(){ var i; for(i=1; i<=4; i++) document.images[parseInt(ml.substring(i*3,i*3+3))].src = 'images/message0.gif'; document.images[57].src = 'images/message3.gif'; } function change(){ var c,i,k,l,m; var s = new Array(5); for(i=0; i<=4; i++) s[st[i]] = i; if(s[1]!=0 && s[5]!=0){ k = 0; l = 0; for(i=1; i<=11; i++){ if(k!=0 && l==0 && cd[s[5]*11+i]<=32 && ((i==1 && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i>=2 && i<=10 && cd[s[5]*11+i]!=cd[s[5]*11+i-1] && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i==11 && cd[s[5]*11+i]!=cd[s[5]*11+i-1]))) l = i; if(k==0 && cd[s[5]*11+i]<=32 && ((i==1 && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i>=2 && i<=10 && cd[s[5]*11+i]!=cd[s[5]*11+i-1] && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i==11 && cd[s[5]*11+i]!=cd[s[5]*11+i-1]))) k = i; } if(k==0 && l==0){ k = 1; l = 2; } if(k!=0 && l==0){ c = k; k = 1; l = c; } c = cd[s[5]*11+k]; cd[s[5]*11+k] = cd[s[1]*11+mn[s[1]]]; cd[s[1]*11+mn[s[1]]] = c; c = cd[s[5]*11+l]; cd[s[5]*11+l] = cd[s[1]*11+mn[s[1]]-1]; cd[s[1]*11+mn[s[1]]-1] = c; } if(s[2]!=0 && s[4]!=0){ k = 0; for(i=1; i<=11; i++){ if(k==0 && cd[s[4]*11+i]<=32 && ((i==1 && cd[s[4]*11+i]!=cd[s[4]*11+i+1]) || (i>=2 && i<=10 && cd[s[4]*11+i]!=cd[s[4]*11+i-1] && cd[s[4]*11+i]!=cd[s[4]*11+i+1]) || (i==11 && cd[s[4]*11+i]!=cd[s[4]*11+i-1]))) k = i; } if(k==0) k = 1; c = cd[s[4]*11+k]; cd[s[4]*11+k] = cd[s[2]*11+mn[s[2]]]; cd[s[2]*11+mn[s[2]]] = c; } if(s[1]==0 || s[2]==0){ document.images[57].src = 'images/message7.gif'; interval(1); if(s[1]==0){ document.images[16].src = document.images[57+mn[0]].src; document.images[57+mn[0]].src = 'images/card0.gif'; document.images[14].src = document.images[56+mn[0]].src; document.images[56+mn[0]].src = 'images/card0.gif'; } else{ document.images[15].src = document.images[57+mn[0]].src; document.images[57+mn[0]].src = 'images/card0.gif'; } interval(1); cls(); interval(1); if(s[1]==0){ k = 0; l = 0; for(i=1; i<=11; i++){ if(k!=0 && l==0 && cd[s[5]*11+i]<=32 && ((i==1 && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i>=2 && i<=10 && cd[s[5]*11+i]!=cd[s[5]*11+i-1] && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i==11 && cd[s[5]*11+i]!=cd[s[5]*11+i-1]))) l = i; if(k==0 && cd[s[5]*11+i]<=32 && ((i==1 && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i>=2 && i<=10 && cd[s[5]*11+i]!=cd[s[5]*11+i-1] && cd[s[5]*11+i]!=cd[s[5]*11+i+1]) || (i==11 && cd[s[5]*11+i]!=cd[s[5]*11+i-1]))) k = i; } if(k==0 && l==0){ k = 1; l = 2; } if(k!=0 && l==0){ c = k; k = 1; l = c; } document.images[14].src = 'images/card'+cd[s[5]*11+k]+'.gif'; document.images[16].src = 'images/card'+cd[s[5]*11+l]+'.gif'; } else{ k = 0; for(i=1; i<=11; i++){ if(k==0 && cd[s[4]*11+i]<=32 && ((i==1 && cd[s[4]*11+i]!=cd[s[4]*11+i+1]) || (i>=2 && i<=10 && cd[s[4]*11+i]!=cd[s[4]*11+i-1] && cd[s[4]*11+i]!=cd[s[4]*11+i+1]) || (i==11 && cd[s[4]*11+i]!=cd[s[4]*11+i-1]))) k = i; } if(k==0) k = 1; document.images[15].src = 'images/card'+cd[s[4]*11+k]+'.gif'; } interval(1); cls(); if(s[1]==0){ c = cd[s[5]*11+l]; cd[s[5]*11+l] = cd[mn[0]-1]; cd[mn[0]-1] = c; c = cd[s[5]*11+k]; cd[s[5]*11+k] = cd[mn[0]]; cd[mn[0]] = c; } else{ c = cd[s[4]*11+k]; cd[s[4]*11+k] = cd[mn[0]]; cd[mn[0]] = c; } sort(0); display(0); document.images[57].src = 'images/message3.gif'; } if(s[5]==0 || s[4]==0){ document.images[57].src = 'images/message7.gif'; interval(1); if(s[5]==0){ m = '2'; ck = 2; } else{ m = '1'; ck = 1; } alert('交換したいカードを'+m+'枚選んでください。'); } } function gamestart(){ var i; if(db!=-1 || ck!=0) return; db = -1; dy = -1; ba = 0; bm = 0; ta = 0; tb = 0; ck = 0; cx = 0; gz = 0; hp = 0; for(i=1; i<=14; i++) jm[i] = 0; cls(); mcls(); gs = 5; gn++; for(i=0; i<=4; i++) ss[i*5+st[i]]++; document.forms[0].elements[10].value = gn; document.forms[0].elements[0].value = pt[2]; document.forms[0].elements[1].value = pt[3]; document.forms[0].elements[2].value = pt[1]; document.forms[0].elements[3].value = pt[4]; document.forms[0].elements[4].value = pt[0]; for(i=0; i<=4; i++) document.images[parseInt(sl.substring(i*3,i*3+3))].src = 'images/status'+st[i]+'.gif'; deal(); for(i=0; i<=4; i++) sort(i); display(0); if(gn==1){ for(i=0; i<=4; i++) if(cd[i*11+1]==1) db = i; dy = db; } else{ change(); if(ck!=0) return; for(i=0; i<=4; i++){ sort(i); if(st[i]==1){ db = i; dy = i; } } } if(db==0){ document.images[57].src = 'images/message4.gif'; } else{ timeID = setTimeout('computer()',800*sp); } } function pass(){ select(0); } function select(n){ var s = new Array(5); var a,b,c,d,g,i,r,q,x,v; if(ck!=0){ if(n==0 || n == cx || cd[n] == 0) return; for(i=0; i<=4; i++) s[st[i]] = i; if(ck==2){ document.images[14].src = document.images[n+57].src; document.images[n+57].src = 'images/card0.gif'; c = cd[s[1]*11+mn[s[1]]]; cd[s[1]*11+mn[s[1]]] = cd[n]; cd[n] = c; cx = n; ck = 3; return; } else{ if(ck==1){ document.images[15].src = document.images[n+57].src; c = cd[s[2]*11+mn[s[2]]]; cd[s[2]*11+mn[s[2]]] = cd[n]; cd[n] = c; } else{ document.images[16].src = document.images[n+57].src; c = cd[s[1]*11+mn[s[1]]-1]; cd[s[1]*11+mn[s[1]]-1] = cd[n]; cd[n] = c; } document.images[n+57].src = 'images/card0.gif'; interval(1); cls(); interval(1); if(ck==1){ document.images[15].src = 'images/card'+cd[n]+'.gif'; } else{ document.images[14].src = 'images/card'+cd[n]+'.gif'; document.images[16].src = 'images/card'+cd[cx]+'.gif'; cx = 0; } interval(1); cls(); for(i=0; i<=4; i++) sort(i); display(0); document.images[57].src = 'images/message3.gif'; ck = 0; db = s[1]; dy = s[1]; } timeID = setTimeout('computer()',800*sp); return; } if(db==-1) return; if((n!=0 && cd[n]==0) || db!=0) return; if(n==0){ document.images[57].src = 'images/message6.gif'; db++; if(dy==0) dy++; clearTimeout(timeID); timeID = setTimeout('computer()',800*sp); return; } if(dy==0){ g = Math.ceil(cd[n]/4); v = 0; x = 0; for(i=1; i<=11; i++){ if(Math.ceil(cd[i]/4)==g){ v++; x = i; } } if(v>hm){ r = confirm('本当にこの枚数でよろしいですか?'); if(r==false) return; } d = 0; if(v=x-1)+57].src; document.images[n-(n==x)-(n>=x-1)+57].src = 'images/card0.gif'; document.images[15].src = document.images[n-(n==x)-(n>=x-1)+58].src; document.images[n-(n==x)-(n>=x-1)+58].src = 'images/card0.gif'; document.images[16].src = document.images[n-(n==x)-(n>=x-1)+59].src; document.images[n-(n==x)-(n>=x-1)+59].src = 'images/card0.gif'; jm[Math.ceil(cd[n]/4)] = jm[Math.ceil(cd[n]/4)] + 3; for(i=1; i<=3; i++) cd[n-(n==x)-(n>=x-1)+i-1] = 0; mn[0] = mn[0] - 3; } if(hm==4){ document.images[13].src = document.images[x+54].src; document.images[x+54].src = 'images/card0.gif'; document.images[14].src = document.images[x+55].src; document.images[x+55].src = 'images/card0.gif'; document.images[15].src = document.images[x+56].src; document.images[x+56].src = 'images/card0.gif'; document.images[16].src = document.images[x+57].src; document.images[x+57].src = 'images/card0.gif'; jm[Math.ceil(cd[n]/4)] = jm[Math.ceil(cd[n]/4)] + 4; for(i=1; i<=4; i++) cd[x+i-4] = 0; mn[0] = mn[0] - 4; } bm = hm; ba = g; if(d!=0) hm = d; } else{ g = Math.ceil(cd[n]/4); v = 0; x = 0; for(i=1; i<=11; i++){ if(Math.ceil(cd[i]/4)==g){ v++; x = i; } } if(g<=ba || v=x-1)+57].src; document.images[n-(n==x)-(n>=x-1)+57].src = 'images/card0.gif'; document.images[15].src = document.images[n-(n==x)-(n>=x-1)+58].src; document.images[n-(n==x)-(n>=x-1)+58].src = 'images/card0.gif'; document.images[16].src = document.images[n-(n==x)-(n>=x-1)+59].src; document.images[n-(n==x)-(n>=x-1)+59].src = 'images/card0.gif'; jm[Math.ceil(cd[n]/4)] = jm[Math.ceil(cd[n]/4)] + 3; for(i=1; i<=3; i++) cd[n-(n==x)-(n>=x-1)+i-1] = 0; mn[0] = mn[0] - 3; } if(bm==4){ document.images[13].src = document.images[x+54].src; document.images[x+54].src = 'images/card0.gif'; document.images[14].src = document.images[x+55].src; document.images[x+55].src = 'images/card0.gif'; document.images[15].src = document.images[x+56].src; document.images[x+56].src = 'images/card0.gif'; document.images[16].src = document.images[x+57].src; document.images[x+57].src = 'images/card0.gif'; jm[Math.ceil(cd[n]/4)] = jm[Math.ceil(cd[n]/4)] + 4; for(i=1; i<=4; i++) cd[x+i-4] = 0; mn[0] = mn[0] - 4; } ba = g; } dy = 0; sort(0); display(0); if(mn[0]==0){ interval(0.5*sp); a = st[0]; st[0] = gs; q = gs + 5; if(a==5 && gs==5){ rs++; if(rh=2) || (ja[i]==13 && jb[i]==1 && jn[14]==1)){ jc[i] = 1; } else{ for(j=ja[i]+1; j<=13; j++){ if(jn[j]<=4-jb[i]) jc[i] = 0; } if(jb[i]==1 && jn[14] == 0) jc[i] = 0; } } w = 0; for(i=1; i<=je; i++){ if(jc[i] == 1) w = 1; } if(w == 0){ if(je>=5){ jc[je] = 2; jc[je-1] = 2; } if(je>=2 && je<=4){ jc[je] = 2; } } v = 0; for(i=0; i<=4; i++) if(i!=db && (mn[i]!=0 && mn[i]!=1)) v = 1; if(v==0){ if(dy==db){ z = 0; for(i=je; i>=1; i--){ if(z==0 && jb[i]>=2){ for(j=1; j<=mn[db]; j++) if(ta==0 && ja[i]==Math.ceil(cd[db*11+j]/4)) ta = j; tb = jb[i]; z = 1; } } if(z==0){ for(j=1; j<=mn[db]; j++) if(ta==0 && ja[je]==Math.ceil(cd[db*11+j]/4)) ta = j; tb = jb[je]; } } else{ z = 0; for(i=je; i>=1; i--){ if(z==0 && ja[i]>ba && jb[i]>=bm){ for(j=1; j<=mn[db]; j++) if(ta==0 && ja[i]==Math.ceil(cd[db*11+j]/4)) ta = j; tb = bm; z = 1; } } } return; } t = 0; u = 0; for(j=1; j<=je; j++){ if(jc[j]==1) u++; if(jc[j]!=1) t++; } if(dy==db){ y = 0; if(t==0){ if(u<=2){ y = je; } else{ y = 1; } } if(t==1){ if(u==0){ y = 1; } else{ y = 2; } } if(t>=2){ if(u<=t-2){ y = 1; } else{ for(i=1; i<=t; i++){ for(j=t+1; j<=t+u; j++){ if(y==0 && jb[i]==jb[j]) y = i; } } if(y==0) y = 1; } } for(j=1; j<=mn[db]; j++) if(ta==0 && ja[y]==Math.ceil(cd[db*11+j]/4)) ta = j; tb = jb[y]; } else{ for(i=1; i<=je; i++){ if(jc[i]==0 && ja[i]>ba && jb[i]==bm) jd[i] = 10; if(jc[i]==1 && ja[i]>ba && jb[i]==bm && t<=u) jd[i] = 5; if(jc[i]==1 && ja[i]>ba && jb[i]==bm && t==1 && u==1) jd[i] = 15; } y = 0; for(i=1; i<=je; i++){ if(jd[i]>jd[y]) y = i; } if(y!=0){ for(j=1; j<=mn[db]; j++) if(ta==0 && ja[y]==Math.ceil(cd[db*11+j]/4)) ta = j; tb = bm; gz = 0; } else{ if(gz!=0){ gz = 0; return; } for(i=1; i<=je; i++){ if(gz==0 && ja[i]>ba && jb[i]>bm && jc[i]==1) gz = ja[i]; } if(gz==0) return; think(); } } }