Файловый менеджер - Редактировать - /home/jogoso94/public_html/static/img/logo/47.32b3eae4f0fb8769.js.tar
�азад
home/jogoso94/public_html/jogos/mahjong/47.32b3eae4f0fb8769.js 0000644 00000027520 15042715542 0017325 0 ustar 00 "use strict";(self.webpackChunkmah=self.webpackChunkmah||[]).push([[47],{3378:(w,y,q)=>{q.d(y,{K:()=>c});var a=q(5050);class c{static random(u){return Math.floor(Math.random()*u.length)}static randomExtract(u){const m=c.random(u);return u.splice(m,1)[0]}static collectNodes(u,m){const f={left:[],right:[],top:[],bottom:[]};let i;for(let s=m.y-1;s<=m.y+1;s++){i=(0,a.D)(u,m.z,m.x-2,s),i&&f.left.push(i),i=(0,a.D)(u,m.z,m.x+2,s),i&&f.right.push(i);for(let e=m.x-1;e<=m.x+1;e++)i=(0,a.D)(u,m.z+1,e,s),i&&f.top.push(i),i=(0,a.D)(u,m.z-1,e,s),i&&f.bottom.push(i)}return f}static fillStones(u,m){const f={};return u.forEach(i=>{const s=m.list[i.v];i.img=s?s.img:{id:void 0},f[i.groupnr]=f[i.groupnr]||[],f[i.groupnr].push(i),i.nodes=c.collectNodes(u,i)}),Object.keys(f).forEach(i=>{const s=f[Number(i)];s.forEach(e=>{e.group=s.filter(r=>r!==e)})}),u}getTilesInGame(u,m){return u.list.filter(f=>void 0!==f)}getTilesInPairs(u,m){const f=[];return u.groups.forEach(i=>{for(let s=0;s<i.tiles.length;s+=2)f.push([i.tiles[s],i.tiles[s+1]])}),f}}},5405:(w,y,q)=>{q.d(y,{v:()=>x});var a=q(5050),c=q(3378);class x extends c.K{build(m,f){const i=this.getTilesInGame(f,m.length),s=[],e=m.slice(0);for(;e.length>0;){const r=c.K.randomExtract(i),t=c.K.randomExtract(e);s.push(new a.r(t[0],t[1],t[2],r.v,r.groupnr))}return c.K.fillStones(s,f),s}}},4678:(w,y,q)=>{q.d(y,{N:()=>u});var a=q(5050),c=q(3378),x=q(5405);class u extends c.K{build(f,i){const s=[];f.forEach(t=>{s.push(new a.r(t[0],t[1],t[2],0,0))}),c.K.fillStones(s,i);let e=1,r=this.solve(s,i);for(;0===r.length&&e<1e3;)s.forEach(t=>{t.picked=!1,t.v=0,t.groupnr=0}),r=this.solve(s,i),e++;return 0===r.length?(new x.v).build(f,i):(s.forEach(t=>{t.picked=!1}),c.K.fillStones(s,i),s.sort((t,h)=>t.v-h.v),s)}solve(f,i){const s=[],e=[],r=f.length/2,t=i.groups.slice();for(;t.length>0;){const n=c.K.randomExtract(t).tiles.slice(),l=c.K.randomExtract(n),o=c.K.randomExtract(n),d=c.K.randomExtract(n),p=n[0];e.length<r&&e.push([l,o]),e.length<r&&e.push([d,p])}for(;e.length>0;){const h=c.K.randomExtract(e),n=f.filter(d=>!d.picked&&!d.isBlocked());if(n.length<2)return[];const l=c.K.randomExtract(n),o=c.K.randomExtract(n);l.v=h[0].v,l.img=h[0].img,l.groupnr=h[0].groupnr,l.picked=!0,o.v=h[1].v,o.img=h[1].img,o.groupnr=h[1].groupnr,o.picked=!0,s.push(h)}return s}}},6124:(w,y,q)=>{function a(f){if(!f)return!1;let i=0,s=f.above[i];for(;void 0!==s;){if(!s.isPlayed)return!1;i++,s=f.above[i]}i=0;let e=f.left[i];for(;void 0!==e;){if(!e.isPlayed){i=0;let r=f.right[i];for(;void 0!==r;){if(!r.isPlayed)return!1;i++,r=f.right[i]}return!0}i++,e=f.left[i]}return!0}function c(){return Math.floor(100*Math.random())}q.d(y,{M:()=>m});class u{constructor(i,s,e,r,t,h,n){this.qt=s,this.lo=e,this.ngroups=r,this.maxheight=t,this.maxwidth=h,this.maxdepth=n,this.result=[],this.ntiles1=i,this.ntiles2=i}write(){do{this.ntiles1=this.ntiles2;for(let i=0;i<this.ngroups;i++)this.writeGroup(i)}while(this.ntiles2!==this.ntiles1);return this.result}writePair(i,s,e){const r=this.qt[i].member[s],t=this.qt[i].member[e];for(let h=0;h<this.maxheight;h++)for(let n=0;n<this.maxwidth;n++)for(let l=0;l<this.maxdepth;l++)(this.lo[h][n][l]===r||this.lo[h][n][l]===t)&&this.result.push([l,n,h])}writePairing(i,s,e,r){const t=s.member[e],h=s.member[r];return!!(t&&h&&!t.isPlayed&&a(t)&&a(h))&&(this.writePair(i,e,r),t.isPlayed=!0,h.isPlayed=!0,this.ntiles2-=2,!0)}writeGroup(i){const s=this.qt[i];switch(s.bestpairing){case 1:this.writePairing(i,s,0,1)&&(s.isplayed=s.member[2].isPlayed),this.writePairing(i,s,2,3);break;case 2:this.writePairing(i,s,0,2),this.writePairing(i,s,1,3);break;case 3:this.writePairing(i,s,0,3),this.writePairing(i,s,1,2);break;case 4:this.writePairing(i,s,0,1)}}}class m{constructor(){this.tl=[],this.qt=[],this.lo=[],this.qts=[],this.maxgroups=80,this.maxheight=40,this.maxwidth=100,this.maxdepth=10}solveLayout(i){for(let s=0;s<this.maxheight;s++){this.lo[s]=[];for(let e=0;e<this.maxwidth;e++){this.lo[s][e]=[];for(let r=0;r<this.maxdepth;r++)this.lo[s][e][r]=void 0}}return i.forEach(s=>{const e={left:[],right:[],above:[],below:[],value:s.groupnr,isPlayed:!1};this.lo[s.y][s.x][s.z]=e,this.tl.push(e)}),this.ntilesCount=i.length,this.solve(0,0)}writeGame(){return this.unrotateGroups(),new u(this.ntilesCount,this.qt,this.lo,this.ngroups,this.maxheight,this.maxwidth,this.maxdepth).write()}static playTile(i,s,e){let r=e;for(let t=0;void 0!==i.left[t];t++){const h=i.left[t];h.isPlayed||(s[h.value]-=a(h)?1:0)}for(let t=0;void 0!==i.right[t];t++){const h=i.right[t];h.isPlayed||(s[h.value]-=a(h)?1:0)}i.isPlayed=!0,r--;for(let t=0;void 0!==i.left[t];t++){const h=i.left[t];h.isPlayed||(s[h.value]+=a(h)?1:0)}for(let t=0;void 0!==i.right[t];t++){const h=i.right[t];h.isPlayed||(s[h.value]+=a(h)?1:0)}for(let t=0;void 0!==i.below[t];t++){const h=i.below[t];s[h.value]+=a(h)?1:0}return r}initSolve(){this.tl.forEach(e=>{e.left[0]=void 0,e.left[1]=void 0,e.left[2]=void 0,e.right[0]=void 0,e.right[1]=void 0,e.right[2]=void 0,e.above[0]=void 0,e.above[1]=void 0,e.above[2]=void 0,e.above[3]=void 0,e.above[4]=void 0,e.below[0]=void 0,e.below[1]=void 0,e.below[2]=void 0,e.below[3]=void 0,e.below[4]=void 0,e.isPlayed=!1});for(let e=0;e<this.maxheight;e++)for(let r=2;r<this.maxwidth;r++)for(let t=0;t<this.maxdepth;t++){const h=this.lo[e][r][t];if(void 0!==h){let l=0;for(let o=Math.max(e-1,0);o<Math.min(e+2,this.maxheight);o++)void 0!==this.lo[o][r-2][t]&&(h.left[l]=this.lo[o][r-2][t],l++)}const n=this.lo[e][r-2][t];if(void 0!==n){let l=0;for(let o=Math.max(e-1,0);o<Math.min(e+2,this.maxheight);o++)void 0!==this.lo[o][r][t]&&(n.right[l]=this.lo[o][r][t],l++)}}for(let e=0;e<this.maxheight;e++)for(let r=0;r<this.maxwidth;r++)for(let t=1;t<this.maxdepth;t++){const h=this.lo[e][r][t-1];if(void 0!==h){let l=0;for(let o=Math.max(e-1,0);o<Math.min(e+2,this.maxheight);o++)for(let d=Math.max(r-1,0);d<Math.min(r+2,this.maxwidth);d++)void 0!==this.lo[o][d][t]&&(h.above[l]=this.lo[o][d][t],l++)}const n=this.lo[e][r][t];if(void 0!==n){let l=0;for(let o=Math.max(e-1,0);o<Math.min(e+2,this.maxheight);o++)for(let d=Math.max(r-1,0);d<Math.min(r+2,this.maxwidth);d++)void 0!==this.lo[o][d][t-1]&&(n.below[l]=this.lo[o][d][t-1],l++)}}this.qt=[];for(let e=0;e<this.maxgroups;e++)this.qt.push({pairing:-1,bestpairing:-1,nmembers:0,member:[],isplayed:!1,rotation:0});for(let e=0;e<this.ntilesCount;e++){const r=this.tl[e].value;this.qt[r].member[this.qt[r].nmembers]=this.tl[e],this.qt[r].nmembers++}let i=0,s=0;for(let e=0;e<this.maxgroups;e++){const r=this.qt[e];2===r.nmembers&&(this.qts[i]=r,this.qts[i].pairing=4,i++),0!==r.nmembers&&(s=e)}for(let e=0;e<=s;e++){const r=this.qt[e];0===r.nmembers&&(this.qts[i]=r,this.qts[i].pairing=-1,i++)}this.qtsindex=i;for(let e=0;e<=s;e++){const r=this.qt[e];if(4===r.nmembers){this.qts[i]=r,this.qts[i].pairing=0;const t=this.qts[i],h=c()%(i+1-this.qtsindex);this.qts[i]=this.qts[this.qtsindex+h],this.qts[this.qtsindex+h]=t,i++}}this.ngroups=i,this.aborted=!1}prune(){let i=this.ntilesCount,s=this.ntilesCount;this.nplays++;do{i=s;for(let e=0;e<this.ngroups;e++){const r=this.qt[e];if(!r.isplayed){const t=r.member[0],h=r.member[1],n=r.member[2],l=r.member[3],o=(g,b)=>{g.isPlayed=!0,b.isPlayed=!0,s-=2},d=g=>{!g.isPlayed&&a(g)&&(g.isPlayed=!0,i++)},p=(g,b,P)=>{!g.isPlayed&&a(g)&&a(b)&&(o(g,b),r.isplayed=P.isPlayed)};switch(r.pairing){case 0:t.isPlayed||h.isPlayed||n.isPlayed?(r.member.forEach(g=>d(g)),t.isPlayed&&h.isPlayed&&n.isPlayed&&l.isPlayed&&(r.isplayed=!0,s-=2)):!t.isPlayed&&a(t)?!h.isPlayed&&a(h)?o(t,h):!n.isPlayed&&a(n)?o(t,n):!l.isPlayed&&a(l)&&o(t,l):!h.isPlayed&&a(h)?!n.isPlayed&&a(n)?o(h,n):!l.isPlayed&&a(r.member[3])&&o(h,l):!n.isPlayed&&a(n)&&!l.isPlayed&&a(l)&&o(n,l);break;case 1:p(t,h,n),p(n,l,t);break;case 2:p(t,n,h),p(h,l,t);break;case 3:p(t,l,h),p(h,n,t);break;case 4:a(t)&&a(h)&&(o(t,h),r.isplayed=!0);break;case 5:a(t)&&a(h)&&a(n)&&a(l)&&(o(t,h),o(n,l),r.isplayed=!0)}}}}while(s!==i);for(let e=0;e<this.ntilesCount;e++)this.tl[e].isPlayed=!1;for(let e=0;e<this.ngroups;e++)this.qt[e].isplayed=!1;return s}unrotateGroups(){for(let i=0;i<this.ngroups;i++){switch(this.qt[i].rotation){case 1:{const s=this.qt[i].member[1];this.qt[i].member[1]=this.qt[i].member[2],this.qt[i].member[2]=this.qt[i].member[3],this.qt[i].member[3]=s;break}case 2:{const s=this.qt[i].member[3];this.qt[i].member[3]=this.qt[i].member[2],this.qt[i].member[2]=this.qt[i].member[1],this.qt[i].member[1]=s;break}}this.qt[i].rotation=0}}sureSolve(i){const s=[];if(this.prune()>this.remainMax)return!1;let e;for(e=i;e<this.ngroups&&(this.qts[e].pairing=1,!(this.prune()>this.remainMax));e++);if(e===this.ngroups){for(let t=0;t<this.ngroups;t++)this.qt[t].bestpairing=this.qt[t].pairing;for(let t=this.qtsindex;t<this.ngroups;t++)this.qts[t].bestpairing+=3-this.qts[t].rotation,this.qts[t].bestpairing>3&&(this.qts[t].bestpairing-=3);if(this.remainMax=this.prune()-2,this.remainMax<this.remainMin){for(let t=this.qtsindex;t<this.ngroups;t++)this.qts[t].pairing=0;return!0}for(e=i;e<this.ngroups;e++)this.qts[e].pairing=0;return this.sureSolve(i)}let r=0;s[r++]=this.qts[e];for(let t=e-1;t>=i;t--)if(this.qts[t].pairing=0,this.prune()<=this.remainMax)this.qts[t].pairing=1,s[r++]=this.qts[t];else{if(c()%2){const h=this.qts[t].member[3];this.qts[t].member[3]=this.qts[t].member[2],this.qts[t].member[2]=this.qts[t].member[1],this.qts[t].member[1]=h,this.qts[t].rotation+=1,this.qts[t].rotation>2&&(this.qts[t].rotation=0)}else{const h=this.qts[t].member[1];this.qts[t].member[1]=this.qts[t].member[2],this.qts[t].member[2]=this.qts[t].member[3],this.qts[t].member[3]=h,this.qts[t].rotation-=1,this.qts[t].rotation<0&&(this.qts[t].rotation=2)}this.qts[e]=this.qts[t],e--}for(let t=e;t>=i;t--)this.qts[t]=s[--r];for(let t=e;t>=i;t--){if(this.qts[t].pairing=2,this.sureSolve(t+1)||(this.qts[t].pairing=3,this.sureSolve(t+1)))return!0;this.qts[t].pairing=0}return!1}randomSolve(i){const s=[],e=[0,0,1,3,6],r=[[0,1,2,3],[1,0,3,2],[2,3,0,1],[3,2,1,0]];for(let t=0;t<i;t++){let h=this.ntilesCount;for(let n=0;n<this.ngroups;n++){s[n]=0;for(let l=0;l<this.qt[n].nmembers;l++)a(this.qt[n].member[l])&&s[n]++;this.qt[n].pairing=-1,2===this.qt[n].nmembers&&(this.qt[n].isplayed=!0)}for(;;){let n=!1,l=0;for(let b=0;b<this.ngroups;b++){if((this.qt[b].isplayed?1:0)+e[s[b]]>=5){n=!0;break}l+=e[s[b]]}if(!n){if(0===l)break;l=c()%l}let o=0;do{l-=e[s[o]],o++}while(l>=0);o--,l+=e[s[o]];let d=0;const p=this.qt[o];let g=p.nmembers-1;if(l<=1){let b=p.member[d];for(;b.isPlayed||!a(b);)d++,b=p.member[d];if(0===l){g=d+1;let P=p.member[g];for(;P.isPlayed||!a(P);)g++,P=p.member[g]}}if(l>=1){let b=p.member[g];for(;b.isPlayed||!a(b);)g--,b=p.member[g];if(2===l){d=g-1;let P=p.member[d];for(;P.isPlayed||!a(P);)d--,P=p.member[d]}}h=m.playTile(p.member[d],s,h),h=m.playTile(p.member[g],s,h),p.isplayed=!0,p.pairing=r[d][g],s[o]-=2}for(let n=0;n<this.ntilesCount;n++)this.tl[n].isPlayed=!1;for(let n=0;n<this.ngroups;n++)this.qt[n].isplayed=!1,2===this.qt[n].nmembers&&(this.qt[n].pairing=4);if(this.nrplays++,h<=this.remainMax){for(let n=0;n<this.ngroups;n++)this.qt[n].bestpairing=this.qt[n].pairing;if(this.remainMax=h-2,this.remainMax<this.remainMin){for(let n=0;n<this.ngroups;n++)4===this.qt[n].nmembers&&(this.qt[n].pairing=0);return!0}}}for(let t=0;t<this.ngroups;t++)4===this.qt[t].nmembers&&(this.qt[t].pairing=0);return!1}solve(i,s){return this.initSolve(),this.nrplays=0,this.nplays=0,this.remainMax=Math.max(i,s),this.remainMin=Math.min(i,s),this.prune()>this.remainMax||this.randomSolve(function x(f){return Math.floor(f)}(Math.pow(1.2,this.ngroups-this.qtsindex)))||(this.sureSolve(this.qtsindex),this.unrotateGroups()),this.remainMax+2}}},5050:(w,y,q)=>{q.d(y,{D:()=>c,r:()=>a});class a{constructor(u,m,f,i,s){this.picked=!1,this.group=[],this.z=u,this.x=m,this.y=f,this.v=i,this.groupnr=s}toPosition(){return{z:this.z,x:this.x,y:this.y,v:this.v,groupnr:this.groupnr}}isBlocked(){return a.hasStone(this.nodes.top)||a.hasStone(this.nodes.left)&&a.hasStone(this.nodes.right)}static hasStone(u){for(const m of u)if(!m.picked)return!0;return!1}}const c=(x,u,m,f)=>{for(let i=0,s=x.length;i<s;i++)if(x[i].z===u&&x[i].x===m&&x[i].y===f)return x[i]}}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка