PageSourceSearch

https://expanded-othello.vercel.app/_next/static/chunks/0cyz7yy5oa-px.js

js expanded-othello.vercel.app collected 2026-10-03 06:55:05 UTC 26,889 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94912,e=>{"use strict";let t=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]];function r(e,t,r,n){return r>=0&&r<e&&n>=0&&n<t}function n(e,t){return 1===t?[e.board[0],e.board[1]]:[e.board[1],e.board[0]]}function l(e,l,a,s){let i=s??e.currentPlayer,{h:o,w:d,board:c}=e;if(!r(o,d,l,a)||c[0][l][a]||c[1][l][a]||c[2][l][a])return!1;let[h,u]=n(e,i);for(let[e,n]of t){let t=l+e,s=a+n,i=!1;for(;r(o,d,t,s)&&u[t][s];)t+=e,s+=n,i=!0;if(i&&r(o,d,t,s)&&h[t][s])return!0}return!1}function a(e,t){let r=t??e.currentPlayer,n=[];for(let t=0;t<e.h;t++)for(let a=0;a<e.w;a++)l(e,t,a,r)&&n.push([t,a]);return n}e.s(["createGame",0,function(e){let[t,n]=e.boardSize,l=[Array.from({length:t},()=>Array(n).fill(0)),Array.from({length:t},()=>Array(n).fill(0)),Array.from({length:t},()=>Array(n).fill(0))];for(let[a,s]of e.obstacles)r(t,n,a,s)&&(l[2][a][s]=1);let a=Math.floor(t/2)-1,s=Math.floor(n/2)-1;for(let[[e,i],o]of[[[0,0],1],[[1,1],1],[[0,1],-1],[[1,0],-1]]){let d=a+e,c=s+i;r(t,n,d,c)&&0===l[2][d][c]&&(l[+(1!==o)][d][c]=1)}return{board:l,h:t,w:n,currentPlayer:1,turn:0,winCond:e.winCond,done:!1}},"getScores",0,function(e){return{black:e.board[0].flat().reduce((e,t)=>e+t,0),white:e.board[1].flat().reduce((e,t)=>e+t,0)}},"getWinner",0,function(e){let t,r=e.board[0].flat().reduce((e,t)=>e+t,0),n=e.board[1].flat().reduce((e,t)=>e+t,0),l=r+n,a=e.winCond;if(0===l||.5===a||0==(t=a>.5?r>n?1:n>r?-1:0:r<n?1:n<r?-1:0))return 0;let s=(1===t?r:n)/l;return .5===s||a>.5&&s>=a||a<.5&&s<=a?0:t},"isValidMove",0,l,"randomMove",0,function(e){let t=a(e);return 0===t.length?null:t[Math.floor(Math.random()*t.length)]},"step",0,function(e,l,s){let i=e.board.map(e=>e.map(e=>[...e])),o={...e,board:i},[d,c]=n(o,o.currentPlayer);for(let[e,n]of(d[l][s]=1,t)){let t=l+e,a=s+n,i=[];for(;r(o.h,o.w,t,a)&&c[t][a];)i.push([t,a]),t+=e,a+=n;if(i.length&&r(o.h,o.w,t,a)&&d[t][a])for(let[e,t]of i)c[e][t]=0,d[e][t]=1}let h=1===o.currentPlayer?-1:1;return o.currentPlayer=h,o.turn=e.turn+1,o.done=0===a(o,1).length&&0===a(o,-1).length,o},"validMoves",0,a])},92349,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(94912);let l=[-.01,.2,.4,.6,.8,1.01],a={boardSize:[8,8],obstacles:[],winCond:1.01};function s(){let e=(0,r.useRef)(a),[s,i]=(0,r.useState)(()=>(0,n.createGame)(a)),[o,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e.current=function(){let e=l[Math.floor(Math.random()*l.length)];for(let t=0;t<20;t++){let t={boardSize:[8,8],obstacles:function(){let e=Math.floor(4)-1,t=Math.floor(4)-1,r=new Set([`${e},${t}`,`${e},${t+1}`,`${e+1},${t}`,`${e+1},${t+1}`]),n=[];for(let e=0;e<Math.floor(4);e++)for(let t=0;t<Math.floor(4);t++)[...new Map([[e,t],[e,7-t],[7-e,t],[7-e,7-t]].map(e=>[`${e[0]},${e[1]}`,e])).values()].every(([e,t])=>!r.has(`${e},${t}`))&&n.push([e,t]);let l=1+Math.floor(Math.random()*Math.min(n.length,3)),a=[...n].sort(()=>Math.random()-.5).slice(0,l),s=new Set;for(let[e,t]of a)for(let[r,n]of[[e,t],[e,7-t],[7-e,t],[7-e,7-t]])s.add(`${r},${n}`);return[...s].map(e=>e.split(",").map(Number))}(),winCond:e},r=(0,n.createGame)(t);if((0,n.validMoves)(r,1).length>0||(0,n.validMoves)(r,-1).length>0)return t}return{boardSize:[8,8],obstacles:[],winCond:e}}(),i((0,n.createGame)(e.current));let t=setTimeout(()=>d(!0),1500*Math.random());return()=>clearTimeout(t)},[]),(0,r.useEffect)(()=>{if(!o)return;if(s.done){let t=setTimeout(()=>i((0,n.createGame)(e.current)),2200);return()=>clearTimeout(t)}if(0===(0,n.validMoves)(s).length){let e=1===s.currentPlayer?-1:1;if(0===(0,n.validMoves)(s,e).length)i(e=>({...e,done:!0}));else{let t=setTimeout(()=>i(t=>({...t,currentPlayer:e})),300);return()=>clearTimeout(t)}return}let t=setTimeout(()=>{let e=(0,n.randomMove)(s);e&&i(t=>(0,n.step)(t,e[0],e[1]))},20+10*Math.random());return()=>clearTimeout(t)},[s,o]);let c=s.done?(0,n.getWinner)(s):null;return(0,t.jsxs)("div",{className:"relative border-2 border-white/30 shrink-0 overflow-hidden",style:{display:"grid",gridTemplateColumns:"repeat(8, 22px)",gridTemplateRows:"repeat(8, 22px)",width:176,height:176},children:[Array.from({length:8},(e,r)=>Array.from({length:8},(e,n)=>{let l=1===s.board[0][r][n],a=1===s.board[1][r][n],i=1===s.board[2][r][n];return(0,t.jsx)("div",{className:`flex items-center justify-center border border-black/10 ${i?"bg-[#d8d8d8]":"bg-green-800"}`,style:{width:22,height:22},children:i?(0,t.jsx)("div",{className:"bg-[#e8e8e8]",style:{width:15.399999999999999,height:15.399999999999999}}):l?(0,t.jsx)("div",{className:"rounded-full bg-gray-950",style:{width:16.72,height:16.72}}):a?(0,t.jsx)("div",{className:"rounded-full bg-white",style:{width:16.72,height:16.72}}):null},`${r}-${n}`)})),s.done&&null!==c&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-zinc-400/80 backdrop-blur-[1px]",children:0===c?(0,t.jsx)("div",{style:{width:65,height:65,borderRadius:"50%",overflow:"hidden"},children:(0,t.jsxs)("svg",{width:"65",height:"65",viewBox:"0 0 100 100",style:{display:"block"},children:[(0,t.jsx)("polygon",{points:"0,0 100,0 0,100",fill:"#0a0a0a"}),(0,t.jsx)("polygon",{points:"100,0 100,100 0,100",fill:"white"})]})}):(0,t.jsx)("div",{className:"rounded-full",style:{width:65,height:65,backgroundColor:1===c?"#0a0a0a":"white"}})})]})}e.s(["default",0,function(){return(0,t.jsxs)("section",{className:"relative bg-gradient-to-b from-green-950 to-green-900 text-white py-24 px-6 overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute inset-0 overflow-hidden opacity-70",children:(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(16, 176px)"},children:Array.from({length:64},(e,r)=>(0,t.jsx)(s,{},r))})}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-green-950/40 to-green-900/40"}),(0,t.jsxs)("div",{className:"relative z-10 max-w-4xl mx-auto text-center",children:[(0,t.jsx)("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold leading-tight tracking-tight mb-6 text-white [text-shadow:0_0_60px_rgba(0,0,0,1),0_0_30px_rgba(0,0,0,1),0_2px_4px_rgba(0,0,0,1)]",children:"The Expanded Othello AI Arena"}),(0,t.jsx)("p",{className:"text-lg sm:text-xl text-white mb-4 leading-relaxed [text-shadow:0_0_40px_rgba(0,0,0,1),0_0_16px_rgba(0,0,0,1),0_1px_3px_rgba(0,0,0,1)]",children:"Evaluating Intelligent Systems Through Constrained Adaptation to Unseen Conditions"}),(0,t.jsx)("div",{className:"flex flex-wrap justify-center gap-x-6 gap-y-2 text-white text-base mt-8 mb-4 [text-shadow:0_0_24px_rgba(0,0,0,1),0_1px_3px_rgba(0,0,0,1)]",children:[{name:"Byunghwa Yoo",href:"https://scholar.google.com/citations?user=XIIINK4AAAAJ&hl=en"},{name:"Sundong Kim",href:"https://sundong.kim/"},{name:"Kyung-Joong Kim",href:"https://scholar.google.com/citations?user=YBYE93sAAAAJ&hl=en"}].map(({name:e,href:r})=>(0,t.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"hover:text-white underline underline-offset-2 decoration-slate-500 hover:decoration-white transition-colors",children:e},e))}),(0,t.jsx)("div",{className:"flex justify-center mb-10",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 bg-amber-500/20 border border-amber-400/40 rounded-full px-4 py-1.5 text-amber-300 text-sm font-medium [text-shadow:0_0_16px_rgba(0,0,0,1)]",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-amber-400 inline-block"}),"Transactions on Machine Learning Research (TMLR) · June 2026"]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-4",children:[(0,t.jsxs)("a",{href:"https://openreview.net/forum?id=WXKQtqPC2d",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-white hover:bg-gray-100 text-green-950 font-medium px-6 py-2.5 rounded-lg transition-colors text-sm",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Read Paper"]}),(0,t.jsxs)("a",{href:"https://github.com/blakeyoo/ExpandedOthello-AEC",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 bg-gray-900 hover:bg-gray-800 text-white font-medium px-6 py-2.5 rounded-lg transition-colors text-sm",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"
1currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{d:"M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z"})}),"Environment"]})]})]})]})}])},43956,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(94912);function l(e,t){return e.board[0].flat().join("")+e.board[1].flat().join("")+e.currentPlayer+t[0]+","+t[1]}let a=[[6,6],[8,8],[10,10]],s=[[6,6],[8,8],[10,10],[6,8],[8,6]],i={easy:[-.01,1.01],medium:[-.01,.2,.8,1.01],hard:[-.01,.2,.4,.6,.8,1.01]};function o(e){if(e<=0)return[{lo:0,hi:50,type:"win"},{lo:50,hi:100,type:"lose"}];if(e>=1)return[{lo:0,hi:50,type:"lose"},{lo:50,hi:100,type:"win"}];let t=Math.round(100*e);return e>.5?[{lo:0,hi:100-t,type:"draw"},{lo:100-t,hi:50,type:"lose"},{lo:50,hi:t,type:"win"},{lo:t,hi:100,type:"draw"}]:[{lo:0,hi:t,type:"draw"},{lo:t,hi:50,type:"win"},{lo:50,hi:100-t,type:"lose"},{lo:100-t,hi:100,type:"draw"}]}let d={win:"bg-emerald-500",lose:"bg-red-400",draw:"bg-gray-300"};function c(e){return e<0?{label:"Pure Minority Win",detail:"The player with fewer discs wins. No restrictions."}:0===e?{label:"Minority Win (no wipeout)",detail:"The player with fewer discs wins, but having zero discs = draw."}:1.01===e?{label:"Standard Majority Win",detail:"The player with more discs wins. No restrictions."}:1===e?{label:"Majority Win (no sweep)",detail:"The player with more discs wins, but having all discs = draw."}:e>.5?{label:`Majority Win (50–${Math.round(100*e)}%)`,detail:`Majority wins, but having ${Math.round(100*e)}% or more = draw.`}:{label:`Minority Win (${Math.round(100*e)}–50%)`,detail:`Minority wins, but having ${Math.round(100*e)}% or less = draw.`}}let h={boardSize:[8,8],obstacles:[],winCond:1.01},u=[-.01,.2,.4,.6,.8,1.01],m=[0,20,40,60,80,100];function x({guessIndex:e,onGuess:n,blackRatio:l,disabled:a}){let s=(0,r.useRef)(null),i=(0,r.useRef)(!1),c=(0,r.useRef)("green"),h=null!==e?o(u[e]):[],g=null!==e?m[e]:null;function f(e){if(!s.current)return 0;let t=s.current.getBoundingClientRect();return Math.max(0,Math.min(100,(e-t.left)/t.width*100))}function p(e){return m.reduce((t,r,n)=>Math.abs(r-e)<Math.abs(m[t]-e)?n:t,0)}return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-gray-400 uppercase tracking-widest mb-2",children:"Guess The Winning Condition"}),(0,t.jsxs)("div",{ref:s,className:`relative h-4 select-none ${a?"":"cursor-ew-resize"}`,style:{touchAction:"none"},onPointerDown:function(t){if(a)return;let r=f(t.clientX);c.current=Math.abs(r-(null!==e?m[e]:50))<=Math.abs(r-(null!==e?100-m[e]:50))?"green":"red",i.current=!0,t.currentTarget.setPointerCapture(t.pointerId)},onPointerMove:function(e){if(a||!i.current)return;let t=f(e.clientX);n("green"===c.current?p(t):p(100-t))},onPointerUp:function(){i.current=!1},children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-gray-200 overflow-hidden pointer-events-none",children:h.map((e,r)=>(0,t.jsx)("div",{className:`absolute h-full ${d[e.type]}`,style:{left:`${e.lo}%`,width:`${e.hi-e.lo}%`}},r))}),null!==g&&(0,t.jsx)("div",{className:`absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-7 h-7 rounded-full bg-emerald-500 border-2 border-white shadow-md z-10 pointer-events-none flex items-center justify-center ${!a?"ring-4 ring-emerald-300 animate-[pulse_0.8s_ease-in-out_infinite]":""}`,style:{left:`${g}%`},children:!a&&(0,t.jsx)("span",{className:"text-white text-sm font-bold leading-none select-none",children:"↔"})}),null!==g&&(0,t.jsx)("div",{className:`absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-7 h-7 rounded-full bg-red-400 border-2 border-white shadow-md z-10 pointer-events-none flex items-center justify-center ${!a?"ring-4 ring-red-300 animate-[pulse_0.8s_ease-in-out_infinite]":""}`,style:{left:`${100-g}%`},children:!a&&(0,t.jsx)("span",{className:"text-white text-sm font-bold leading-none select-none",children:"↔"})}),void 0!==l&&(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 rounded-full bg-indigo-500 border-2 border-white shadow z-20 pointer-events-none",style:{left:`${l}%`}})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-gray-400 mt-1",children:[(0,t.jsx)("span",{children:"0%"}),(0,t.jsx)("span",{children:"50%"}),(0,t.jsx)("span",{children:"100%"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-[10px] text-gray-400 flex-wrap",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 inline-block"}),"Win zone"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-red-400 inline-block"}),"Lose zone"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-gray-300 inline-block"}),"Draw zone"]}),(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-indigo-500 
1inline-block"}),"Your Disc Ratio"]})]})]})}let g={easy:"Easy",medium:"Medium",hard:"Hard"};e.s(["default",0,function(){let e,m,f,p,b,[y,w]=(0,r.useState)(!0),[v,j]=(0,r.useState)("easy"),[N,M]=(0,r.useState)("easy"),[$,k]=(0,r.useState)(()=>(0,n.createGame)(h)),[C,T]=(0,r.useState)(h),[A,S]=(0,r.useState)(1.01),[_,P]=(0,r.useState)(!1),[z,E]=(0,r.useState)(!1),[W,I]=(0,r.useState)(0),[R,Y]=(0,r.useState)(!1),[G,B]=(0,r.useState)(null),[L,O]=(0,r.useState)(5),D=(0,r.useCallback)(e=>{let{config:t,k:r}=function(e){let t="easy"===e?[[8,8]]:"medium"===e?a:s,r=t[Math.floor(Math.random()*t.length)],l=i[e],o=l[Math.floor(Math.random()*l.length)];if("easy"===e)return{config:{boardSize:r,obstacles:[],winCond:o},k:o};for(let e=0;e<20;e++){let e=function(e,t){let r=Math.floor(e/2)-1,n=Math.floor(t/2)-1,l=new Set([`${r},${n}`,`${r},${n+1}`,`${r+1},${n}`,`${r+1},${n+1}`]),a=[];for(let r=0;r<Math.floor(e/2);r++)for(let n=0;n<Math.floor(t/2);n++)[...new Map([[r,n],[r,t-1-n],[e-1-r,n],[e-1-r,t-1-n]].map(e=>[`${e[0]},${e[1]}`,e])).values()].every(([e,t])=>!l.has(`${e},${t}`))&&a.push([r,n]);let s=1+Math.floor(Math.random()*Math.min(a.length,3)),i=[...a].sort(()=>Math.random()-.5).slice(0,s),o=new Set;for(let[r,n]of i)for(let[l,a]of[[r,n],[r,t-1-n],[e-1-r,n],[e-1-r,t-1-n]])o.add(`${l},${a}`);return[...o].map(e=>e.split(",").map(Number))}(r[0],r[1]),t={boardSize:r,obstacles:e,winCond:o},l=(0,n.createGame)(t);if((0,n.validMoves)(l,1).length>0||(0,n.validMoves)(l,-1).length>0)return{config:t,k:o}}return{config:{boardSize:r,obstacles:[],winCond:o},k:o}}(e);T(t),S(r),P(!1),E(!1),I(0),Y(!1),O(5),k((0,n.createGame)(t))},[]),K=(0,r.useCallback)(()=>{I(e=>e+1),Y(!1),P(!1),k((0,n.createGame)(C))},[C]),H=(0,r.useCallback)(()=>{P(!0),null!==L&&u[L]===A&&E(!0)},[L,A]);(0,r.useEffect)(()=>{D("easy")},[]),(0,r.useEffect)(()=>{if($.done||(0,n.validMoves)($).length>0)return;let e=1===$.currentPlayer?-1:1;if(0===(0,n.validMoves)($,e).length)k(e=>({...e,done:!0}));else{let t=setTimeout(()=>k(t=>({...t,currentPlayer:e})),400);return()=>clearTimeout(t)}},[$]),(0,r.useEffect)(()=>{if($.done||-1!==$.currentPlayer||0===(0,n.validMoves)($).length)return;Y(!0);let e=setTimeout(()=>{let e="hard"===N?function(e,t=100,r=1.4,a=30){let s=(0,n.validMoves)(e);if(0===s.length)return null;if(1===s.length)return s[0];let i=new Map,o=new Map;for(let s=0;s<t;s++){let t=e,s=[];for(;;){let e=(0,n.validMoves)(t);if(0===e.length){let e=1===t.currentPlayer?-1:1;if(0===(0,n.validMoves)(t,e).length)break;t={...t,currentPlayer:e};continue}let a=1+e.reduce((e,r)=>e+(i.get(l(t,r))??0),0),h=e[0],u=-1/0;for(let n of e){var d,c;let e=(d=o.get(l(t,n))??0,c=i.get(l(t,n))??0,0===c?1/0:d/c+r*Math.sqrt(Math.log(a)/c));e>u&&(u=e,h=n)}let m=l(t,h);if(s.push(m),t=(0,n.step)(t,h[0],h[1]),(i.get(m)??0)===0)break}let h=function(e,t){let r=e,l=0;for(;!r.done&&l<t;){let e=(0,n.validMoves)(r);if(0===e.length){let e=1===r.currentPlayer?-1:1;if(0===(0,n.validMoves)(r,e).length)break;r={...r,currentPlayer:e};continue}let t=e[Math.floor(Math.random()*e.length)];r=(0,n.step)(r,t[0],t[1]),l++}return(0,n.getWinner)(r)}(t,a);for(let e of s)i.set(e,(i.get(e)??0)+1),-1===h?o.set(e,(o.get(e)??0)+1):0===h&&o.set(e,(o.get(e)??0)+.5)}let h=s[0],u=-1;for(let t of s){let r=i.get(l(e,t))??0;r>u&&(u=r,h=t)}return h}($):(0,n.randomMove)($);e&&k(t=>(0,n.step)(t,e[0],e[1])),Y(!1)},650);return()=>clearTimeout(e)},[$]);let J=new Set((0,n.validMoves)($).map(([e,t])=>`${e},${t}`)),U=(0,n.getScores)($),F=$.done?(0,n.getWinner)($):null,V=!$.done&&1===$.currentPlayer&&!R,X=U.black+U.white,q=X>0?(U.black/X*100).toFixed(1):"—",Q=X>0?(U.white/X*100).toFixed(1):"—",Z=X>0?U.black/X*100:50,ee=Math.min(52,Math.floor(400/Math.max($.h,$.w)));return(0,t.jsx)("section",{id:"demo",className:"bg-white py-20 px-6",children:(0,t.jsx)("div",{className:"max-w-6xl mx-auto",children:y?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-80 py-16 text-center space-y-6",children:[(0,t.jsx)("div",{className:"text-6xl font-black tracking-tight text-slate-300 select-none",children:"???"}),(0,t.jsxs)("div",{className:"space-y-4 max-w-xl",children:[(0,t.jsx)("p",{className:"text-2xl font-bold text-gray-900 leading-snug",children:"You don't know how to win."}),(0,t.jsx)("p",{className:"text-xl font-bold text-gray-900 whitespace-nowrap",children:"How many games will you need to figure out how to win?"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 leading-relaxed",children:"The winning condition is hidden — this isn't standard Othello. No hints. Just play and figure it out."})]}),(0,t.jsx)("button",{onClick:()=>w(!1),className:"px-8 py-3 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold rounded-lg transition-colors text-sm",children:"Accept the Challenge →"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h2",{className:"text-2xl font-bold text-center mb-1 text-gray-900",children:"Interactive Demo"}),(0,t.jsx)("p",{className:"text-gray-500 text-center text-sm mb-12 max-w-xl mx-auto",children:"How many trials do you need to figure out the winning strategy?"}),(0,t.jsxs)("div",{className:"flex flex-col lg:flex-row items-start justify-center gap-8",children:[(0,t.jsxs)("div",{className:"relative flex items-center justify-center shrink-0",style:{width:416,height:416},children:[$.done&&(e=A<.5,m=0===W,f=0===F&&U.black===U.white,p=z?"Can you win again? Did you find the optimal strategy?":-1===F&&m&&e?"Not a Bug — This is NOT the typical Othello y
1ou know.":-1===F&&m&&!e?"Can you beat the AI in the next round?":1===F&&m&&!e?"Can you win again? This game may have SPECIAL rules.":1===F&&m&&e?"Not a Bug — This is NOT the typical Othello you know.":m&&f?"Hmph. Same number of discs...":m?"You are in the SPECIAL draw zone. Can you figure that out by yourself?":1===F||-1===F?`You tried ${W+1} times — Can you guess the winning condition?`:f?`You tried ${W+1} times — Same number of discs.`:`You tried ${W+1} times — You are on the special draw zone.`,b=null!==L&&u[L]===A,(0,t.jsxs)("div",{className:`absolute inset-0 z-10 flex flex-col items-center justify-center rounded gap-3 px-8 text-center ${_?"bg-white/80":"bg-white/95"}`,children:[(0,t.jsx)("p",{className:`text-4xl font-black ${1===F?"text-emerald-500":-1===F?"text-red-500":"text-gray-500"}`,children:1===F?"You Win!":-1===F?"You Lose!":"Draw!"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:p.split(/(SPECIAL)/g).map((e,r)=>"SPECIAL"===e?(0,t.jsx)("span",{className:"font-bold text-indigo-600",children:e},r):e)}),(0,t.jsx)("div",{className:"w-full mt-1",children:(0,t.jsx)(x,{guessIndex:L,onGuess:O,disabled:_||z,blackRatio:Z})}),z&&(0,t.jsx)("p",{className:"relative z-40 text-sm font-semibold text-indigo-600",children:c(A).label}),_||z?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:K,className:"relative z-40 mt-2 px-10 py-2.5 bg-indigo-600 hover:bg-indigo-500 text-white font-semibold rounded-lg transition-colors text-sm",children:"Try Again →"}),(0,t.jsx)("button",{onClick:()=>D(v),className:z?"relative z-40 px-6 py-2 bg-red-600 hover:bg-red-500 text-white font-semibold rounded-lg transition-colors text-sm":"relative z-40 text-gray-400 hover:text-gray-600 text-sm transition-colors",children:"New Game"})]}):(0,t.jsx)("button",{onClick:H,className:"relative z-40 mt-2 px-10 py-2.5 bg-yellow-500 hover:bg-yellow-400 text-gray-900 font-semibold rounded-lg transition-colors text-sm",children:"Submit Guess"}),_&&(0,t.jsx)("div",{className:"absolute inset-0 z-30 flex items-center justify-center bg-white/80 rounded",children:(0,t.jsx)("p",{className:`text-2xl font-black ${b?"text-emerald-500":"text-red-500"}`,children:b?"✓ Correct!":"✗ Wrong! Try Again?"})})]})),(0,t.jsx)("div",{className:"border-2 border-gray-700 shadow-lg",style:{display:"grid",gridTemplateColumns:`repeat(${$.w}, ${ee}px)`,gridTemplateRows:`repeat(${$.h}, ${ee}px)`,width:ee*$.w,height:ee*$.h},children:Array.from({length:$.h},(e,r)=>Array.from({length:$.w},(e,l)=>{let a=1===$.board[0][r][l],s=1===$.board[1][r][l],i=1===$.board[2][r][l],o=J.has(`${r},${l}`),d=G?.[0]===r&&G?.[1]===l;return(0,t.jsx)("div",{className:["flex items-center justify-center border border-black/20 transition-colors",i?"bg-gray-500":d&&o&&V?"bg-green-500":"bg-green-700",o&&V?"cursor-pointer":""].join(" "),style:{width:ee,height:ee},onClick:()=>{$.done||1!==$.currentPlayer||R||(0,n.isValidMove)($,r,l)&&k(e=>(0,n.step)(e,r,l))},onMouseEnter:()=>B([r,l]),onMouseLeave:()=>B(null),children:i?(0,t.jsx)("div",{className:"rounded bg-gray-600",style:{width:.7*ee,height:.7*ee}}):a?(0,t.jsx)("div",{className:"rounded-full bg-gray-950 shadow-inner",style:{width:.78*ee,height:.78*ee}}):s?(0,t.jsx)("div",{className:"rounded-full bg-white shadow",style:{width:.78*ee,height:.78*ee}}):o&&V?(0,t.jsx)("div",{className:"rounded-full bg-white/40",style:{width:.32*ee,height:.32*ee}}):null},`${r}-${l}`)}))})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-5 w-80",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-400 uppercase tracking-widest",children:"Trial"}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-base font-bold text-white bg-indigo-600/80 px-3 py-1 rounded-md",children:W+1})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-400 uppercase tracking-widest",children:"Win Condition"}),z?(0,t.jsx)("span",{className:"text-sm font-semibold text-indigo-600",children:c(A).label}):(0,t.jsx)("span",{className:"text-sm font-bold text-white bg-red-500/80 px-3 py-1 rounded-md",children:"???"})]}),(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-400 uppercase tracking-widest",children:"Disc Count / Ratio"}),(0,t.jsxs)("div",{className:"space-y-2 text-sm font-medium text-gray-700",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-4 h-4 rounded-full bg-gray-950 inline-block shadow shrink-0"}),(0,t.jsx)("span",{children:"You (Black)"}),(0,t.jsx)("span",{className:"ml-auto font-semibold",children:U.black}),(0,t.jsxs)("span",{className:"text-gray-400 text-xs",children:["(",q,"%)"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"w-4 h-4 rounded-full bg-white border border-gray-300 inline-block shadow-sm shrink-0"}),(0,t.jsx)("span",{children:"AI (White)"}),(0,t.jsx)("span",{className:"ml-auto font-semibold",children:U.white}),(0,t.jsxs)("span",{className:"text-gray-400 text-xs",children:["(",Q,"%)"]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"relative h-2 w-full rounded-full bg-gray-200",children:[(0,t.jsx)("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:z?o(A).map((e,r)=>(0,t.jsx)("div",{className:`absolute h-full ${d[e.type]}`,style:{left:`${e.lo}%`,width:`${e.hi-e.lo}%`}},r)):($.done||W>0)&&null!==L?o(u[L]).map((e,r)=>(0,t.jsx)("div",{className:`absolute h-full ${d[e.type]} opacity-50`,style:{left:`${e.lo}%`,width:`${e.hi-e.lo}%`}},r)):null}),(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3 h-3 rounded-full bg-indigo-500 shadow z-10 transition-all duration-300",style:{left:`${Z}%`}})]}),(0,t.jsxs)("div",{className:"flex justify-between text-[10px] text-gray-400 mt-1",children:[(0,t.jsx)("span",{children:"0%"}),(0,t.jsx)("span",{children:"50%"}),(0,t.jsx)("span",{children:"100%"})]})]}),(0,t.jsx)("div",{className:"text-sm min-h-5",children:!$.done&&(R?(0,t.jsx)("span",{className:"text-gray-400 animate-pulse",children:"AI is thinking…"}):1===$.currentPlayer?(0,t.jsx)("span",{className:"text-gray-600",children:"Your turn"}):(0,t.jsx)("span",{className:"text-gray-400",children:"AI's turn"}))}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-gray-400 uppercase tracking-widest mb-2",children:"Environment Difficulty"}),(0,t.jsx)("div",{className:"flex rounded-lg border border-gray-200 overflow-hidden text-sm font-medium",children:["easy","medium","hard"].map(e=>(0,t.jsx)("button",{onClick:()=>{j(e),D(e)},className:`flex-1 py-2 transition-colors ${v===e?"bg-indigo-600 text-white":"bg-white text-gray-500 hover:bg-gray-50"}`,children:g[e]},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-gray-400 uppercase tracking-widest mb-2",children:"Opponent Difficulty"}),(0,t.jsx)("div",{className:"flex rounded-lg border border-gray-200 overflow-hidden text-sm font-medium",children:["easy","hard"].map(e=>(0,t.jsx)("button",{onClick:()=>M(e),className:`flex-1 py-2 transition-colors capitalize ${N===e?"bg-indigo-600 text-white":"bg-white text-gray-500 hover:bg-gray-50"}`,children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]})]})]})]})})})}],43956)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.