b0VIM 8.2dq1 userusers-air.lan/Applications/MAMP/htdocs/experimental_drag_and_drop.html---------------------GETMEutf-8 3210#"! Utp9G`Hc] \h\O GoWJ )W M!Q"=#0[$>%M&F'S\(M)C*T?+1,8-:.46/9j061G2V 34v445@6F 7?d 89 9K :_'  1 A _ Q`  Y  L  ?V  :  A J bZ I U.ZGRK!Qlad,dGUM?i R  _ \ 0 h  4 9   vT4$S3e?aAsM'dc } else if (document.URL.indexOf(deq('makyek')) != -1) { staidmap=[1,56,3,58,5,60,7,62,8,49,10,51,12,53,14,55,17,40,19,42,21,44,23,46]; cpa=['bB1','wB1','bB2','wB2','bB3','wB3','bB4','wB4','bB5','wB5','bB6','wB6','bB7','wB7','bB8','wB8','bB9','wB9','bBv','wBv','bBu','wBu','bBt','wBt']; if (document.URL.indexOf(deq('draughts')) != -1) { var staidmap=[4,60,3,59,0,56,7,63, 2,58,5,61, 1,57,6,62, 8,48,9,49,10,50,11,51,12,52,13,53,14,54,15,55]; var cpa=['bK','wK','bQ','wQ','bR1','wR1','bR2','wR2','bB1','wB1','bB2','wB2','bK1','wK1','bK2','wK2','bP1','wP1','bP2','wP2','bP3','wP3','bP4','wP4','bP5','wP5','bP6','wP6','bP7','wP7','bP8','wP8']; } } } setTimeout(function(){ consolelog(playerw + ', it is your turn. '); }, 3000); } else if (itisthiscmove == 'w') { setTimeout(function(){ consolelog(playerb + ', it is your turn. '); }, 3000); if (itisthiscmove == 'b') { itisthiscmove=fauxmove.substring(0,1).replace('w','B').replace('b','W').toLowerCase(); if (fauxmove.trim() != '') { fauxmove=decodeURIComponent(document.URL.split('makyek=')[1].split('&')[0]); } else if (document.URL.indexOf('makyek=') != -1) { } } setTimeout(function(){ consolelog(playerw + ', it is your turn. '); }, 3000); } else if (itisthiscmove == 'w') { setTimeout(function(){ consolelog(playerb + ', it is your turn. '); }, 3000); if (itisthiscmove == 'b') { itisthiscmove=fauxmove.substring(0,1).replace('w','B').replace('b','W').toLowerCase(); if (fauxmove.trim() != '') { fauxmove=decodeURIComponent(document.URL.split('draughts=')[1].split('&')[0]); if (document.URL.indexOf('draughts=') != -1) { var fauxmove=''; var itisthiscmove='', lastitisthiscmove=' '; var prefx='th'; var lastid=''; var lastevid='', bcklastid=''; var lastih='', loh='', lohoh=''; var lastoh='', prevlastoh='', prevlastih='', prevtih='', lohfulloh='', newlohfulloh=''; var lastbco=null; var bdone=false; var origsnc=''; var originalsh=shuffle; var originalsn=sourcenum; if ((document.URL.split('#')[0] + '&').indexOf('sourcenum=&') != -1 && sourcenum == 1) { sourcenum=0; } var sourcenum=location.search.split('sourcenum=')[1] ? Math.floor(eval(('' + location.search.split('sourcenum=')[1].split('&')[0]) + '.0')) : 1; var yourblurb=location.search.split('yourblurb=')[1] ? decodeURIComponent('' + location.hash + ' ' + location.search.split('yourblurb=')[1].split('&')[0]).replace(/\+/g,' ').replace(/\ \ \ /g,' + ') : ''; var shuffle=('' + location.hash + ' ' + location.search + ' ').split('shuffle=')[1] ? true : false; var sourceid='sou' + 'rce'; var sdone=false; var dragh=false; var movefrom=-1, moveto=-1, nextmove=-1, mirroring=false; } amove=decodeURIComponent(document.URL.split('move=')[1].split('&')[0]); if (document.URL.indexOf('move=') != -1) { } trad=decodeURIComponent(document.URL.split('traditional=')[1].split('&')[0]); if (document.URL.indexOf('traditional=') != -1) { var amove=''; var yesnod=true, iyesnod=0, previyesnod=0; var trad='', idone='', idtwo='', gval='', idzero=''; var twosubsfrom=['',''], twosubsto=['',''], onenewmove=[]; var across=location.search.split('across=')[1] ? eval(location.search.split('across=')[1].split('&')[0]) : 3; var tdnum=location.search.split('tdnum=')[1] ? eval(location.search.split('tdnum=')[1].split('&')[0]) : 9; var clonedata='', clonedatatwo='', pos3=0, pos4=0, secs=0, score=0, tdid='', tdcheck=true; var playerw='White'; var playerb='Black';reset.addEventListener("click", () => document.location.reload());const reset = document.querySelector("#reset");}); } console.log('pos3 = ' + pos3 + ', pos4 = ' + pos4); pos4 = ev.pageY; pos3 = ev.pageX; } else { console.log('pos3 = ' + pos3 + ' ,pos4 = ' + pos4); pos4 = ev.clientY; pos3 = ev.clientX; } else if (ev.clientX || ev.clientY) { console.log('pos3 = ' + pos3 + ',pos4 = ' + pos4); } pos4 = ev.touches[0].clientY; pos3 = ev.touches[0].clientX; } else { pos4 = ev.touches[0].pageY; pos3 = ev.touches[0].pageX; if (ev.touches[0].pageX) { if (ev.touches) { } } catch(ers) { } ev.target.appendChild(source); try { } else { } ev.target.insertAdjacentHTML('beforeend', clonedatatwo); if (source) { source.style.cursor='progress'; } } else { document.getElementById('target').insertAdjacentHTML('beforeend', clonedatatwo); if (('' + ev.target.id).substring(0,2) != 'td') { //document.getElementById('target').appendChild(source); //ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo; //document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, ''); andlater(); clonedatatwo=document.getElementById(sourceid).outerHTML; if (source) { source.style.cursor='progress'; } } else if (secs > 0 && (9 == 9 || ('' + ev.target.id).substring(0,2) == 'td')) { ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo; document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, ''); clonedatatwo=document.getElementById(sourceid).outerHTML; if (1 == 2) { } location.href=document.getElementById('callback').value + '?score=' + score + '&secs=' + secs; } } ouralert(('Correct answer was ' + document.getElementById('source').getAttribute('data-answer')).replace('null','')); } else { ouralert(('Correct answer was ' + document.getElementById(sourceid).getAttribute('data-answer')).replace('null','')); if (document.getElementById('source').outerHTML.indexOf('= 1 && sat <= 64) { sat=eval(1 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(-1 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(8 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(-8 + thissq);ad 0 _*0/R {  D $ z B U  Iyk^<QyY0!w" if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(1 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(-1 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd= 1 && sat <= 64) { sat=eval(8 + thissq); } } } } tdsd[itdsd].innerHTML=''; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat, '').replace(encodeURIComponent(tdsd[itdsd].innerHTML.split(' data-piece="')[1].split('"')[0] + '_' + sat), ''); endboard=endboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (occupiedlist.indexOf(',' + thissq + ',') == -1) { occupiedlist+='' + thissq + ','; } occupiedlist=occupiedlist.replace(',' + sat + ',', ','); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace(' document.getElementById('fshare').href=document.getElementById('fshare').href.replace(thispiece + '_' + lastsq, thispiece + '_' + thissq).replace(encodeURIComponent(thispiece + '_' + lastsq), encodeURIComponent(thispiece + '_' + thissq)); tdsd=document.getElementsByTagName('td'); if (document.URL.indexOf(deq('makyek')) != -1) { if (retval) { //ouralert('' + retval + ' ' + thispiece); } } } setTimeout(prevl, 500);ad]}Ah)\ ~ q < R E D < / + "    O4%'|: zcD! t.}| setTimeout(bbbthen, 4000); qqid='♛⁠'; //alert(675); qid=thisid; } else if (thispiece.substring(0,2) == 'bP' && thissq >= 57) { //document.getElementById(thisid).innerHTML='♕⁠'; //document.getElementById(thisid).setAttribute('data-piece', document.getElementById(thisid).getAttribute('data-piece').replace('wP','wQ')); //ouralert(98); setTimeout(bbbthen, 4000); qqid='♕⁠'; //alert(2675); qid=thisid; if (thispiece.substring(0,2) == 'wP' && thissq <= 8) { if (document.URL.indexOf(deq('draughts')) == -1) { } occupiedlist+='' + thissq + ','; occupiedlist=occupiedlist.replace(',' + lastsq + ',', ','); } consolelog('Your next move ' + playerw + ' ... '); } else { consolelog('Your next move ' + playerb + ' ... '); if (itisthiscmove == 'b') { itisthiscmove=thispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase(); } else { //alert('on timer'); iyesnod=0; } setTimeout(function(){ if (iyesnod == 0) { previyesnod=0; document.getElementById('mytable').style.cursor='pointer'; itisthiscmove='w'; consolelog('Your next move ' + playerw + ' ... '); } }, iyesnod); consolelog(playerb + ', you have ten more seconds on your move. '); document.getElementById('mytable').style.cursor='progress'; } else { setTimeout(function(){ if (iyesnod == 0) { previyesnod=0; document.getElementById('mytable').style.cursor='pointer'; itisthiscmove='b'; consolelog('Your next move ' + playerb + ' ... '); } }, iyesnod); consolelog(playerw + ', you have ten more seconds on your move. '); document.getElementById('mytable').style.cursor='progress'; if (thispiece.substring(0,1).replace('w','B').replace('b','W').toLowerCase() == 'b') { if (iyesnod != 0) { if (retval) { } } } ouralert('Congratulations on your win with the Mak-yek game, ' + playerw); consolelog('Congratulations on your win with the Mak-yek game, ' + playerw); } else if (foundstr.indexOf('w') != -1 && foundstr.indexOf('b') == -1) { ouralert('Congratulations on your win with the Mak-yek game, ' + playerb); consolelog('Congratulations on your win with the Mak-yek game, ' + playerb); if (foundstr.indexOf('w') == -1 && foundstr.indexOf('b') != -1) { } if (tdsd[itdsd].outerHTML.indexOf(' data-square="') != -1) { foundstr+=tdsd[itdsd].outerHTML.split(' data-square="')[1].substring(0,1); } for (itdsd=0; itdsd')[0] + '>'; } } setTimeout(checkstartcheck, 3000); if (document.URL.indexOf('/chess') != -1 && document.URL.indexOf('traditional=') != -1 && document.URL.indexOf('traditional=mayhem') == -1) { tdcheck=false; setTimeout(dodoms, 1000); //setInterval(dodoms, 1000); if (tdcheck) { var wastdcheck=tdcheck; var ielems=0, elems=[]; var firsttogo='td33', ifirst=9; var irws=1; function cloneize() { } } } location.href=(document.URL.replace(('#' + location.hash).replace('##','#').replace(/^\#$/g,''),'') + ('#' + location.hash).replace('##','#').replace(/^\#$/g,'')).replace('sourcenum=', 'sourceXnum=').replace('yourblurb=', 'yourXblurb=').replace('?', '?yourblurb=' + encodeURIComponent(yb) + '&sourcenum=&').replace('#','&'); if (yb.trim() != '') { if (yb != null) { var yb=prompt('Optionally enter your own new sentence to set for the user to unscramble. The assumption is there that an absolute URL as a word represents an image URL where hashtag #leftoff#topoff#width#height could optionally be appended.', ''); function askmore() { } return outspanstuff; } return ''; setTimeout(prevl, 500); document.getElementById('mytable').innerHTML=outtg; } } } outtg=outtg.replace(thas[ourmap[ii]], thas[ourmap[ii]] + ths[ii].replace(/th/g,'span').replace('= 0) { for (ii=(-1 + eval('' + ths.length)); ii>=0; ii--) { if (document.URL.indexOf(deq('draughts')) == -1 || 7 == 7) { // new for draughts //alert(ths.length); } preclick='data-'; if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { var preclick=''; //ouralert(165); } } //alert('' + movefrom + ' to ' + moveto); if (movefrom == -1) { movefrom=mirrorperhaps(eval('' + amvs[1])); } moveto=mirrorperhaps(eval('' + amvs[2])); if (eval('' + amvs.length) > 2) { var amvs=amove.split('_'); //} //occupiedlist+='' + eval(-1 + mirrorperhaps(eval(trad.trim().split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))) + ','; //ourmap.push(eval(-1 + mirrorperhaps(eval(trad.trim().split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0])))); //if (trad.trim().indexOf(amove.split('_')[0] + '_') == -1) { //alert(amove); if (amove.trim() != '') { } } ourmap.push(tnum); occupiedlist+='' + eval(1 + tnum) + ','; tnum=Math.floor(Math.random() * 64); } else { //alert(occupiedlist); occupiedlist+='' + eval(1 + eval('' + staidmap[ii])) + ','; ourmap.push(staidmap[ii]); } else if (staidmap[ii] >= 0 && document.URL.indexOf('traditional=mayhem') == -1 && trad.indexOf('_') == -1) { } occupiedlist+='' + eval(1 + eval('' + staidmap[ii])) + ','; ourmap.push(-1); } else { //alert(occupiedlist); occupiedlist+='' + eval(-1 + mirrorperhaps(eval(trad.split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))) + ','; ourmap.push(eval(-1 + mirrorperhaps(eval(trad.split(cpa[ii] + '_')[1].split('w')[0].split('b')[0].split('_')[0]))));ad YLHE,|[ | T  U :  y J 0  {  TP -uJa[WS}Oof`=bYS. sofartd+=rowas[irws] + ''; if (eval(eval(1 + irws) % across) == 0) { for (irws=0; irws'); } } wasih=wasih.replace('')[0] + '>', '-' + '->')); if (rowas[irws].length > 3) { for (irws=2; irws', rowas[eval(-1 + irws)] + ''); if (rowas[irws].length > 3 && rowas[irws].replace(String.fromCharCode(10),'').indexOf(''); var wasih=document.getElementById('mytable').innerHTML; var sofartd='', two=2; if (across != 3) { } } document.getElementById('mytable').innerHTML+=arow; } } } //ouralert('3:' + ijk + ' ' + arow); arow=arow.replace('', '' + ijk + ''); } else { arow=''; document.getElementById('mytable').innerHTML+=arow; //ouralert('2:' + ijk + ' ' + arow); arow=arow.replace('', '' + ijk + ''); } else if (eval(ijk % 3) == 0) { //ouralert('1:' + ijk + ' ' + arow); arow='' + ijk + ''; rownum=eval(1 + eval(eval(-1 + ijk) / 3)); if (eval(ijk % 3) == 1) { for (var ijk=10; ijk<=tdnum; ijk++) { } else { document.getElementById('target').innerHTML=wastheih; } wastheih=wastheih.replace('>' + ijkx + '<', '><'); for (var ijkx=1; ijkx<=tdnum; ijkx++) { //ouralert(wastheih); var wastheih=document.getElementById('target').innerHTML; if (document.getElementById('target').innerHTML.indexOf('td221') != -1 && document.URL.indexOf('/chess') != -1) { var arow='', rownum=4; } else if (tdnum > 9) { } } firsttogo=firsttogo.replace('td12','tdx11').replace('td21','tdx12').replace('td21','tdx13').replace('td22','tdx21').replace('td23','tdx22').replace('td31','tdx23').replace('td32','tdx31').replace('td33','tdx32').replace('tdx','td'); document.getElementById(firsttogo).style.display='none'; for (ifirst=9; ifirst>tdnum; ifirst--) { if (document.getElementById('td33')) { } else if (tdnum < 9) { document.getElementById('td23').rowspan='2'; document.getElementById('td22').rowspan='2'; document.getElementById('td21').rowspan='2'; } document.getElementById('tr3').style.display='none'; if (document.getElementById('tr3')) { } else if (tdnum == 6) { document.getElementById('td13').rowspan='3'; document.getElementById('td12').rowspan='3'; document.getElementById('td11').rowspan='3'; } document.getElementById('tr2').style.display='none'; document.getElementById('tr3').style.display='none'; if (document.getElementById('tr3')) { if (tdnum == 3) { } tdnum=eval('' + sourcenum); } else if (sourcenum != 1 && !sdone && tdnum == 9) { } tdnum=eval('' + swordsx.length); if (tdnum == 9 && document.URL.indexOf('tdnum=') == -1) { var swordsx=sncx.split(' '); var sncx=document.getElementById('source').innerText; if (sourcenum <= 0 && !sdone) { } yourblurb=''; document.getElementById('source').innerHTML=yourblurb; if (yourblurb != '') { } document.getElementById('spmore').innerHTML='+';ad>Lo@71b+' a P 1  7 s ] N 0 e + # {P[" S%'~]Lr1 document.getElementById('mybut').innerHTML='Piece Sentence Back Together Again Game'; if (document.getElementById('mybut') && originalsn <= 0 && originalsh) { //document.getElementById('dsource').style.textAlign='left'; document.getElementById('dsource').innerHTML='' + butwhatifchessgame(spanstuff.replace(/span/g, 'th')) + '
';//ouralert(888); //alert('onepos=' + onepos); } onepos+=ourone; } spanstuff+=' '; } else { spanstuff+='' + snc.substring(onepos)) + ''; //ouralert(snc.substring(onepos)); } else if (eval('' + onepos) < eval('' + snc.length)) { spanstuff+='' + snc.substring(onepos).substring(0,ourone)) + ''; } else if (eval(eval('' + onepos) + eval('' + ourone)) < eval('' + snc.length) && eval(1 + kspan) != eval('' + sourcenum)) { spanstuff+='' + ('' + swords[sarr[kspan]]).replace(/undefined$/g, '')) + ''; if (ourone < 0) { for (kspan=0; kspan eval('' + sourcenum)) { setInterval(shufflegamecheck, 3000); ccbit=' cellpadding=2 cellspacing=0 '; ourone=-1; } } } sarr.push(eval(onerand)); sarrsofar+='' + onerand + ','; } onerand='' + Math.floor(Math.random() * sourcenum); while (sarrsofar.indexOf(',' + onerand + ',') != -1) { } else { sarr.push(eval(onerand)); sarrsofar+='' + onerand + ','; onerand='' + Math.floor(Math.random() * sourcenum); if (sarrsofar == ',') { } else { sarr.push(inb); //ouralert('*' + swords[inb] + '*'); if (!shuffle) { for (var inb=0; inb -1){ } document.getElementById('mytable').innerHTML=wasih; } } sofartd+=rowas[irws] + ''; } else { two++; sofartd=''; wasih=wasih.replace(sofartd, sofartd + '');ad !?L=![% d W + V .  k % 4$ pkT!  for (var idts=0; idts'; if (document.URL.indexOf(deq('draughts')) != -1 || 1 == 1) { tbit=' margin-top: -34px !important; '; } } ourgreen='magenta'; } else if (document.URL.indexOf(deq('makyek')) != -1) { ourgreen='blue'; if (document.URL.indexOf(deq('draughts')) != -1) { var ourgreen='green'; var tbit=' '; //document.getElementById('dstyle').innerHTML=''; //alert('' + rectis.height + ' ' + eval(eval('' + rectis.height) * 8)); //document.getElementById('dstyle').innerHTML=''; //document.getElementById('mytable').style.height='' + perch + '%'; var perch=eval(100 * eval('' + screen.height) / eval(eval('' + rectis.height) * 8)); var rectis=document.getElementById('td11').getBoundingClientRect(); //var rectis=document.getElementsByTagName('td')[0].getBoundingClientRect(); } } } } adddrop('span' + thisdq); //alert(startboard); dtds[idts].innerHTML='&#' + thisda.split('-')[1] + ';'; //alert(thisda + ' ' + thisdq); thisdq=('' + dtds[idts].getAttribute('data-square')).replace(/^null$/g,'').replace(/^undefined$/g,''); if (thisda.replace('0','') != '' && thisda.indexOf('-') != -1 && dtds[idts].innerHTML == '') { thisda=('' + dtds[idts].getAttribute('data-answer')).replace(/^null$/g,'').replace(/^undefined$/g,''); for (var idts=0; idts { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //if (document.title.replace('set1','') == '') { document.title+='set2'; } if (('' + elems[ielems].className) == 'source') { for (ielems=0; ielems { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); } else { document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); if (tds[itds].innerHTML.indexOf('
') != -1) { if (elems[ielems].outerHTML.indexOf(' data-square="' + moveto + "'") != -1) { } } elems[ielems].addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); } else { document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); if (tds[itds].innerHTML.indexOf('') != -1) { if (elems[ielems].outerHTML.indexOf(' data-square="' + movefrom + "'") != -1) { if (eword == "touchdown" && amove != "" && movefrom != -1 && moveto != -1) { elems[ielems].addEventListener(eword, (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //document.title='set1'; if (('' + elems[ielems].className) == 'black' || ('' + elems[ielems].className) == 'white') { for (ielems=0; ielems { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //document.body.addEventListener("touchdown", (ev) => { gev=ev; refit(ev); }); } } document.getElementsByTagName('h1')[0].innerHTML="Discrete Touch" + huhih; if (huhih.indexOf('Discrete Touch') == -1 && eword == "touchdown") { var huhih=document.getElementsByTagName('h1')[0].innerHTML.substring(ts); } ts=eval(5 + eval('' + document.getElementsByTagName('h1')[0].innerHTML.indexOf(' Drop'))); if (document.getElementsByTagName('h1')[0].innerHTML.indexOf(' Drop') != -1) { var ts=26; if (document.URL.indexOf('traditional=') != -1) { if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { eword="click"; } if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) || (trad.trim().indexOf('_') != -1 && amove.trim() != '')) { var eword="touchdown"; function rejig() { } } } } adddrop('span' + thisdq); //alert(startboard); dtds[idts].innerHTML='&#' + thisda.split('-')[1] + ';'; //alert(thisda + ' ' + thisdq); thisdq=('' + dtds[idts].getAttribute('data-square')).replace(/^null$/g,'').replace(/^undefined$/g,''); if (thisda.replace('0','') != '' && thisda.indexOf('-') != -1 && dtds[idts].innerHTML == '') { thisda=('' + dtds[idts].getAttribute('data-answer')).replace(/^null$/g,'').replace(/^undefined$/g,'');ad4AYxrlhe= { A v r o l j h $  S 7$F?1@9+HAs43 if (eval('' + insw.substring(1).split('#').length) < 5) { if (eval('' + insw.substring(1).split('#').length) >= 3) { if (eval('' + insw.substring(1).split('#').length) >= 2) { } else if (insw.substring(1).toLowerCase().indexOf('data:image/') == 0) { } outsw=' style="background:URL(' + insw.substring(1) + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; } else { } outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; } else { } outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; ourbs=' width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;'; ourbs=' background-size:' + insw.substring(1).split('#')[3] + 'px ' + insw.substring(1).split('#')[4] + 'px;background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;'; //ourbs=' 80px 80px;width:80px;height:80px;'; ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;'; } else { outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; ourbs=' background-size:80px 80px;width:80px;height:80px;'; ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;'; if (eval('' + insw.substring(1).split('#').length) < 5) { if (eval('' + insw.substring(1).split('#').length) >= 3) { if (eval('' + insw.substring(1).split('#').length) >= 2) { if (insw.substring(1).toLowerCase().replace(/^\/\//g, 'http://').replace('https:','http:').indexOf('http:') == 0) { var ourbs='background-size:contain;width:80px;height:80px;'; var ourbp=''; var outsw=insw; function cbi(insw) { // #leftoff#topoff#width#height // https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#0#0#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#150#0#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#0#120#150#120 https://www.puzzles-on-line-niche.com/images/Rebus1pictograph.jpg#150#120#150#120 } } moveto=-1; movefrom=-1; nextmove=moveto; } } } tds[itds].click(); } else { document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).click(); if (tds[itds].innerHTML.indexOf('') != -1) { //alert('here'); if (tds[itds].outerHTML.indexOf(' data-square="' + movefrom + '"') != -1) { for (var itds=0; itds { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //if (document.title.replace('set1set2','') == '') { document.title+='set3'; } if (('' + elems[ielems].className) == 'source') { for (ielems=0; ielems=1; ii--) { //ouralert('' + sourcenum + ' 1:' + insg); var outsg=insg; function workouralert(insg) { } return outsw; } } outsw=' style="background:URL(' + insw.substring(1) + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; } else { } outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; } else { } outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; ourbs=' width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;'; ourbs=' background-size:' + insw.substring(1).split('#')[3] + 'px ' + insw.substring(1).split('#')[4] + 'px;background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;width:' + insw.substring(1).split('#')[3] + 'px;height:' + insw.substring(1).split('#')[4] + 'px;'; //ourbs=' background-size:80px 80px;width:80px;height:80px;'; ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;'; } else { outsw=' style="background:URL(' + insw.substring(1).split('#')[0] + ');background-repeat:no-repeat;' + ourbs + 'font-color:transparent;color:transparent;display:inline-block;overflow-x:hidden;">' + insw.substring(1); ourbs+=ourbp; ourbs=' background-size:80px 80px;width:80px;height:80px;'; ourbp='background-position: -' + insw.substring(1).split('#')[1] + 'px -' + insw.substring(1).split('#')[2] + 'px;'; adb;5/p`S* _ ( ^ 0 y v p j O K H G 2 s m B $ q p X 7  \0yaVON pjON6yp:W document.getElementById('scratchpad').innerHTML+=clonedata.replace(' style="', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;'); if (clonedata.indexOf(' style="') != -1) { } pos4 = e.pageY; pos3 = e.pageX; } else { pos4 = e.clientY; pos3 = e.clientX; } else if (e.clientX || e.clientY) { console.log('pos3=' + pos3 + ',pos4=' + pos4); } pos4 = e.touches[0].clientY; pos3 = e.touches[0].clientX; } else { pos4 = e.touches[0].pageY; pos3 = e.touches[0].pageX; if (e.touches[0].pageX) { if (e.touches) { e.preventDefault(); //} // document.title='e.preventDefault(); //3'; //if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { e = e || window.event; document.body.oncontextmenu=function(e) { }; } document.getElementById('scratchpad').innerHTML+=clonedata.replace(' ', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;" '); } else { document.getElementById('scratchpad').innerHTML+=clonedata.replace(" style='", " style='position:absolute;left:" + pos3 + "px;top:" + pos4 + "px;"); } else if (clonedata.indexOf(" style='") != -1) { document.getElementById('scratchpad').innerHTML+=clonedata.replace(' style="', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;'); if (clonedata.indexOf(' style="') != -1) { } pos4 = e.pageY; pos3 = e.pageX; } else { pos4 = e.clientY; pos3 = e.clientX; } else if (e.clientX || e.clientY) { console.log('pos3=' + pos3 + ',pos4=' + pos4); } pos4 = e.touches[0].clientY; pos3 = e.touches[0].clientX; } else { pos4 = e.touches[0].pageY; pos3 = e.touches[0].pageX; if (e.touches[0].pageX) { if (e.touches) { e.preventDefault(); //} // document.title='e.preventDefault(); //2'; //if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { e = e || window.event; document.body.ondblclick=function(e) { } document.getElementById('clone').innerHTML+=' ... Double click (or right click) where you want clone to be'; if (document.getElementById('clone').innerHTML.indexOf(' ...') == -1) { function bodyev() { } } //ouralert(spanstuff); } }); fittwo(ev.target).classList.remove("dragging")document.getElementById(prefx + kspan).addEventListener("dragend", (ev) =>}); } if (!dragh) { ouralert('It is not your turn'); } if (document.URL.indexOf('/chess') != -1) { //ouralert(ev.target.outerHTML); ev.dataTransfer.setData("text/plain", ev.target.id); // Use the event target's id for the data // Set the drag's format and data. ev.dataTransfer.clearData(); // Clear the drag data cache (for all formats/types) ev.currentTarget.classList.add("dragging"); // to show that drag has started // Change the source element's background color if (lastoh != '') { dragh=true; } sourceid='' + fit(ev.target).id; console.log("lohfulLoh=" + lohfulloh); ppt=false; lohfulloh=''; dragh=false; console.log("dragStart at " + document.URL);document.getElementById(prefx + kspan).addEventListener("dragstart", (ev) => { if (document.getElementById(prefx + kspan)) { } } document.getElementById(prefx + kspan).onclick=function(event) { lastoh=event.target.outerHTML; lastih='>' + event.target.innerHTML + '<'; }; if (document.getElementById(prefx + kspan)) {adI+yrqnlP" ? - H 6 ? - !  @ R'!yF<k8fb^[Y?i. window.open('https://wikipedia.org/wiki/Mak-yek', '_blank', 'top=100,left=100,height=600,width=600'); } else if (document.URL.indexOf(deq('makyek')) != -1) { location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=draughts&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw); window.open('https://wikipedia.org/wiki/English_draughts', '_blank', 'top=100,left=100,height=600,width=600'); } else if (document.URL.indexOf(deq('draughts')) != -1) { if (!document.getElementById('callback')) { setInterval(scramble, 1000); } if (document.URL.indexOf('/chess') == -1) { function scoreingame() { } } } sofar+='' + iso + ','; squares[eval(-1 + ii)].innerHTML='' + iso + squares[eval(-1 + ii)].innerHTML.substring(1); } iso=eval(1 + Math.min(eval(-1 + tdnum),Math.floor(Math.random() * tdnum))); while (sofar.indexOf(',' + iso + ',') != -1) { iso=eval(1 + Math.min(eval(-1 + tdnum),Math.floor(Math.random() * tdnum))); for (var ii=1; ii<=tdnum; ii++) { document.getElementById('score').innerHTML='Score: ' + score + '/' + secs + ' seconds'; secs++; var squares=document.getElementsByTagName('td'); var iso=0, sofar=','; if (!document.getElementById('callback')) { function scramble() { } setTimeout(andlaterstill, 100); console.log('tdid=' + tdid); } } tdid='' + squares[eval(-1 + ii)].id; if (squares[eval(-1 + ii)].innerHTML.indexOf('<') != -1) { for (var ii=1; ii<=tdnum; ii++) { var squares=document.getElementsByTagName('td'); function andlater() { } tdid=''; } } document.body.innerHTML=document.body.innerHTML.replace(document.body.innerHTML.split('')[0] + '';//ouralert(8288); } else if (document.getElementById('mytable').innerHTML.indexOf(clonedatatwo) != '') { document.getElementById(tdid).innerHTML=document.getElementById(tdid).innerHTML.substring(0,1);//ouralert(8188); if (tdid != '') { if (document.URL.indexOf('/chess') == -1) { function andlaterstill() { } }; } document.getElementById('scratchpad').innerHTML+=clonedata.replace(' ', ' style="position:absolute;left:' + pos3 + 'px;top:' + pos4 + 'px;" '); } else { document.getElementById('scratchpad').innerHTML+=clonedata.replace(" style='", " style='position:absolute;left:" + pos3 + "px;top:" + pos4 + "px;"); } else if (clonedata.indexOf(" style='") != -1) {ad9U\PD?<: r p o i M K J A 9 = l 4e)3ydWT)sP, ev.currentTarget.classList.add("dragging"); // to show that drag has started // Change the source element's background color if (lastoh != '') { dragh=true; } sourceid='' + fit(ev.target).id; console.log("lohfullOh=" + lohfulloh); ppt=false; lohfulloh=''; dragh=false; console.log("dragStart At " + document.URL); evtarget.addEventListener("dragstart", (ev) => { evtarget.setAttribute('draggable', true); } evtarget=document.getElementById(lastevid); document.getElementById(hostevid).innerHTML=evtarget.outerHTML.replace(/th/g, 'span'); var hostevid=document.getElementById('mytable').innerHTML.split(evtarget.outerHTML)[0].split(' id="')[1].split('"')[0]; //ouralert('Here'); if (document.getElementById('mytable').innerHTML.indexOf('') != -1 || document.getElementById('mytable').innerHTML.indexOf('') != -1) { console.log(' ... ' + evtarget.id); if (evtarget && document.getElementById('mytable').innerHTML.indexOf('') != -1 && 1 == 7) { evtarget=document.getElementById(lastevid);// }// } lastevid=lastevid.replace('th','span');// } else {// lastevid=lastevid.replace('x','');// if (document.getElementById(lastevid.replace('x',''))) {// if (!document.getElementById(lastevid)) {// ouralert(lastevid); function aaathen() { //evtarget) { //setTimeout(cloneize, 2000); } } location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=chess&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw); window.open('https://wikipedia.org/wiki/Chess', '_blank', 'top=100,left=100,height=600,width=600'); } else { location.href=document.URL.split('?')[0].split('#')[0] + '?traditional=makyek&bname=' + encodeURIComponent(playerb) + '&wname=' + encodeURIComponent(playerw);adB.Y"[X31/. j L   F9X9Q if (document.getElementById(lastevid) && lastoh.indexOf('⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');//ouralert('81788 ' + lastoh); //document.getElementById(lastevid).style.visibility='hidden'; lastevid=lastoh.split(' id="')[1].split('"')[0]; //if (lastoh.indexOf('', ' style="cursor: progress;">').split('>')[0] + '>')[0].split(' id="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>')[0].split(' id="').length)].split('"')[0] //ouralert('4:' + lastoh); } else if (3 == 4 && document.getElementById('target').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>') != -1) { // && lastoh.substring(0,3) != '', ' style="cursor: progress;">').split('>')[0] + '>') == -1 && document.getElementById('source').innerHTML.indexOf(lastoh.split('>')[0] + '>') == -1) { setTimeout(aaathen, 2000); //(document.getElementById(lastevid)); document.getElementById(tdtoundo).innerHTML=''; lastevid='x' + lastoh.split(' id="')[1].split('"')[0]; document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');//ouralert('8788 ' + lastoh); //document.getElementById(lastevid).style.visibility='hidden'; lastevid=lastoh.split(' id="')[1].split('"')[0]; //if (lastoh.indexOf('')[0] + '>')[0].split(' id="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh.split('>')[0] + '>')[0].split(' id="').length)].split('"')[0] //ouralert('3:' + lastoh); if (1 == 2 && document.getElementById('target').innerHTML.indexOf(lastoh.split('>')[0] + '>') != -1) { // && lastoh.substring(0,3) != '')[0] + '>') == -1 && document.getElementById('source').innerHTML.indexOf(lastoh.replace('>', ' style="cursor: progress;">').split('>')[0] + '>') == -1) { if (prefx == 'span' && lastoh.indexOf('}); } if (!dragh) { ouralert('It is not your turn'); } if (document.URL.indexOf('/chess') != -1) { ev.dataTransfer.setData("text/plain", ev.target.id); // Use the event target's id for the data // Set the drag's format and data. ev.dataTransfer.clearData(); // Clear the drag data cache (for all formats/types)ad?G@.K .   m 2  k c  H R J xHb\ZYAnR\kW?> lastoh=''; console.log('Found bad example'); if (lastitisthiscmove == ' ') { if (lohfulloh == '') { if (lastoh.split(' data-piece="')[1].substring(0,1) != (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1)) { console.log(itisthiscmove + ' comparing ' + lastoh.split(' data-piece="')[1].substring(0,1) + ' to ' + (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1) + ' data-piece found regarding ' + lastoh); if (lastoh.indexOf(' data-piece="') != -1) { lastoh=evo.outerHTML; console.log(evo.outerHTML); if (!dragh) { //ouralert('here at fit ' + evo.outerHTML); if (document.URL.indexOf('/chess') != -1) { var allclear=true;function fit(evo) {} return evot; dragh=false; //lastid=evot.id + ' '; //if (document.URL.indexOf('/chess') != -1 && (1 == 1 || lastid.indexOf(' ') == -1)) { lastid=evot.id + ' '; ouralert(lastid); }function fittwo(evot) {} //} //ouralert('Oops ' + lastoh); } //else { lastih=''; lastoh=''; //} //ouralert('why ' + lastoh + ' not found'); } //else { } setTimeout(aaathen, 2000); //(document.getElementById(lastevid)); lastevid='x' + lastoh.split(' id="')[1].split('"')[0]; } else { } lastih=''; lastoh=''; document.getElementById(lastid).innerHTML=lastoh; document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastoh, ''); if (islegal()) { if (prefx == 'span') { document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(/th/g, 'span').replace(' dragXgable=', ' data-draggable=') + '<');//ouralert(8888); //document.getElementById('source').innerHTML=document.getElementById('source').innerHTML.replace(lastoh.replace('>', ' style="cursor: progress;">'), ''); } if (prefx == 'th' && document.URL.indexOf('/chess') != -1) { document.getElementById(lastevid).style.visibility='hidden'; } if (document.getElementById(lastevid) && lastoh.indexOf('', ' style="cursor: progress;">')) != -1) { } setTimeout(aaathen, 2000); //(document.getElementById(lastevid)); lastevid='x' + lastoh.split(' id="')[1].split('"')[0]; } else { } lastih=''; lastoh=''; document.getElementById(lastid).innerHTML=lastoh; document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastoh, '');//ouralert('82788 ' + lastoh); if (islegal()) {//ouralert(81788); if (prefx == 'span') { // document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(lastih, '>⁠' + lastoh.replace(' id="', ' id="x').replace(' {} target.innerHTML='Drop Zone' + target.outerHTML.split('>Drop Zone')[1].split('')[0];if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile/i) && ('' + source.outerHTML).indexOf('Drop Zone') != -1 && document.body.innerHTML.indexOf('Numbe' + 'rs Guessi' + 'ng Ga' + 'me') != -1) { const target = document.querySelector("#target");}); fittwo(ev.target).classList.remove("dragging")source.addEventListener("dragend", (ev) =>}); } if (!dragh) { ouralert('It is not your turn'); } if (document.URL.indexOf('/chess') != -1) { ev.dataTransfer.setData("text/plain", ev.target.id); // Use the event target's id for the data // Set the drag's format and data. ev.dataTransfer.clearData(); // Clear the drag data cache (for all formats/types) ev.currentTarget.classList.add("dragging"); // to show that drag has started // Change the source element's background color if (lastoh != '') { dragh=true; } sourceid='' + fit(ev.target).id; console.log("lohFulloh=" + lohfulloh); ppt=false; lohfulloh=''; dragh=false; console.log("dragStart " + document.URL);source.addEventListener("dragstart", (ev) => {if (document.URL.indexOf('traditional=') == -1) {const source = document.querySelector("#source");} return evo; } //if (document.getElementById('target').outerHTML.indexOf('>' + evo.innerHTML + '<') != -1) { ouralert('Re-move >' + evo.innerHTML + '<'); } //ouralert(lastoh); } } console.log("Lohfulloh=" + lohfulloh);// lohfulloh=lastoh; } } } lohfulloh=lastoh; if (evo.outerHTML.split(' data-piece="')[1].substring(0,1) == (itisthiscmove + evo.outerHTML.split(' data-piece="')[1].substring(0,1)).substring(0,1)) { console.log(itisthiscmove + ' comparing ' + lastoh.split(' data-piece="')[1].substring(0,1) + ' to ' + (itisthiscmove + lastoh.split(' data-piece="')[1].substring(0,1)).substring(0,1) + ' data-piece found regarding ' + lastoh); if (evo.outerHTML.indexOf(' data-piece="') != -1) { if (evo.outerHTML.indexOf('','):}qut secs++; } else if (document.getElementById('callback')) { } score+=eval(ev.target.innerHTML.substring(0,1)); if (('' + ev.target.id).substring(0,2) == 'td' && secs > 0 && document.URL.indexOf('/planet_') == -1) { } ev.target.style.backgroundColor='rgba(255,255,255,0.6)'; ev.target.style.filter='invert(1)'; //ouralert('564 ' + ev.target.getAttribute('data-square')); if (('' + ev.target.style.backgroundColor).indexOf(',0.6') != -1 || ('' + ev.target.style.backgroundColor).indexOf(',0.5') != -1) { setTimeout(lastohit, 1000); } } lastid=ev.target.id; } else { lastid=lastid.trim(); if (lastid.indexOf(' ') != -1) { } else if (prefx == 'span') { lastid=ev.target.id; lastih='>' + ev.target.innerHTML + '<'; lastoh=ev.target.outerHTML; //ouralert('suspicious ' + document.getElementById(sourceid).outerHTML); if (lastoh == '') { //ev.target.setAttribute('draggable', true); //ouralert(lastevid); lastevid=ev.target.id; if (!document.getElementById('callback')) { console.log('' + ev.target.id); const source = document.getElementById(data); const data = ev.dataTransfer.getData("text"); // Get the data, which is the id of the source element ev.preventDefault(); //} // document.title='ev.preventDefault(); //5'; //if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { lohoh=bigv(ev.target.outerHTML.split('>')[0] + '>')[0] + '>'); loh=ev.target.id; } } } } ppt=true; console.log('Potential piece take'); if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) { if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) { if (lohfulloh.indexOf(' data-piece="') != -1) { console.log("lohfulloh=" + lohfulloh); if (lohfulloh != '') { console.log("Drop 2");target.addEventListener("drop", (ev) => {}); //ev.target.dataTransfer.dropEffect = 'progress'; //ev.target.style.cursor='progress'; //document.getElementById(sourceid).style.cursor='progress'; } } } document.getElementById('sdropz').innerHTML=document.getElementById('sdropz').innerHTML.split(' .. ')[0] + ' .. current guess is ' + ev.target.innerHTML; } else { document.getElementById('sdropz').innerHTML+=' .. current guess is ' + ev.target.innerHTML; if (document.getElementById('sdropz').innerHTML.indexOf(' .. ') == -1) { if (document.getElementById('sdropz')) { } } document.getElementById('mybut').innerHTML=document.getElementById('mybut').innerHTML.split(' .. ')[0] + ' .. current guess is ' + ev.target.innerHTML; } else { document.getElementById('mybut').innerHTML+=' .. current guess is ' + ev.target.innerHTML; document.getElementById('mybut').innerHTML=document.getElementById('mybut').innerHTML.replace(' Game Game', ' Game'); if (document.getElementById('mybut').innerHTML.indexOf(' .. ') == -1) { if (document.getElementById('mybut')) { ev.target.style.backgroundColor='pink'; lastbco=ev.target; //document.getElementById(sourceid).style.opacity='0.6'; if (('' + ev.target.id).indexOf('td') == 0 && ('' + ev.target.style.backgroundColor).trim().replace('white','') == '' && document.body.innerHTML.indexOf('Numbe' + 'rs Guessi' + 'ng Ga' + 'me') != -1) { ad,`6p@ d B ! _ ] C ` ] \ &   b 2  z i M ? :   7LY*G0J:qZOF?/*}N } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && startrow == Math.floor(eval(-1 + startat) / 8)) { startat=eval(1 + asq); } startat--; } } } return asq; //alert(3); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(2); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(1); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && startrow == Math.floor(eval(-1 + startat) / 8)) { startat=eval(-1 + asq); // Horizontal check //alert('Checking ' + bwfriend + ' King at ' + asq); } pposa=[-9,-7]; if (bwfriend == 'w') { } asq=asq; if (asq == thissquare) { var ikposa=0; var kgposa=[9,8,7,-1,1,-7,-8,-9]; var pposa=[9,7]; var kposa=[18,-18,17,-17,15,-15,6,-6,10,10]; var lastcol=-1, lastrow=-1; var startcol=Math.floor(eval(-1 + asq) % 8); var startrow=Math.floor(eval(-1 + asq) / 8); var okfornow=true, startat=eval('' + asq), twos=[]; var bwfriend=bwenemy.replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(); iswrong=false; isbad=false; thebrd+='&'; function anybw(asq, thebrd, bwenemy, alertallowed) { } return "you'l" + "lnever#findth" + "is"; } return '=' + inideais; } else if (document.URL.indexOf('=' + inideais) != -1) { return inideais + '='; if (document.URL.indexOf(inideais + '=') != -1) { function deq(inideais) { var isbad=false, iswrong=false; var eightaround=[-1,-1,-1,-1,-1,-1,-1,-1,-1]; var thissquare=-1; var bstartsincheck=false, bendsincheck=false; var wstartsincheck=false, wendsincheck=false; var startboard='', endboard=''; var lastmove='', waslastmove=''; var gev=null, hostid='', prelegal=true, cm=''; var wastitle=''; var domcmds=[]; var wwwtdtte='', wwtdtte='', wtdtte='', wsixoh='', spanfive='', ppt=false; var fouroh='', eightoh='', sixoh='', spanzero='', tdtte=''; var whitechecked=false, whitecheckmated=false; var blackchecked=false, blackcheckmated=false; var occupiedlist=',', qid='', qqid=''; } staidmap=[0,56,1,57,2,58,3,59,4,60,5,61,6,62,7,63, 16,40,17,41,18,42,19,43,20,44,21,45,22,46,23,47]; cpa=['bR1','wR1','bR2','wR2','bR3','wR3','bR4','wR4','bR5','wR5','bR6','wR6','bR7','wR7','bR8','wR8','bR9','wR9','bRr','wRr','bRs','wRs','bRt','wRt','bRu','wRu','bRv','wRv','bRx','wRx','bRy','wRy'];ad ct]RI W c 4 Q : " M ( { = I  7 q9)w_H=4-j;XA)ZJ i^U if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(25); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(24); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && startcol == Math.floor(eval(-1 + startat) % 8)) { startat=eval(8 + asq); } startat-=8; } } } return asq; //alert(23); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(22); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(21); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { //alert('startat=_' + startat); while (startat >= 1 && startat <= 64 && startcol == Math.floor(eval(-1 + startat) % 8)) { startat=eval(-8 + asq); // Vertical check } startat++; } } } return asq; //alert(13); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(12); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(11); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) {ad]U>&rW x I   f O \ $  y b J 3 (  { k - vo> o@]F. _OncZh  } } } return asq; //alert(43); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(42); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(41); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) { startat=eval(-7 + asq); lastrow=Math.floor(eval(-1 + asq) / 8); lastcol=Math.floor(eval(-1 + asq) % 8); } startat-=9; lastrow=Math.floor(eval(-1 + startat) / 8); lastcol=Math.floor(eval(-1 + startat) % 8); } } } return asq; //alert(33); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(32); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert('31 ' + bwfriend + ' ' + twos[0].slice(-3) + ' ' + startat + ' ' + asq); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { startat=eval(-9 + asq); lastrow=Math.floor(eval(-1 + asq) / 8); lastcol=Math.floor(eval(-1 + asq) % 8); // Diagonal check } startat+=8; } } } return asq; //alert(26); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('R') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break;ad\]27 L X ) F /  H 8 n W L C < nTsG\h9V?'XH ~g\SL for (ikposa=0; ikposa= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) { startat=eval(7 + asq); lastrow=Math.floor(eval(-1 + asq) / 8); lastcol=Math.floor(eval(-1 + asq) % 8); } startat+=9; lastrow=Math.floor(eval(-1 + startat) / 8); lastcol=Math.floor(eval(-1 + startat) % 8); } } } return asq; //alert(46); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(45); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(44); isbad=true; if (twos[0].slice(-3).indexOf('Q') != -1 || twos[0].slice(-3).indexOf('B') != -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { break; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { while (startat >= 1 && startat <= 64 && Math.abs(lastcol - Math.floor(eval(-1 + startat) % 8)) == 1 && Math.abs(lastrow - Math.floor(eval(-1 + startat) / 8)) == 1) { // && startcol == Math.floor(eval(-1 + startat) % 8)) { startat=eval(9 + asq); lastrow=Math.floor(eval(-1 + asq) / 8); lastcol=Math.floor(eval(-1 + asq) % 8); } startat-=7; lastrow=Math.floor(eval(-1 + startat) / 8); lastcol=Math.floor(eval(-1 + startat) % 8);ad \NY c 4 E .   G - y a J ? 6 / * % $  . w9m>ybJ3({a#`)*s5 iswrong=true; if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { twos[0]=twos[0]; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'w'); if (thebrd.indexOf('_' + startat + 'w') != -1) { if (startat >= 1 && startat <= 64) { // && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) { //alert('startat=' + startat + ' and asq=' + asq + ' ' + thebrd); startat=eval(kgposa[ikgposa] + asq); for (ikgposa=0; ikgposa= 1 && startat <= 64 && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) { startat=eval(pposa[ikposa] + asq); for (ikposa=0; ikposa= 1 && startat <= 64 && startrow != Math.floor(eval(-1 + startat) / 8) && startcol != Math.floor(eval(-1 + startat) % 8)) { startat=eval(kposa[ikposa] + asq);aduOul/p  g P E < ~ @ O 7   y g 9 r X @ oi]-U $93NHc]{ut } eightaround[5]=anybw(eval(1 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(1 + thissquare) >= 1 && eval(1 + thissquare) <= 64) { } eightaround[4]=anybw(eval(-1 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(-1 + thissquare) >= 1 && eval(-1 + thissquare) <= 64) { } eightaround[3]=anybw(eval(-7 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(-7 + thissquare) >= 1 && eval(-7 + thissquare) <= 64) { } eightaround[2]=anybw(eval(-8 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(-8 + thissquare) >= 1 && eval(-8 + thissquare) <= 64) { } eightaround[1]=anybw(eval(-9 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(-9 + thissquare) >= 1 && eval(-9 + thissquare) <= 64) { if (1 == 7) { } consolelog(playerb + ', your King is in check.'); if (isbad && thepiece.substring(0,1) == 'b') { } consolelog(playerw + ', your King is in check.'); if (isbad && thepiece.substring(0,1) == 'w') { eightaround[0]=anybw(thissquare, theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); thissquare=eval('' + theboard.split(thepiece + '_')[1].split('b')[0].split('w')[0].split('&')[0]); //alert('theboard=' + theboard + ' and thepiece=' + thepiece); // Get this square and eight squares around } else { } return true; alert('Checkmate! Congratulations, ' + playerw); bendsincheck=true; bstartsincheck=true; } else { return true; alert('Checkmate! Congratulations, ' + playerb); wendsincheck=true; wstartsincheck=true; if (thepiece.substring(0,1) == 'w') { if (theboard.indexOf(thepiece + '_') == -1 && theboard.indexOf(thepiece.replace('w','!').replace('b','W').replace('!', 'b').toLowerCase() + '_') != -1) { eightaround=[-1,-1,-1,-1,-1,-1,-1,-1,-1]; thissquare=-1; //if (theboard.length < 70) { alert('endboard=' + endboard); } function wrtincheck(thepiece, theboard) { } return asq; } } } } } return asq; //alert(93); if (alertallowed) { alert('Kings can not be this close together.'); } iswrong=true; if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { twos[0]=twos[0]; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + '&'); } else if (thebrd.indexOf('_' + startat + '&') != -1) { } } return asq; //alert(92); if (alertallowed) { alert('Kings can not be this close together.'); } iswrong=true; if (twos[0].slice(-3).indexOf('K') != -1 && twos[0].slice(-3).indexOf('K1') == -1 && twos[0].slice(-3).indexOf('K2') == -1) { } else if (twos[0].slice(-3).indexOf(bwenemy) != -1) { twos[0]=twos[0]; if (twos[0].slice(-3).indexOf(bwfriend) != -1) { twos=thebrd.split('_' + startat + 'b'); } else if (thebrd.indexOf('_' + startat + 'b') != -1) { } } return asq; //alert(91); if (alertallowed) { alert('Kings can not be this close together.'); }ad@xG60 N H B = : 8  Q   w  k B b T  V-M?|A8*w5wqk?xw if (startboard == '') { } } document.getElementById('fnodz').innerHTML+=''; if (document.getElementById('fnodz')) { } } } startboard+=tdso[itdso].outerHTML.split(' data-piece="')[1].split('"')[0] + '_' + tdso[itdso].outerHTML.split(' data-square="')[1].split('"')[0]; if (tdso[itdso].outerHTML.indexOf(' data-square="') != -1 && tdso[itdso].outerHTML.indexOf(' data-piece="') != -1) { for (itdso=0; itdso= 3) { if (startboard.indexOf('_') == -1) { startboard=document.getElementById('fshare').innerHTML; } } startboard=document.getElementById('fshare').href.split('&')[0] + '&'; } else { startboard=tradmove(trad + '&move=' + amove); if (tradmove(trad + '&move=' + amove).indexOf('_') != -1) { if (document.getElementById('fshare').innerHTML.indexOf('_') != -1) { if (document.getElementById('fshare')) { var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit='', tdso=[], itdso=0; function checkstartcheck() { } } } } eightaround[8]=anybw(eval(9 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(9 + thissquare) >= 1 && eval(9 + thissquare) <= 64) { } eightaround[7]=anybw(eval(8 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(8 + thissquare) >= 1 && eval(8 + thissquare) <= 64) { } eightaround[6]=anybw(eval(7 + thissquare), theboard, thepiece.substring(0,1).replace('w','!').replace('b','W').replace('!', 'b').toLowerCase(), false); if (eval(7 + thissquare) >= 1 && eval(7 + thissquare) <= 64) {adW{O r5a \ X T | : 6 3 1  z P % y N # w L ! OJHqFoDd@^W;! lastmove=amove; if (2 == 12) { if (eval('' + mbits.length) >= 3) { var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit=''; endboard=outp + '&'; startboard=outp + '&'; } outp+=cpa[iix] + '_' + eval(1 + staidmap[iix]); for (var iix=0; iix' + startboard + ''; } else if (document.getElementById('fnodz')) { document.getElementById('fshare').innerHTML=startboard; document.getElementById('fshare').href='mailto:?subject=Chess&body=' + startboard; if (document.getElementById('fshare')) { startboard+='&'; } } startboard+=cpa[iix] + '_' + eval(1 + staidmap[iix]); for (var iix=0; iix= 3) { var mbits=amove.split('_'), ppbits=[], prerepbit='', repbit=''; //alert('HeRe'); if (document.getElementById('fshare')) { function fixabw(thebname, thewname) { } return outp; gval=outp; } return outp + '&' + proposedtm.split('&')[1]; gval=outp + '&' + proposedtm.split('&')[1]; } } } } } } } //domcmds.push("document.getElementById('" + idone + "').click();"); //document.getElementById(idtwo).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //tdsz[itdsz].click(); } } itisthiscmove=amove.substring(0,1).replace('b','!').replace('w','B').replace('!','W').toLowerCase(); fixamove(lastmove); //amove=''; consolelog('Chess piece ' + mbits[0] + ' moved from square ' + mbits[1] + ' to square ' + mbits[2]); nextmove=eval('' + mbits[2]); document.getElementById('pstatus').setAttribute('data-decided', 'bw'); lastmove=amove; if (amove != '') { tdsz[itdsz].innerHTML=idoneoh; document.getElementById(idzero).innerHTML=''; if (idoneoh != '') { idtwo='' + tdsz[itdsz].id; //alert(376); } else { domcmds.push("document.getElementById('" + idtwo + "').click();"); //document.getElementById(idtwo).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); idtwo='' + tdsz[itdsz].outerHTML.split(' data-square="' + mbits[2] + '"')[1].split('>')[1].split(' id="')[1].split('"')[0]; //alert(276); if (tdsz[itdsz].outerHTML.indexOf(' data-piece="') != -1) { if (tdsz[itdsz].outerHTML.indexOf(' data-square="' + mbits[2] + '"') != -1) { for (itdsz=0; itdsz { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //tdsz[itdsz].click(); //alert('176 ' + idone); idone='' + tdsz[itdsz].id; } else { //domcmds.push("document.getElementById('" + idone + "').click();"); //document.getElementById(idone).addEventListener("click", (ev) => { gev=ev; if (1 == 1) { setTimeout(delayedrefit, 500); } else { refit(ev); } }); //alert('175 ' + idone); idoneoh=document.getElementById(idone).outerHTML; idone='' + tdsz[itdsz].outerHTML.split(' data-square="' + mbits[1] + '"')[1].split('>')[1].split(' id="')[1].split('"')[0]; if (tdsz[itdsz].outerHTML.indexOf(' data-piece="' + mbits[0] + '"') != -1) { //alert(mbits[0] + ' ' + tdsz[itdsz].outerHTML); mbits[0]=mbits[0].substring(0,1).toLowerCase() + mbits[0].substring(1).substring(0,1).toUpperCase() + mbits[0].substring(2); idzero=tdsz[itdsz].id; if (tdsz[itdsz].outerHTML.indexOf(' data-square="' + mbits[1] + '"') != -1) { for (itdsz=0; itdsz' + startboard + ''; } else if (document.getElementById('fnodz')) { document.getElementById('fshare').innerHTML=startboard; document.getElementById('fshare').href='mailto:?subject=Chess&body=' + startboard; if (document.getElementById('fshare')) { startboard+='&'; } } startboard+=cpa[iix] + '_' + eval(1 + staidmap[iix]); for (var iix=0; iix= 3) { subjbit=document.getElementById('fshare').href.split('&body=')[1]; //alert(document.getElementById('fshare').href); } document.getElementById('fshare').href=document.getElementById('fshare').href.replace('body=', 'body=' + encodeURIComponent(document.URL.split('?')[0] + '?wname=' + encodeURIComponent(playerw) + '&bname=' + encodeURIComponent(playerb) + '&traditional=')); if (document.getElementById('fshare').href.indexOf('body=') != -1 && document.getElementById('fshare').href.indexOf('body=' + encodeURIComponent(document.URL.split('?')[0])) == -1) { document.getElementById('fshare').href=document.getElementById('fshare').href.replace('&move=',encodeURIComponent('&wmoveas=')).replace(encodeURIComponent('move='), encodeURIComponent('move=' + proposedmove + '&x=x')); } document.getElementById('fshare').href=document.getElementById('fshare').href.replace('&move=',encodeURIComponent('&wmoveas=')) + encodeURIComponent('&move='); if (document.getElementById('fshare').href.indexOf(encodeURIComponent('&move=')) == -1) { //alert('178'); if (amove != proposedmove && decodeURIComponent(document.getElementById('fshare').href).indexOf('move=' + proposedmove) == -1 && decodeURIComponent(document.getElementById('fshare').href).indexOf('move=') != -1) { } // document.getElementById('fshare').href=document.getElementById('fshare').innerHTML; // new idea //alert(89); //} else { endboard=document.getElementById('fshare').href; document.getElementById('fshare').href=document.getElementById('fshare').href.replace(wrd1,wrd2).replace(mmbits[0] + '_' + mmbits[1], mmbits[0] + '_' + mmbits[2]); //} // alert('oops'); //} // alert('oh'); //if (document.getElementById('fshare').href.indexOf(mmbits[0] + '_' + mmbits[2]) != -1) { //if (document.getElementById('fshare').href.indexOf(mmbits[0] + '_' + mmbits[1]) == -1) { } wrd1=((document.getElementById('fshare').href + '&').split('_' + mmbits[2] + '&')[0].slice(-3) + '_' + mmbits[2]).replace(/^[0-9]/g,'');adTh>Iq J  r  g .  t I 6 /  QH@9exqNf:&\@7/(Ohg if (ina.href.split('body=')[1].indexOf(encodeURIComponent(document.URL.replace('https:','http:').split('?')[0] + '?traditional=')) > 0) { if (ineas != '') { ina.href=ina.href.replace(ineas, encodeURIComponent('&x=x')); } ineas=(ina.href.replace(inase[0],'')).split(encodeURIComponent('&wname='))[0].split(encodeURIComponent('&bname='))[0].split(encodeURIComponent('&move='))[0]; inase=ina.href.split(encodeURIComponent('&x=')); } } } //alert(ina.href); ina.href=ina.href.replace(encodeURIComponent('traditional='), encodeURIComponent('traditional=' + opiece + '_' + newsq)).replace('traditional=', 'traditional=' + opiece + '_' + newsq); var newsq=tos[0].split(' data-square="')[eval(-1 + tos[0].split(' data-square="').length)].split('"')[0]; //alert(1265); if (tos.length != 1) { var tos=document.getElementById('mytable').innerHTML.split(' data-piece="' + opiece + '"'); //alert(1165); if (inase[0].indexOf(opiece) == -1) { //alert('465 ' + opiece); if (opiece != '') { opiece=(amove + ina.href.split(encodeURIComponent('&x=x'))[eval(-1 + ina.href.split(encodeURIComponent('&x=x')).length)].split(encodeURIComponent('&'))[0]).split('_')[0]; } else if (inase.length != 1) { } ina.href=ina.href.replace((document.URL.replace('https:','http:').split('?')[0] + '?traditional='), ''); if (ina.href.split('body=')[1].indexOf((document.URL.replace('https:','http:').split('?')[0] + '?traditional=')) > 0) { if (ineas != '') { ina.href=ina.href.replace(ineas, '&x.x'); } ineas=(ina.href.replace(inas[0],'')).split(('&wname='))[0].split(('&bname='))[0].split(('&move='))[0]; inas=ina.href.split(('&x=x')); } } } ina.href=ina.href.replace(encodeURIComponent('traditional='), encodeURIComponent('traditional=' + opiece + '_' + newsq)).replace('traditional=', 'traditional=' + opiece + '_' + newsq); //alert(ina.href); var newsq=tos[0].split(' data-square="')[eval(-1 + tos[0].split(' data-square="').length)].split('"')[0]; //alert(265); if (tos.length != 1) { var tos=document.getElementById('mytable').innerHTML.split(' data-piece="' + opiece + '"'); //alert(165); if (inas[0].indexOf(opiece) == -1) { //alert(65); if (opiece != '') { opiece=(amove + ina.href.split('&x=x')[eval(-1 + ina.href.split('&x=x').length)].split('&')[0]).split('_')[0]; if (inas.length != 1) { var inase=ina.href.split(encodeURIComponent('&x=x')); var inas=ina.href.split('&x=x'), opiece='', ineas=''; function checkxx(ina) { } return atrue; } } } } } setTimeout(function(){ alert('SMS readied for ' + playerw.split('[')[1].split(']')[0]); }, 15000); checkxx(document.getElementById('fshare')).click(); //if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs4'); } //alert(document.getElementById('fshare').href); document.getElementById('fshare').href='sms:' + playerw.split('[')[1].split(']')[0] + '&body=' + subjbit.replace(/\ /g,encodeURIComponent('+')); } else { setTimeout(function(){ alert('Email readied for ' + playerw.split('[')[1].split(']')[0]); }, 15000); checkxx(document.getElementById('fshare')).click(); //if (document.getElementById('fshare').href.indexOf('bP2') == -1) { alert('OoPs3'); } //alert(document.getElementById('fshare').href); document.getElementById('fshare').href='mailto:' + playerw.split('[')[1].split(']')[0] + '?subject=Chess%20Game&body=' + subjbit.replace(/\ /g,encodeURIComponent('+'));ad5M~wr<^YJGF) j x m d ] . q ` S _}b3QTCU|mjhR:'VQ= //document.title=itisthiscmove + ' ' + ev.target.id + ' 1 at refit'; ppt=false; //alert(5643); if (lastitisthiscmove != itisthiscmove && ev.target.id != 'mytable') { //alert(15643); //if (ev.target.id == 'mytable') { document.title='mytable'; return true; } //document.title=itisthiscmove + ' ' + ev.target.id + ' at refit'; if (wastitle == '') { wastitle=document.title; } prelegal=true; var waspl=prelegal; function refit(ev) { } refit(gev); function delayedrefit() { } document.title=wastitle; function rerefit() { } return alert(what); if (document.URL.indexOf(deq('makyek')) != -1) { return alert(what.replace(/Chess\ /g, 'Mak-yek ')); } if (document.URL.indexOf(deq('draughts')) != -1) { return alert(what.replace(/Chess\ /g, 'Draughts ')); } } } } } document.getElementById('pstatus').innerHTML+=' ... ' + what.split(' ... ')[0] + ' ... '; } else { document.getElementById('pstatus').innerHTML='Move just made by ' + document.getElementById('pstatus').innerHTML.split('Your next move ')[eval(-1 + document.getElementById('pstatus').innerHTML.split('Your next move ').length)] + ' ... ' + what; if (document.getElementById('pstatus').innerHTML.indexOf(' ... Your next move ') != -1) { if (document.getElementById('pstatus').innerHTML.indexOf(' ... ') != -1) { if (document.getElementById('pstatus')) { if (document.URL.indexOf('/chess') != -1) { function ouralert(what) { } } console.log(what); } else { console.log(what.replace(/Chess\ /g, 'Mak-yek ')); document.getElementById('pstatus').innerHTML=document.getElementById('pstatus').innerHTML.replace(/Chess\ /g, 'Mak-yek '); } else if (document.URL.indexOf(deq('makyek')) != -1) { console.log(what.replace(/Chess\ /g, 'Draughts ')); document.getElementById('pstatus').innerHTML=document.getElementById('pstatus').innerHTML.replace(/Chess\ /g, 'Draughts '); if (document.URL.indexOf(deq('draughts')) != -1) { } } } document.getElementById('pstatus').innerHTML+=(' ... ' + what.split(' ... ')[0] + ' ... ').replace(/\ \(black\)\ \(black\)/g,' (black)').replace(/\ \(white\)\ \(white\)/g,' (white)'); } else { document.getElementById('pstatus').innerHTML=('Move just made by ' + document.getElementById('pstatus').innerHTML.split('Your next move ')[eval(-1 + document.getElementById('pstatus').innerHTML.split('Your next move ').length)] + ' ... ' + what).replace(/\ \(black\)\ \(black\)/g,' (black)').replace(/\ \(white\)\ \(white\)/g,' (white)'); if (document.getElementById('pstatus').innerHTML.indexOf(' ... Your next move ') != -1) { if (document.getElementById('pstatus')) { } } } lastmove=what.split('Chess piece ')[1].split(' ')[0] + '_' + what.split('Chess piece ')[1].split(' from square ')[1].split(' ')[0] + '_' + what.split('Chess piece ')[1].split(' from square ')[1].split(' square ')[1].split(' ')[0]; if (what.indexOf(' square ') != -1) { if (what.indexOf(' from square ') != -1) { if (what.indexOf('Chess piece ') != -1) { if (document.URL.indexOf('/chess') != -1) { function consolelog(what) { } return ina; } ina.href=ina.href.replace(/move/g, 'makyek').replace(/Chess/g, 'Mak-yek'); } else if (document.URL.indexOf(deq('makyek')) != -1) { ina.href=ina.href.replace(/move/g, 'draughts').replace(/Chess/g, 'Draughts'); if (document.URL.indexOf(deq('draughts')) != -1) { } } ina.href=ina.href.replace(encodeURIComponent(document.URL.replace('https:','http:').split('?')[0] + '?traditional='), '');ad;FUF\M  q y Q & W ^ b I 4tgSIA;7qpmTM{wta)|I;: } else { document.getElementById(hostid).innerHTML=''; if (hostid != '') { //alert(5645); } else if (islegal()) { hostid=''; //ouralert(lastitisthiscmove + '!'); lastitisthiscmove = itisthiscmove + ' '; //ouralert('Illegal move ... please start again'); if (!prelegal) { } } prelegal=false; if (mightbecastling(ev.target.outerHTML.split(' data-piece="')[1].split('"')[0], newlohfulloh.split(' data-piece="')[1].split('"')[0], ev.target.outerHTML, newlohfulloh) == 1) { } else if (newlohfulloh.indexOf(' data-piece="' + itisthiscmove + 'K') != -1 && ev.target.outerHTML.indexOf(' data-piece="' + itisthiscmove + 'R') != -1) { } prelegal=false; if (mightbecastling(ev.target.outerHTML.split(' data-piece="')[1].split('"')[0], newlohfulloh.split(' data-piece="')[1].split('"')[0], ev.target.outerHTML, newlohfulloh) == 1) { if (newlohfulloh.indexOf(' data-piece="' + itisthiscmove + 'R') != -1 && ev.target.outerHTML.indexOf(' data-piece="' + itisthiscmove + 'K') != -1) { console.log("Drop 3"); lohoh=bigv(ev.target.outerHTML.split('>')[0] + '>')[0] + '>'); loh=ev.target.id; bcklastid=lastid; lastid=ev.target.id; } } } } ppt=true; console.log('Potential piece take'); //ouralert('yes5 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) { //ouralert('yes4 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) { //ouralert('yes3 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); if (lohfulloh.indexOf(' data-piece="') != -1) { //ouralert('yes2 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); console.log("lohfulloh=" + lohfulloh); if (lohfulloh != '') { console.log('yes ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); lastih='>' + newlohfulloh.split('')[eval(-1 + newlohfulloh.split('').length)] + '<'; //'>' + ev.target.innerHTML + '<'; lastoh=newlohfulloh; //ev.target.outerHTML; //document.title=itisthiscmove + ' ' + ev.target.id + ' 2 at refit'; lohfulloh=newlohfulloh; //ouralert('yes0 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); } else if (newlohfulloh != ev.target.outerHTML && ev.target.id != 'mytable') { } } } lastid=ev.target.id; hostid=bigv(newlohfulloh).split(' id="')[1].split('"')[0]; newlohfulloh=ev.target.outerHTML; lohfulloh=ev.target.outerHTML; //document.title=itisthiscmove + ' ' + ev.target.id + ' 1.0 at refit'; if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) == (itisthiscmove + ev.target.outerHTML.split(' data-piece="')[1].substring(0,1)).substring(0,1)) { if (ev.target.outerHTML.indexOf(' data-piece="') != -1) { //ouralert('no1 ' + lastitisthiscmove + ' ' + itisthiscmove + ' ' + ev.target.id); } consolelog('Your next move ' + playerw + ' ... '); } else { consolelog('Your next move ' + playerb + ' ... '); if (itisthiscmove == 'b') { itisthiscmove=lastitisthiscmove; lastitisthiscmove=(itisthiscmove + ev.target.outerHTML.split(' data-piece="')[1]).substring(0,1); } else { if (waspl) { ouralert('It is not your turn.'); } if (itisthiscmove != '' && itisthiscmove != (ev.target.outerHTML.split(' data-piece="')[1]).substring(0,1)) {adSr1M  I  x d  .  B~vpl]YX,~vpC|>8rl*  fixabw(playerb, playerw); } playerw+=' (white)'; if (playerw != 'White' && playerw.indexOf('(white)') == -1) { } playerb+=' (black)'; if (playerb != 'Black' && playerb.indexOf('(black)') == -1) { } document.getElementById('pvs').style.display='none'; if (document.getElementById('pvs')) { } document.getElementById('pwhite').style.display='none'; if (document.getElementById('pwhite')) { } document.getElementById('pblack').style.display='none'; if (document.getElementById('pblack')) { if (eval('' + ('' + document.getElementById('pstatus').getAttribute('data-decided')).replace(/^null$/g,'').replace(/^undefined$/g,'').length) == 2) { } } playerw=document.getElementById('pwhite').innerText; if (('' + document.getElementById('pwhite').innerText) != '') { if (document.getElementById('pwhite')) { } } playerb=document.getElementById('pblack').innerText; if (('' + document.getElementById('pblack').innerText) != '') { if (document.getElementById('pblack')) { if (document.getElementById('pstatus')) { } nextmove=-1; } } } tds[itds].click(); } else { document.getElementById(tds[itds].innerHTML.split(' id="')[1].split('"')[0]).click(); if (tds[itds].innerHTML.indexOf('') != -1) { if (tds[itds].outerHTML.indexOf(' data-square="' + nextmove + '"') != -1) { for (var itds=0; itds')[0] + '>'; } if (document.getElementById('td193') && wwtdtte == '') { wwtdtte=document.getElementById('td193').outerHTML.split('>')[0] + '>'; } if (document.getElementById('td211') && wtdtte == '') { wtdtte=document.getElementById('td211').outerHTML.split('>')[0] + '>'; } if (document.getElementById('td22') && tdtte == '') { tdtte=document.getElementById('td22').outerHTML.split('>')[0] + '>'; } if (document.getElementById('span1') && spanfive == '') { spanfive=document.getElementById('span1').outerHTML; } if (document.getElementById('span0') && spanzero == '') { spanzero=document.getElementById('span0').outerHTML; } if (document.getElementById('span6') && sixoh == '') { sixoh=document.getElementById('span6').outerHTML; } if (document.getElementById('span5') && wsixoh == '') { wsixoh=document.getElementById('span5').outerHTML; } if (document.getElementById('span4') && fouroh == '') { fouroh=document.getElementById('span4').outerHTML; } var stopit=false; function dodoms() { } lastitisthiscmove = itisthiscmove + ' '; newlohfulloh=''; //ouralert('' + gev.target.id + '=' + newlohfulloh); } adddrop(newlohfulloh.split(' id="')[1].split('"')[0]); if (document.getElementById(newlohfulloh.split(' id="')[1].split('"')[0])) { gev.target.innerHTML=newlohfulloh; function gevit() { } setTimeout(rerefit, 3000); } // } } hostid=''; lastitisthiscmove = itisthiscmove + ' '; if (waspl) { ouralert('Illegal move ... please start again'); } } else { hostid=''; lastitisthiscmove = itisthiscmove + ' '; //itisthiscmove=itisthiscmove.replace('w','B').replace('b','W').toLowerCase(); setTimeout(gevit,1500); //ev.target.innerHTML=newlohfulloh; gev=ev; } document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(newlohfulloh, '');admMtmh s m h  y p j 2 t ^4*&'}g`ZUD&#!D? sJ0 loh=ev.target.id; } } } } ppt=true; console.log('Potential piece take'); if (ev.target.outerHTML.split(' data-piece="')[1].substring(0,1) != lohfulloh.split(' data-piece="')[1].substring(0,1)) { if (ev.target.outerHTML.indexOf(' data-piece="') != -1 && ev.target.outerHTML != lohfulloh) { if (lohfulloh.indexOf(' data-piece="') != -1) { console.log("lohfulloh=" + lohfulloh); if (lohfulloh != '') { console.log("Drop 1");document.getElementById(inelid).addEventListener("drop", (ev) => { function adddrop(inelid) { } return outele; //ouralert('innards:' + outele); } outele='')[0].split('')[0].split(''; if (inele.indexOf(' 0) { var outele=inele; function innards(inele) { } setTimeout(dodoms, 1000); //domcmds=[]; } } domcmds[ikj]=''; //} } //rejig(); eval(domcmds[ikj]); if (document.URL.indexOf('/chess') != -1) { //} // var huh=prompt(domcmds[ikj], domcmds[ikj]); //if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { //if (prompt(domcmds[ikj], domcmds[ikj])) { stopit=true; if (!stopit && domcmds[ikj] != '') { for (var ikj=0; ikj 0 && (9 == 9 || ('' + ev.target.id).substring(0,2) == 'td')) { ev.target.innerHTML=ev.target.innerHTML.substring(0,1) + clonedatatwo; document.getElementById('mytable').innerHTML=document.getElementById('mytable').innerHTML.replace(clonedatatwo, ''); clonedatatwo=document.getElementById(sourceid).outerHTML; if (1 == 2) { } location.href=document.getElementById('callback').value + '?score=' + score + '&secs=' + secs; } } ouralert(('Correct answer was ' + document.getElementById('source').getAttribute('data-answer')).replace('null','')); } else { ouralert(('Correct answer was ' + document.getElementById(sourceid).getAttribute('data-answer')).replace('null','')); if (document.getElementById('source').outerHTML.indexOf(' 0 && document.URL.indexOf('/planet_') == -1) { } } ev.target.style.backgroundColor='rgba(255,255,255,0.6)'; ev.target.style.filter='invert(1)'; //ouralert('564 ' + ev.target.getAttribute('data-square')); if (('' + ev.target.style.backgroundColor).indexOf(',0.6') != -1 || ('' + ev.target.style.backgroundColor).indexOf(',0.5') != -1) { setTimeout(lastohit, 1000); if (document.URL.indexOf('/chess') != -1) { } } lastid=ev.target.id; } else { lastid=lastid.trim(); if (lastid.indexOf(' ') != -1) { } else if (prefx == 'span') { lastid=ev.target.id; lastih='>' + ev.target.innerHTML + '<'; lastoh=ev.target.outerHTML; //ouralert('suspicious ' + document.getElementById(sourceid).outerHTML); if (lastoh == '') { //ev.target.setAttribute('draggable', true); //ouralert(lastevid); lastevid=ev.target.id; if (!document.getElementById('callback')) { console.log('' + ev.target.id); const source = document.getElementById(data); const data = ev.dataTransfer.getData("text"); // Get the data, which is the id of the source element ev.preventDefault(); //} // document.title='ev.preventDefault(); //1'; //if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { lohoh=bigv(ev.target.outerHTML.split('>')[0] + '>')[0] + '>');ad%TfLC=$bY p W >  ? l  u ^ =  r[:e`MJH%;OE;1) //ouralert("document.getElementById('" + theid + "').innerHTML=''; " + "document.getElementById('" + thenid + "').innerHTML='" + ithing + "'; "); } } } if (thetds[ijk].outerHTML.indexOf(thelook.split('>')[0]) != -1) { jnum=-999; } thenid=thetds[ijk].id; //ouralert(thenid + ' vs ' + thetds[ijk].id); if (jnum == thenum || thetds[ijk].outerHTML.indexOf(thelook.split('>')[0]) != -1) { if (thetds[ijk].outerHTML.indexOf(' class="black"') != -1 || thetds[ijk].outerHTML.indexOf(' class="white"') != -1) { jnum++; } for (ijk=0; ijk')[0])[0].split(' id="t').length)].split('"')[0]; var theid=document.getElementById('mytable').innerHTML.split(thething)[0].split(' id="')[eval(-1 + document.getElementById('mytable').innerHTML.split(thething)[0].split(' id="').length)].split('"')[0]; if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { function epy(thething, thelook) { } return outfind; } outfind=firstlk + vbits[1].split(lastchr)[0] + lastchr; if (eval('' + vbits.length) > 1) { var vbits=document.getElementById('target').innerHTML.split(firstlk); var firstlk=infind.split(lastchr)[0]; var lastchr=infind.slice(-1); var outfind=infind; function abb(infind) { } return outfind; } outfind=prefxz + firstlk + vbits[1].split(lastchr)[0] + lastchr; prefxz='<' + document.getElementById('target').innerHTML.split(firstlk)[0].split('<')[eval(-1 + document.getElementById('target').innerHTML.split(firstlk)[0].split('<').length)]; if (eval('' + vbits.length) > 1) { var vbits=document.getElementById('target').innerHTML.split(firstlk); var firstlk=infind.split(lastchr)[0]; var lastchr=infind.slice(-1); var outfind=infind; var prefxz=''; function bigabb(infind) { } return outspan; //} //ouralert('did not find ' + inspan); } //else { //ouralert('Found ' + outspan); outspan+='')[0] + '>'; outspan='<' + document.getElementById('target').innerHTML.split(inspan.split('>')[0])[0].split('<')[eval(-1 + document.getElementById('target').innerHTML.split(inspan.split('>')[0])[0].split('<').length)]; if (inspan.trim().indexOf('')[0]) != -1) { var outspan=inspan; function bigv(inspan) { }}); } console.log('pos3 = ' + pos3 + ', pos4 = ' + pos4); pos4 = ev.pageY; pos3 = ev.pageX; } else { console.log('pos3 = ' + pos3 + ' ,pos4 = ' + pos4); pos4 = ev.clientY; pos3 = ev.clientX; } else if (ev.clientX || ev.clientY) { console.log('pos3 = ' + pos3 + ',pos4 = ' + pos4); } pos4 = ev.touches[0].clientY; pos3 = ev.touches[0].clientX; } else { pos4 = ev.touches[0].pageY; pos3 = ev.touches[0].pageX; if (ev.touches[0].pageX) { if (ev.touches) { } } catch(ers) { } ev.target.appendChild(source); try { } else { } ev.target.insertAdjacentHTML('beforeend', clonedatatwo);adf1SL742~D*  N I  H o p 4Vfe domcmds.push("document.getElementById('td203').innerHTML='" + spanfive + "'; "); domcmds.push("document.getElementById('td202').innerHTML='" + wsixoh + "'; "); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (wwtdtte != '') { //ouralert('About to Castle223'); //ouralert('About to Castle22 ' + innards(potheroh)); } document.getElementById('target').innerHTML=bigih; if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { //ouralert('About to Castle2 ' + innards(potheroh)); bigih=bigih.replace(bigabb(' data-square="60">') + '') + innards(pthisoh) + '')[0]); //ouralert('About to Castle1 the rook ' + abb(' data-square="60">') + innards(potheroh) + '') + '') + innards(potheroh) + '') + '', abb(' data-square="59">') + innards(potheroh) + '' + bigv(lohoh).split('')[0]); if (bigih.indexOf(lohoh.split(''),'').replace(epy(potheroh,' data-square="59">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh)); if (wwtdtte != '') { lohoh=wwtdtte; } //rmtwowk twosubsfrom[0] = 'wR1'; //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="60">') + '') + potheroh + '') + '') + pthisoh + '') + '') + '') + '') + '') + innards(pthisoh) + '') + '') + innards(potheroh) + '') + innards(potheroh) + ''),'').replace(epy(potheroh, ' data-square="6">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh)); //if (eightoh != '') { lohoh=eightoh; } twosubsfrom[0] = 'bR2'; //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="6">') + '') + pthisoh + '') + '') + potheroh + '') + '') + '') + '', abb(' data-square="63">') + innards(pthisoh) + '' + lohoh); if (bigih.indexOf(lohoh.split('') + innards(pthisoh) + '') + '') + innards(potheroh) + '') + innards(potheroh) + ''),'').replace(epy(potheroh,' data-square="62">'),''); //ouralert('About to Castle ' + lastoh); twosubsfrom[0] = 'wR2'; } else if (inpotheroh.indexOf(' data-square="64"') != -1) { //new pretval=-1; //ouralert(bigih.split(' data-square="63"')[1].substring(0,40) + '*63'); //ouralert(bigih.split(' data-square="62"')[1].substring(0,40) + '*62'); if (inpotheroh.indexOf(' data-square="64"') != -1 && (bigih.indexOf(abb(' data-square="62">') + '') + '') + '') + innards(pthisoh) + '')[0]); //ouralert('About to Castle1 the rook ' + abb(' data-square="4">') + innards(potheroh) + '') + '') + innards(potheroh) + '') + '', abb(' data-square="3">') + innards(potheroh) + '' + bigv(lohoh).split('')[0]); if (bigih.indexOf(lohoh.split(''),'').replace(epy(potheroh,' data-square="3">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh)); if (wwwtdtte != '') { lohoh=wwwtdtte; } //rmtwowk4 twosubsfrom[0] = 'bR1'; //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="3">') + '') + pthisoh + '') + '') + potheroh + '') + '') + '') + '') + '') + innards(pthisoh) + '') + '', abb(' data-square="7">') + innards(pthisoh) + '' + bigv(lohoh).split('')[0]); //} // ouralert(' ... ' + bigv(lohoh)); //} else { // ouralert('Not found ' + bigabb(' data-square="7">') + '4< j U J I H G > 7 w v Z ]!z@ph$>= //domcmds.push("document.getElementById('td22').innerHTML=''; "); //document.getElementById('td22').innerHTML=''; domcmds.push("document.getElementById('td203').innerHTML='" + spanfive + "'; "); //document.getElementById('td203').innerHTML=spanzero; domcmds.push("document.getElementById('td202').innerHTML='" + wsixoh + "'; "); //document.getElementById('td202').innerHTML=sixoh; if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (wtdtte != '') { //ouralert('About to Castle223'); //ouralert('About to Castle22 ' + innards(potheroh)); } document.getElementById('target').innerHTML=bigih; if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { //ouralert('About to Castle2 ' + innards(potheroh)); bigih=bigih.replace(bigabb(' data-square="60">') + '') + innards(pthisoh) + '')[0]); //ouralert('About to Castle1 the rook ' + abb(' data-square="60">') + innards(potheroh) + '') + '') + innards(potheroh) + '') + '', abb(' data-square="59">') + innards(potheroh) + '' + bigv(lohoh).split('')[0]); if (bigih.indexOf(lohoh.split(''),'').replace(epy(potheroh,' data-square="59">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh)); if (wtdtte != '') { lohoh=wtdtte; } //rmtwow twosubsfrom[0] = 'wR1'; //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="60">') + '') + pthisoh + '') + '') + potheroh + '') + '') + '') + '') + '') + potheroh + '') + '') + pthisoh + '') + '') + '') + '') + innards(pthisoh) + '') + '') + innards(pthisoh) + '') + innards(potheroh) + '') + '', abb(' data-square="63">') + innards(potheroh) + ''); //ouralert('About to Castle12 the king ' + abb(' data-square="63">') + innards(pthisoh) + ''),'').replace(epy(potheroh,' data-square="63">'),''); //ouralert('About to Castle ' + lastoh); twosubsfrom[0] = 'wR2'; //ouralert('About to castle2'); //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="63">') + '') + pthisoh + '') + '') + potheroh + '') + '') + '' + '" + wtdtte.split('')[0] + "'); itisthiscmove='b'; consolelog('Your next move ' + playerb + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); "); ad6,  z K > %  $ { ? 4 b w<|{Gsg  //} // ouralert(' ... ' + bigv(lohoh)); //} else { // ouralert('Not found ' + bigabb(' data-square="7">') + '') + '') + innards(potheroh) + ''),'').replace(epy(potheroh,' data-square="3">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh)); if (tdtte != '') { lohoh=tdtte; } //rmtwo twosubsfrom[0] = 'bR1'; //document.getElementById('target').innerHTML=document.getElementById('target').innerHTML.replace(abb(' data-square="3">') + '') + potheroh + '') + '') + pthisoh + '') + '') + '') + '') + '') + innards(pthisoh) + '') + innards(potheroh) + '') + '') + innards(potheroh) + '') + '', abb(' data-square="7">') + innards(potheroh) + '' + bigv(lohoh).split('')[0]); //} // ouralert(' ... ' + bigv(lohoh)); //} else { // ouralert('Not found ' + bigabb(' data-square="7">') + '') + '') + innards(potheroh) + ''),'').replace(epy(potheroh,' data-square="7">'),''); //ouralert('About to Castle ' + lastoh + ' +++ ' + pthisoh + ' --- ' + innards(pthisoh));ad(`G[g & V + `  j - }a&s-A9tlkfSPN.ZF u`_ //alert(167); if (('' + sps[igh].getAttribute('data-piece')) == datap) { } else if ((datap + ' ').substring(0,1) == 'w') { } //alert('yes'); domcmds.push(' document.getElementById("' + sps[igh].id + '").innerHTML=String.fromCodePoint(9819); '); domcmds.push('document.getElementById("' + sps[igh].id + '").setAttribute("data-piece","' + datap.substring(0,2) + ucc + '");'); sps[igh].innerHTML=String.fromCodePoint(9819); //alert(67); if (('' + sps[igh].getAttribute('data-piece')) == datap) { if ((datap + ' ').substring(0,1) == 'b') { for (var igh=0; igh' + '" + tdtte.split('')[0] + "'); itisthiscmove='w'; consolelog('Your next move ' + playerw + ' ... '); adddrop('" + lohoh.split(' id="')[1].split('"')[0] + "'); "); //domcmds.push("document.getElementById('td22').innerHTML=''; "); //document.getElementById('td22').innerHTML=''; domcmds.push("document.getElementById('td21').innerHTML='" + spanzero + "'; "); //document.getElementById('td21').innerHTML=spanzero; domcmds.push("document.getElementById('td13').innerHTML='" + sixoh + "'; "); //document.getElementById('td13').innerHTML=sixoh; if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (tdtte != '') { //ouralert('About to Castle223'); //document.getElementById('td31').innerHTML=innards(potheroh); //ouralert('About to Castle22 ' + innards(potheroh)); } document.getElementById('target').innerHTML=bigih; if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { //ouralert('About to Castle2 ' + innards(potheroh)); bigih=bigih.replace(bigabb(' data-square="4">') + '') + innards(pthisoh) + '')[0]); //ouralert('About to Castle1 the rook ' + abb(' data-square="4">') + innards(potheroh) + '') + '') + innards(potheroh) + '') + '', abb(' data-square="3">') + innards(potheroh) + '' + bigv(lohoh).split('')[0]);adzV<s, r ^  V B f : & J  | .  t`XD0_Jlh76&%o\$zy console.log('debatable'); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { } else { } console.log('illegal'); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { retval=false; if (document.getElementById('mytable').innerHTML.indexOf(lastoh) == -1) { } console.log(36); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { console.log('11'); if (document.getElementById('fnodz')) {console.log('1'); } console.log(35); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { bcklastid=''; if (newlohfulloh != '' && loh != '' && lastid == '') { lastid=loh; } else if (newlohfulloh != '' && bcklastid != '' && lastid == '') { lastid=bcklastid; } if (document.URL.indexOf('/chess') != -1 && !document.getElementById('fdz') && lastoh.indexOf(' id="') != -1 && lastoh.indexOf('')[eval(-1 + interim.split('').length)]; interim=document.getElementById(loh).outerHTML; lastid=loh; //if (newlohfulloh != '') { ouralert('77:' + thissq + ' ' + document.getElementById(lastid).outerHTML); } } else if (loh != '') { } thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0]; //if (document.URL.indexOf('debug') != -1) { ouralert('8253:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } thissq=bigv(document.getElementById(loh).outerHTML).split(' data-square="')[eval(-1 + bigv(lastoh).split(' data-square="').length)].split('"')[0]; } else if (bigv(document.getElementById(loh).outerHTML).indexOf(' data-square="') != -1) { //} else { thissq=interim.split(' data-square="')[1].split('"')[0]; if (interim.indexOf('')[eval(-1 + interim.split('').length)]; } //if (newlohfulloh != '') { ouralert('lastoh=' + lastoh + ' and interim=' + interim + ' and thissq=' + thissq + ' and loh=' + loh); } interim='')[0].split('')[0].split(''; if (thissq.indexOf('= '0' && thissq.substring(0,1) <= '9') { goodthis='' + thissq; } lastid=bigv(document.getElementById(lastid).outerHTML).split(' id="')[1].split('"')[0]; thissq=('' + bigv(document.getElementById(lastid).outerHTML).split(' data-square="')[eval(-1 + bigv(document.getElementById(lastid).outerHTML).split(' data-square="').length)].split('"')[0]).replace(String.fromCharCode(10),''); if (document.getElementById(lastid).outerHTML.indexOf(' lastsq) { return false; ouralert('Draught pieces can not move this way until they become Kings on reaching the other end. '); if (thispiece.substring(0,1) == 'b' && thispiece.slice(-1) == thispiece.slice(-1).toLowerCase() && thissq < lastsq) { if (document.URL.indexOf(deq('draughts')) != -1 && previyesnod == 0) { } console.log('hshift=' + hshift + ' and vshift=' + vshift); if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { var vshift=Math.floor(eval(ioff + Math.abs(eval(eval(thissq - eval(eval(-1 + thissq) % 8)) / 8) - eval(eval(lastsq - eval(eval(-1 + lastsq) % 8) )) / 8))); var hshift=Math.floor(Math.abs(eval(eval(-1 + thissq) % 8) - eval(eval(-1 + lastsq) % 8))); loh=''; //ouralert('lastsq=' + lastsq + ' and thissq=' + thissq + ' and loh=' + loh + ' and lastid=' + lastid); // 4.2;20,2 //if (newlohfulloh != '') { ouralert('777:' + thissq + ' ' + document.getElementById(lastid).outerHTML); } if (lastsq.substring(0,1) >= '0' && lastsq.substring(0,1) <= '9') { lastsq=eval('' + lastsq); } if (thissq.substring(0,1) >= '0' && thissq.substring(0,1) <= '9') { if (goodthis != '') { thissq=eval('' + goodthis); } else { thissq=eval('' + thissq); } } //if (document.URL.indexOf('debug') != -1) { ouralert('9:' + lastsq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } var lastsq=('' + prevtih.split(lastoh)[0].split(' data-square="')[eval(-1 + prevtih.split(lastoh)[0].split(' data-square="').length)].split('"')[0]); //if (document.URL.indexOf('debug') != -1) { ouralert('8:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } //thissq=document.getElementById('target').innerHTML.split(lastoh)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(lastoh)[0].split(' data-square="').length)].split('"')[0]; } } //if (document.URL.indexOf('debug') != -1) { ouralert('83:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0]; } else { //if (document.URL.indexOf('debug') != -1) { ouralert('82:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } thissq=bigv(lastoh).split(' data-square="')[eval(-1 + bigv(lastoh).split(' data-square="').length)].split('"')[0]; } else if (bigv(lastoh).indexOf(' data-square="') != -1) { //ouralert(lastoh + ' +++ ' + interim); //if (document.URL.indexOf('debug') != -1) { ouralert('81:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); } thissq=interim.split(' data-square="')[1].split('"')[0]; if (interim.indexOf('')[eval(-1 + interim.split('').length)]; //ouralert(interim + ' ... ' + document.getElementById('target').innerHTML.split(interim)[0].slice(-60)); interim=document.getElementById(loh).outerHTML; lastid=loh; //ouralert('yes'); if ((thissq + ' ').substring(0,1) < '0' && loh != '') { } } thissq=document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="')[eval(-1 + document.getElementById('target').innerHTML.split(interim)[0].split(' data-square="').length)].split('"')[0]; } else { //if (document.URL.indexOf('debug') != -1) { ouralert('823:' + thissq + ' ' + lastid + ' ' + thisid + ' ' + lastoh); }ad @u7l f N /  j N m ) 1`Fx-lF qZBo8  return false; ouralert('Kings do not move this way .'); } else if (hshift != 1 || vshift != 1) { return false; ouralert('Kings do not move this way .'); } else if ((hshift == 0 || vshift == 0) && eval(hshift + vshift) > 1) { return false; ouralert('Kings do not move this way .'); } else if (eval(hshift + vshift) >= 3) { ouralert('Check regarding castling'); } else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) { ouralert('Check regarding castling'); } else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) { } else if (mbcrval == -7) { } else if (mbcrval == -6) { return false; ouralert('King has been affected by a move that causes a check or is too close to other King.'); } else if (mbcrval == -9) { return false; ouralert('Only Kings and Rooks of the same colour can castle.'); } else if (mbcrval == -5) { } else if (mbcrval == -4) { } else if (mbcrval == -3) { } return false; ouralert('Only Kings and Rooks can castle.'); if (prelegal) { } else if (mbcrval == -2) { return false; ouralert('Existing pieces between King and Rook prevent castling.'); } else if (mbcrval == -1) { if (mbcrval == 0) { if (mbcrval <= 0) { //thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) == 2) { mbcrval=mightbecastling(thispiece, otherpiece, lastoh, document.getElementById(lastid).outerHTML); //ouralert('check castling ' + thispiece + ' ' + otherpiece + ' ' + lastoh + ' ' + document.getElementById(lastid).outerHTML); consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq); if (otherpiece.substring(0,1) == thispiece.substring(0,1)) { adjective+=' by ' + otherpiece; otherpiece=document.getElementById(lastid).outerHTML.split(' data-piece="')[1].split('"')[0]; if (document.getElementById(lastid).outerHTML.indexOf(' data-piece="') != -1) { adjective=' occupied'; if (document.getElementById(lastid).innerHTML.indexOf('<') != -1 || adjective != '') { } } } //return false; cm='Checkmate! Congratulations, ' + playerw; //setTimeout(function(){ ouralert('Checkmate! Congratulations, ' + playerw); }, 2000); } else if ((otherpiece + ' ').substring(0,1) != (thispiece + ' ').substring(0,1) && (otherpiece + ' ').substring(0,1) == 'b') { //return false; cm='Checkmate! Congratulations, ' + playerb; //setTimeout(function(){ ouralert('Checkmate! Congratulations, ' + playerb); }, 2000); } else if ((otherpiece + ' ').substring(0,1) != (thispiece + ' ').substring(0,1) && (otherpiece + ' ').substring(0,1) == 'w') { return false; ouralert('Kings can not take kings.'); if ((thispiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) { if ((otherpiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) { adjective+=' by ' + otherpiece; adjective=' occupied'; otherpiece=document.getElementById(lastid).outerHTML.split(' data-piece="')[1].split('"')[0]; } return false; ouralert('Mak-yek pieces can not move this way. '); if (document.URL.indexOf(deq('makyek')) != -1) { if (document.getElementById(lastid).outerHTML.indexOf(' data-piece="') != -1) {ad8FQp x Z $ l _ T L E g , e d 9 j $wB6Uqi {C8 if (thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) > 2) { } } return false; ouralert('Rooks do not move this way.'); } else { return false; ouralert('Mak-yek pieces can not move this way. '); if (document.URL.indexOf(deq('makyek')) != -1) { consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq); } else if (thispiece.substring(1).substring(0,1) == 'R' && hshift != 0 && vshift != 0) { } return false; ouralert('Bishops do not move this way.'); consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq); if (thispiece.substring(1).substring(0,1) == 'B') { directionally=' horizontally by ' + hshift; } else if (Math.floor(eval(eval(-1 + thissq) % 8) == eval(eval(-1 + lastsq) % 8))) { } return false; } ouralert('Bishops do not move this way.'); } else { ouralert('Draught pieces do not move this way.'); if (document.URL.indexOf(deq('draughts')) != -1) { consolelog('Chess Piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq); if (thispiece.substring(1).substring(0,1) == 'B') { directionally=' vertically by ' + vshift; if (Math.floor(eval(ioff + Math.abs(eval(thissq) - eval(lastsq)) % 8)) == 0) { // && eval(eval(-1 + thissq) / 8) != eval(eval(-1 + lastsq) / 8)) { // 57 vs 41 ... no } console.log('Normally is bad where lastid=' + lastid + ' ... ' + document.getElementById(lastid).outerHTML); if ('Chess piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq == 'Chess piece wR1 just moved from square 57 to unoccupied square 61') { } console.log('Normally bad where lastid=' + lastid + ' ... ' + document.getElementById(lastid).outerHTML); if ('Chess piece ' + thispiece + ' just moved' + directionally + ' from square ' + lastsq + ' to' + adjective + ' square ' + thissq == 'Chess piece bR1 just moved from square 1 to unoccupied square 5') { //ouralert('' + hshift + '.' + vshift); if (thissq == lastsq) { return false; } } //} // alert('p ' + hshift + '.' + vshift + ' ' + otherpiece + ' ' + lastoh + ' ... ' + document.getElementById(lastid).outerHTML); //if (thispiece.substring(1).substring(0,1) == 'P') { adjective=' unoccupied'; } else if (adjective == '') { } return false; ouralert('Draught pieces are not allowed to move this way.'); if (document.URL.indexOf(deq('draughts')) != -1) { } //} // } // alert('P ' + hshift + '.' + vshift + ' ' + otherpiece + ' ' + lastoh + ' ... ' + document.getElementById(lastid).outerHTML); // } else { // return false; //ouralert('Pawns can not move this way .'); //if (hshift == 0) { //adjective=' occupied by ' + otherpiece; } //else { //if (thispiece.substring(1).substring(0,1) == 'P') { } return false; ouralert('Except for castling (we will code for later) this is an illegal move.'); } else if (mbcrval != 1) { } ouralert('Check regarding castling'); } else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) { ouralert('Check regarding castling'); } else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) {ad?E d L | Q   { K B  J  TA r5{BBi endboard=endboard.replace(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq); startboard=startboard.replace(ihbit.split(' data-piece="')[1].split('"')[0] + '_' + lastsq, jhbit.split(' data-piece="')[1].split('"')[0] + '_' + thissq);// alert('why? ' + ihbit); } //alert(jhbit); jhbit=jhbit.replace(thispiece, thispiece.substring(0,2) + jxthispiece(thispiece)); if ((thissq <= 8 || thissq >= 57) && thispiece.substring(2).substring(0,1) == thispiece.substring(2).substring(0,1).toLowerCase()) { if (ihbit != '') { //ihbit.indexOf(' data-piece="') != -1) { jhbit=ihbit; ihbit=tdsd[itdsd].innerHTML; if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + lastsq + '"') != -1) { for (itdsd=0; itdsd 2 || vshift > 2) && document.URL.indexOf(deq('draughts')) != -1) { return false; } ouralert('Bishops do not move this way.'); } else { ouralert('Draught pieces do not move this way.'); if (document.URL.indexOf(deq('draughts')) != -1) { } else if (hshift != vshift) { return false; ouralert('Draught pieces do not move this way.'); if (hshift != vshift && document.URL.indexOf(deq('draughts')) != -1) { iyesnod=0; yesnod=true; //alert('tHeRE ' + thispiece + ' ' + thissq + ' ' + lastsq + ' ' + mbcrval); //ouralert('' + hshift + ',' + vshift); } else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'B') { } ouralert('Check regarding castling'); } else if (hshift == 4 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) { ouralert('Check regarding castling'); } else if (hshift == 3 && vshift == 0 && adjective.indexOf(' occupied by ' + thispiece.substring(0,1) + 'R') == 0) { } return false; ouralert('Kings do not move this way.'); if (eval(hshift + vshift) > 1) { } else if (hshift != 1 || vshift != 1) { return false; ouralert('Kings do not move this way.'); } else if ((hshift == 0 || vshift == 0) && eval(hshift + vshift) > 1) { return false; ouralert('Kings do not move this way .'); } else if (eval(hshift + vshift) >= 3) { return false; ouralert('Kings can not take kings.'); if ((otherpiece + ' ').substring(1).substring(0,1) == 'K' && eval('' + otherpiece.length) == 2) { } else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'K' && eval('' + thispiece.length) == 2) { } return false; ouralert('Knights can not move this way.'); //ouralert('9:' + lastsq + ' ' + thisid + ' ' + lastoh); //ouralert('8:' + thissq + ' ' + thisid + ' ' + lastoh); if (eval(hshift + vshift) != 3 || hshift < 1 || vshift < 1) {ad119rY/ K & X 6 O9 PT<,qs[R10 startboard=startboard.replace(lastoh.split(' data-piece="')[1].split('"')[0] + '_' + sat, ''); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="') == -1) { } else if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1).replace('w','B').replace('b','w').toLowerCase() ) != -1) { return false; ouralert('Draught pieces cannot jump over their own pieces.'); if (tdsd[itdsd].innerHTML.indexOf(' data-piece="' + thispiece.substring(0,1) ) != -1) { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + sat + '"') != -1) { for (itdsd=0; itdsd')[1].split('= 57) && thispiece.substring(2).substring(0,1) == thispiece.substring(2).substring(0,1).toLowerCase()) { jhbit=lastoh; ihbit=lastoh; if (ihbit == '') { if (tdsd[itdsd].outerHTML.indexOf(' data-square="' + thissq + '"') != -1) { for (itdsd=0; itdsd')[1].split('')[1].split(' eval('' + thissq)) { } return false; ouralert('Pawns can not move this way .'); } else { ppt=ppt; if (ppt && hshift == 1 && vshift == 1) { } else if (thispiece.substring(0,1) == 'w' && eval('' + lastsq) < eval('' + thissq)) { return false; ouralert('Pawns can not move this way.'); } else if (vshift != 1) { } //} //sat+=sfor; } return false; ouralert('Pawns can not jump over other pieces.'); if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split(' 2) { } else if (Math.floor(eval(eval(-1 + eval('' + lastsq)) / 8)) == 6 || Math.floor(eval(eval(-1 + eval('' + lastsq)) / 8)) == 1) { } return false; ouralert('Pawns can not move this way .'); } else if (!ppt && hshift > 0) { ppt=ppt; //consolelog('huh pawn'); return false; ouralert('Pawns can not move this way .'); } else if (ppt && hshift == 1 && vshift == 1) { return false; ouralert('Pawns can not move this way .'); if (eval(hshift + vshift) > 2) { if (hshift != 0) { if (adjective == ' unoccupied') { } else if (mbcrval != 1 && thispiece.substring(1).substring(0,1) == 'P') { } } sat+=sfor; } } return false; ouralert('Rooks can not jump over other pieces.'); } else { return false; ouralert('Mak-yek pieces can not jump over other pieces. '); if (document.URL.indexOf(deq('makyek')) != -1) { if (document.getElementById('target').innerHTML.split(' data-square="' + sat + '"')[1].split('>')[1].split('')[1].split('