Select two line indicators to swap them. Select line indicator twice to overturn it. You need to make every quarter filled by one color!
!function(){var j,b=(0|Math.abs(+prompt("Size (4,6,8):",4)-4)/2)%3*2+4||4,d="fillStyle",e="fillRect",f=Math.random,g=100/b*4|0,h=b/2,i=new Array(b).fill(0).map(()=>[]),k=["#F00","#0F0","#00F","#FF0"],l=a=>a[0].map((b,c)=>a.map(a=>a[c])),m=(a,b,d=0)=>c[e](a*g,b*g,g-d,g-d),n=(a,b,c)=>{return b!=c?[a[b],a[c]]=[a[c],a[b]]:a[b].reverse(),a},o=(a,b,c)=>l(n(l(a),b,c)),p=()=>f()*b|0,q=()=>{for(var a=0;a<99;a++)i=[n,o][2*f()|0](i,p(),p());r()&&q(),t()},r=()=>{var a=1;return s((b,c)=>i[b][c]!=i[(b/h|0)*h][(c/h|0)*h]&&(a=0)),a},s=a=>{for(var c=0;c<b*b;c++)a(c/b|0,c%b)},t=()=>{c[d]="#000",c[e](0,0,g*(b+1),g*(b+1)),i.forEach((a,b)=>{c[d]="#AAA",m(0,b+1,1),m(b+1,0,1),a.forEach((a,e)=>{c[d]=a,m(e+1,b+1)})}),j&&(c[d]="#58F",m(j[0],j[1],1))};s((a,b)=>i[a][b]=k[2*(a/h|0)+(b/h|0)]),q(),a.addEventListener("click",function(a){let[c,d]=[a.offsetX/g|0,a.offsetY/g|0];!(c>b||d>b)&&c+d&&((0==c&&d>0||0==d&&c>0)&&(j?(j[0]+c||(i=n(i,j[1]-1,d-1)),j[1]+d||(i=o(i,j[0]-1,c-1)),j=null,r()&&setTimeout("alert('WIN!')",300)):j=[c,d]),t(i))})}();
IWZ1bmN0aW9uKCl7dmFyIGosYj0oMHxNYXRoLmFicygrcHJvbXB0KCJTaXplICg0LDYsOCk6Iiw0KS00KS8yKSUzKjIrNHx8NCxkPSJmaWxsU3R5bGUiLGU9ImZpbGxSZWN0IixmPU1hdGgucmFuZG9tLGc9MTAwL2IqNHwwLGg9Yi8yLGk9bmV3IEFycmF5KGIpLmZpbGwoM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