'); for ($i=0; $i'; } else { $thisth=''; } array_push($ths, $thisth); $outtg=str_replace($thisth, '', $outtg); } $thas=explode($outtg, ''); for ($i=(-1 + sizeof($ths)); $i>=0; $i--) { $outtg=str_replace($thas[$i], $thas[$i] . $ths[$i], $outtg); } return $outtg; } $across=8; $theans=rand(1,64); $theclue="switch ($nclue) { case 0: $clue = '♜'; break; case 1: $clue = '♜'; break; case 2: $clue = '♜'; break; case 3: $clue = '♜'; break; case 4: $clue = '♜'; break; case 5: $clue = '♜'; break; case 6: $clue = '♜'; break; case 7: $clue = '♜'; break; case 8: $clue = '♜'; break; case 9: $clue = '♜'; break; case 10: $clue = '♜'; break; case 11: $clue = '♜'; break; case 12: $clue = '♜'; break; case 13: $clue = '♜'; break; case 14: $clue = '♜'; break; case 15: $clue = '♜'; break; case 16: $clue = '♜'; break; case 17: $clue = '♜'; break; case 18: $clue = '♜'; break; case 19: $clue = '♜'; break; case 20: $clue = '♜'; break; case 21: $clue = '♜'; break; case 22: $clue = '♜'; break; case 23: $clue = '♜'; break; case 24: $clue = '♜'; break; case 25: $clue = '♜'; break; case 26: $clue = '♜'; break; case 27: $clue = '♜'; break; case 28: $clue = '♜'; break; case 29: $clue = '♜'; break; case 30: $clue = '♜'; break; case 31: $clue = '♜'; break; case 32: $clue = '♜'; break; case 33: $clue = '♜'; break; case 34: $clue = '♜'; break; case 35: $clue = '♜'; break; case 36: $clue = '♜'; break; case 37: $clue = '♜'; break; case 38: $clue = '♜'; break; case 39: $clue = '♜'; break; case 40: $clue = '♜'; break; case 41: $clue = '♜'; break; case 42: $clue = '♜'; break; case 43: $clue = '♜'; break; case 44: $clue = '♜'; break; case 45: $clue = '♜'; break; case 46: $clue = '♜'; break; case 47: $clue = '♜'; break; case 48: $clue = '♜'; break; case 49: $clue = '♜'; break; case 50: $clue = '♜'; break; case 51: $clue = '♜'; break; case 52: $clue = '♜'; break; case 53: $clue = '♜'; break; case 54: $clue = '♜'; break; case 55: $clue = '♜'; break; case 56: $clue = '♜'; break; case 57: $clue = '♜'; break; case 58: $clue = '♜'; break; case 59: $clue = '♜'; break; case 60: $clue = '♜'; break; case 61: $clue = '♜'; break; case 62: $clue = '♜'; break; case 63: $clue = '♜'; break; case 64: $clue = '♜'; break; } "; //$theclue=file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/Games/Battleshipsandcruisers/index2.php'); $ansa=explode('case ' . $theans . ':', $theclue); $thecluewording=explode("'", explode("'", $ansa[1])[1])[0]; $scorebit=''; if (isset($_GET['score']) && isset($_GET['secs'])) { $scorebit="Score " . $_GET['score'] . '/' . $_GET['secs']; } $wikistuff=str_replace(' ','_',$thecluewording) . ' ' . $thecluewording; $wikistuff="1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 56 57 57 58 58 59 59 60 60 61 61 62 62 63 63 64 64 "; $lastotherde=''; $wikistuffs=explode("\n", $wikistuff); $wikidesignations=[]; $wikidescriptions=[]; $crandlist=''; $randlist=[]; for ($i=0; $i' . $ijk . ''; } else if (($ijk % 3) == 0) { $arow=str_replace('', '' . $ijk . '', $arow); $templategame=str_replace('', $arow . '', $templategame); $arow=''; } else { $arow=str_replace('', '' . $ijk . '', $arow); } } $templategame=str_replace('', $arow . '', $templategame); //file_put_contents('xx.html', $templategame); $curclass='white'; if ($across != 3 && 1 == 1) { $irws=1; $usedtobesofartd=''; $sofartd=''; $two=2; $wasih="", explode(""; $origih=$wasih; $rowas=explode("", $wasih); for ($irws=1; $irws 3 && strpos(substr(str_replace("\n","",$rowas[$irws]),0,2),'', $rowas[(-1 + $irws)] . '', $wasih); } } $rowas=explode(" 3) { $wasih=str_replace('', $rowas[$irws])[0] . '>', '-' . '->', $rowas[$irws]), $wasih); } } //file_put_contents('xxxx.html', str_replace($origih, $wasih, $templategame)); $usedtoberowas=explode("", $wasih); $rowas=explode("", $wasih); for ($irws=0; $irws') === false) { $rowas[$irws]=str_replace('', $rowas[$irws])[-1 + sizeof(explode('>', $rowas[$irws]))]; //$rowas[$irws]=str_replace($fb, $fb . ' data-square=' . (1 + $irws) . '', $rowas[$irws]); //} if ($curclass == 'white' && strpos($rowas[$irws], '') === false) { $curclass='white'; } else { $curclass='black'; } if (((1 + $irws) % $across) == 0) { $usedtobesofartd.=$usedtoberowas[$irws] . ''; $sofartd.=$rowas[$irws] . ''; $wasih=str_replace($usedtobesofartd, $sofartd . '', $wasih); $usedtobesofartd=''; $sofartd=''; $two++; } else { $usedtobesofartd.=$usedtoberowas[$irws] . ''; $sofartd.=$rowas[$irws] . ''; } } for ($irws=9; $irws<=16; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=1; $irws<=8; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" style="background-color: rgba(255,255,255,0.6);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=25; $irws<=32; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=17; $irws<=24; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=41; $irws<=48; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=33; $irws<=40; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=57; $irws<=64; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . (1 + $irws) . ' ', $wasih); } for ($irws=49; $irws<=56; $irws+=2) { $wasih=str_replace(' data-square=' . $irws . ' ', ' class=white style="background-color: rgba(255,255,255,0.5);" data-square=' . $irws . ' ', $wasih); $wasih=str_replace(' data-square=' . (1 + $irws) . ' ', ' class=black style="background-color: rgba(0,0,0,0.6);" data-square=' . (1 + $irws) . ' ', $wasih); } //file_put_contents('x.html', str_replace($origih, $wasih, $templategame)); $templategame=str_replace($origih, $wasih, $templategame); } } //file_put_contents('xxx.html', $templategame); $namesdecided=''; $templategame=str_replace(' contenteditable=', ' data-contenteditable=', $templategame); $templategame=str_replace('', '', $templategame); if (!isset($_GET['traditional'])) { $templategame=str_replace('', '  ', $templategame); } else if (strpos($_GET['traditional'], 'mayhem') !== false) { $templategame=str_replace('', '  ', $templategame); } else if (isset($_GET['bname']) && isset($_GET['wname'])) { $namesdecided=' data-decided="bw" '; $templategame=str_replace('', ' 

' . str_replace('+',' ',urldecode($_GET['bname'])) . '

 versus 

' . str_replace('+',' ',urldecode($_GET['wname'])) . '

', $templategame); } else if (isset($_GET['wname'])) { $namesdecided=' data-decided="w" '; $templategame=str_replace('', ' 

Black

 versus 

' . str_replace('+',' ',urldecode($_GET['wname'])) . '

', $templategame); } else if (isset($_GET['bname'])) { $namesdecided=' data-decided="b" '; $templategame=str_replace('', ' 

' . str_replace('+',' ',urldecode($_GET['bname'])) . '

 versus 

White

', $templategame); } else { $templategame=str_replace('', ' 

Black

 versus 

White

', $templategame); } $templategame=str_replace('>Game', '>Chess Game Practice 

', $templategame); $templategame=str_replace('>', '>' . $scorebit . '', $templategame); $thepsource=explode('f0;">', explode("

", $templategame)[0])[-1 + sizeof(explode('f0;">', explode("

", $templategame)[0]))]; //$templategame=str_replace(', 2023<', ', 2023 ... thanks to https://en.wikipedia.org/wiki/Street_suffix<', $templategame); $templategame=str_replace('>Reset example<', ' style="display:none;">Reset example<', $templategame); if (1 == 2) { $templategame=str_replace('', "", $templategame); } else { $templategame=str_replace('', "", $templategame)); $dzfrom='Drop Zone'; $dzto=''; if (!isset($_GET['traditional'])) { $templategame=str_replace($dzfrom, $dzto, $templategame); $dzfrom='Experimental Drag and Drop'; //$dzto=$dzfrom . '   ... no checks on move lagaility yet ...'; $dzto=$dzfrom . '   '; } else { $templategame=str_replace("https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData","",$templategame); $templategame=str_replace("Thanks to ","",$templategame); $templategame=str_replace($dzfrom, $dzto, $templategame); $dzfrom='Experimental Drag and Drop'; $dzto=$dzfrom . ''; } $templategame=str_replace($dzfrom, $dzto, str_replace(') : 3;', ') : 8; // 8', str_replace(') : 9;', ') : 64; // 64', str_replace(')) : 1;', ')) : 0; // 32', str_replace('] ? true : false;', '] ? true : false; ', str_replace(") : '';", ") : '♚ ♔ ♛ ♕ ♜ ♜ ♖ ♝ ♝ ♗ ♞ ♘ ♘ ♟ ♙ ♟ ♙⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠';", $templategame)))))); } //echo $crandlist . "\n" . $thepsource . "\n" . $correctans . "\n"; //exit; //echo $crandlist . "\n"; //echo "" . $randlist[$correctans] . "\n" . $wikidescriptions[$randlist[$correctans]] . "\n" . $wikidesignations[$randlist[$correctans]]; //exit; $templategame=str_replace("", "", $templategame); if ($randmode == 0) { // designation up top and descriptions in drop zone $templategame=str_replace('>' . (1 + $correctans) . '<', ' style=text-align:center; data-answer="0' . $theans . '">' . $theans . '<', $templategame); $templategame=str_replace('">' . $thepsource . '<', 'text-align:center;" data-answer="0' . $theans. '">' . $thecluewording . '<', $templategame); for ($i=1; $i<=99; $i++) { if ((-1 + $i) != $correctans) { $templategame=str_replace('>' . $i . '
' . $i . '' . (1 + $correctans) . '<', ' style=text-align:center; data-answer="' . $wikidesignations[$randlist[$correctans]] . '">' .$wikidesignations[$randlist[$correctans]] . '<', $templategame); $templategame=str_replace('">' . $thepsource . '<', 'text-align:center;" data-answer="' . $wikidesignations[$randlist[$correctans]] . '">' . $wikidescriptions[$randlist[$correctans]] . '<', $templategame); for ($i=1; $i<=99; $i++) { if ((-1 + $i) != $correctans) { $templategame=str_replace('>' . $i . '' . mapittwo($wikidesignations[$randlist[-1 + $i]]) . '