1 && (substr($_SERVER['REQUEST_URI'],($ii-1),1) != "G" && substr($_SERVER['REQUEST_URI'],$ii,1) != "a")) $bigdrt .= substr($_SERVER['REQUEST_URI'],($ii-1),1); $ii = $ii+1; } if (strpos($bigdrt, "~") !== false) { $bigdrt = ""; } else { $bigdrt = $_SERVER['DOCUMENT_ROOT']."/Games/Battleshipsandcruisers/"; } $bigdrt = str_replace("/u/sites/ozemail.com.au//Games", "/u/6/1/1331516/Games", $bigdrt); if (strpos($_SERVER['REQUEST_URI'], "mkuulma") !== false) $rjmbit = "members.ozemail.com.au%2F%7Emkuulma%2FGames%2FBattleshipsandcruisers"; $rjmb = "www.rjmprogramming.com.au/Games/Battleshipsandcruisers"; if (strpos($_SERVER['REQUEST_URI'], "mkuulma") !== false) $rjmb = "members.ozemail.com.au/~mkuulma/Games/Battleshipsandcruisers"; // if (strpos("*".$_SERVER['REQUEST_URI'], "*/~mkuulma") !== false) $drt = "http://members.ozemail.com.au/~mkuulma/"; //$bigdrt = ""; if (strpos($bigdrt, "rjmprogr") !== false) { $predrt = "http://www.rjmprogramming.com.au"; } else if (strpos($drt, "mkuulma") !== false) { $predrt = "http://members.ozemail.com.au"; $bigdrt = "/u/6/1/1331516/Games/Battleshipsandcruisers/"; } else { $predrt = "http://members.ozemail.com.au"; $bigdrt = "/u/6/1/1331516/Games/Battleshipsandcruisers/"; } $clue = ""; if (isset($_GET['isan'])) { $clue = $_GET['isan']; if (isset($_GET['alert'])) { echo ""."\n"; } } else if (isset($_GET['clue'])) { //$numarray = array( $nclue = $_GET['clue']; switch ($nclue) { case 0: $clue = 'Is the additive identity.'; break; case 1: $clue = 'Is the multiplicative identity.'; break; case 2: $clue = 'Is the only even prime.'; break; case 3: $clue = 'Is the number of spatial dimensions we live in.'; break; case 4: $clue = 'Is the smallest number of colors sufficient to color all planar maps.'; break; case 5: $clue = 'Is the number of Platonic solids.'; break; case 6: $clue = 'Is the smallest perfect number.'; break; case 7: $clue = 'Is the smallest number of sides of a regular polygon that is not constructible by straightedge and compass.'; break; case 8: $clue = 'Is the largest cube in the Fibonacci sequence.'; break; case 9: $clue = 'Is the maximum number of cubes that are needed to sum to any positive integer.'; break; case 10: $clue = 'Is the base of our number system.'; break; case 11: $clue = 'Is the largest known multiplicative persistence.'; break; case 12: $clue = 'Is the smallest abundant number.'; break; case 13: $clue = 'Is the number of Archimedian solids.'; break; case 14: $clue = 'Is the smallest even number n with no solutions to phi(m) = n.'; break; case 15: $clue = 'Is the smallest composite number n with the property that there is only one group of order n.'; break; case 16: $clue = 'Is the only number of the form xy = yx with x and y being different integers.'; break; case 17: $clue = 'Is the number of wallpaper groups.'; break; case 18: $clue = 'Is the only positive number that is twice the sum of its digits.'; break; case 19: $clue = 'Is the maximum number of 4th powers needed to sum to any number.'; break; case 20: $clue = 'Is the number of rooted trees with 6 vertices.'; break; case 21: $clue = 'Is the smallest number of distinct squares needed to tile a square.'; break; case 22: $clue = 'Is the number of partitions of 8.'; break; case 23: $clue = 'Is the smallest number of integer-sided boxes that tile a box so that no two boxes share a common length.'; break; case 24: $clue = 'Is the largest number divisible by all numbers less than its square root.'; break; case 25: $clue = 'Is the smallest square that can be written as a sum of 2 squares.'; break; case 26: $clue = 'Is the only positive number to be directly between a square and a cube.'; break; case 27: $clue = 'Is the largest number that is the sum of the digits of its cube.'; break; case 28: $clue = 'Is the 2nd perfect number.'; break; case 29: $clue = 'Is the 7th Lucas number.'; break; case 30: $clue = 'Is the largest number with the property that all smaller numbers relatively prime to it are prime.'; break; case 31: $clue = 'Is a Mersenne prime.'; break; case 32: $clue = 'Is the smallest non-trivial 5th power.'; break; case 33: $clue = 'Is the largest number that is not a sum of distinct triangular numbers.'; break; case 34: $clue = 'Is the smallest number with the property that it and its neighbors have the same number of divisors.'; break; case 35: $clue = 'Is the number of hexominoes.'; break; case 36: $clue = 'Is the smallest non-trivial number which is both square and triangular.'; break; case 37: $clue = 'Is the maximum number of 5th powers needed to sum to any number.'; break; case 38: $clue = 'Is the last Roman numeral when written lexicographically.'; break; case 39: $clue = 'Is the smallest number which has 3 different partitions into 3 parts with the same product.'; break; case 40: $clue = 'Is the only number whose letters are in alphabetical order.'; break; case 41: $clue = 'Is a value of n so that x squared + x + n takes on prime values for x = 0, 1, 2, ... n-2.'; break; case 42: $clue = 'Is the 5th Catalan number.'; break; case 43: $clue = 'Is the number of sided 7-iamonds.'; break; case 44: $clue = 'Is the number of derangements of 5 items.'; break; case 45: $clue = 'Is a Kaprekar number.'; break; case 46: $clue = 'Is the number of different arrangements (up to rotation and reflection) of 9 non-attacking queens on a 9×9 chessboard.'; break; case 47: $clue = 'Is the largest number of cubes that cannot tile a cube.'; break; case 48: $clue = 'Is the smallest number with 10 divisors.'; break; case 49: $clue = 'Is the smallest number with the property that it and its neighbors are squareful.'; break; case 50: $clue = 'Is the smallest number that can be written as the sum of 2 squares in 2 ways.'; break; case 51: $clue = 'Is the 6th Motzkin number.'; break; case 52: $clue = 'Is the 5th Bell number.'; break; case 53: $clue = 'Is the only two digit number that is reversed in hexadecimal.'; break; case 54: $clue = 'Is the smallest number that can be written as the sum of 3 squares in 3 ways.'; break; case 55: $clue = 'Is the largest triangular number in the Fibonacci sequence.'; break; case 56: $clue = 'Is the number of reduced 5 × 5 Latin squares.'; break; case 57: $clue = 'Is 111 in base 7.'; break; case 58: $clue = 'Is the number of commutative semigroups of order 4.'; break; case 59: $clue = 'Is the number of stellations of an icosahedron.'; break; case 60: $clue = 'Is the smallest number divisible by 1 through 6.'; break; case 61: $clue = 'Is the 3rd secant number.'; break; case 62: $clue = 'Is the smallest number that can be written as the sum of 3 distinct squares in 2 ways.'; break; case 63: $clue = 'Is the number of partially ordered sets of 5 elements.'; break; case 64: $clue = 'Is the smallest number with 7 divisors.'; break; case 65: $clue = 'Is the smallest number that becomes square if its reverse is either added to or subtracted from it.'; break; case 66: $clue = 'Is the number of 8-iamonds.'; break; case 67: $clue = 'Is the smallest number which is palindromic in bases 5 and 6.'; break; case 68: $clue = 'Is the 2-digit string that appears latest in the decimal expansion of π.'; break; case 69: $clue = 'Is a value of n where n squared and n cubed together contain each digit once.'; break; case 70: $clue = 'Is the smallest weird number.'; break; case 71: $clue = 'Is the number that divides the sum of the primes less than it.'; break; case 72: $clue = 'Is the maximum number of spheres that can touch another sphere in a lattice packing in 6 dimensions.'; break; case 73: $clue = 'Is the smallest multi-digit number which is one less than twice its reverse.'; break; case 74: $clue = 'Is the number of different non-Hamiltonian polyhedra with a minimum number of vertices.'; break; case 75: $clue = 'Is the number of orderings of 4 objects with ties allowed.'; break; case 76: $clue = 'Is an automorphic number.'; break; case 77: $clue = 'Is the largest number that cannot be written as a sum of distinct numbers whose reciprocals sum to 1.'; break; case 78: $clue = 'Is the smallest number that can be written as the sum of 4 distinct squares in 3 ways.'; break; case 79: $clue = 'Is a permutable prime.'; break; case 80: $clue = 'Is the smallest number n where n and n+1 are both products of 4 or more primes.'; break; case 81: $clue = 'Is the square of the sum of its digits.'; break; case 82: $clue = 'Is the number of 6-hexes.'; break; case 83: $clue = 'Is the number of strongly connected digraphs with 4 vertices.'; break; case 84: $clue = 'Is the largest order of a permutation of 14 elements.'; break; case 85: $clue = 'Is the largest n for which 12+22+32+ ... +n2 = 1+2+3+ ... +m has a solution.'; break; case 86: $clue = 'Is 222 in base 6.'; break; case 87: $clue = 'Is the sum of the squares of the first 4 primes.'; break; case 88: $clue = 'Is one of only 2 numbers known whose square has no isolated digits.'; break; case 89: $clue = 'Is 8 to power of one + 9 to the power of 2.'; break; case 90: $clue = 'Is the number of degrees in a right angle.'; break; case 91: $clue = 'Is the smallest pseudoprime in base 3.'; break; case 92: $clue = 'Is the number of different arrangements of 8 non-attacking queens on an 8×8 chessboard.'; break; case 93: $clue = 'Is 333 in base 5.'; break; case 94: $clue = 'Is a Smith number.'; break; case 95: $clue = 'Is the number of planar partitions of 10.'; break; case 96: $clue = 'Is the smallest number that can be written as the difference of 2 squares in 4 ways.'; break; case 97: $clue = 'Is the smallest number with the property that its first 3 multiples contain the digit 9.'; break; case 98: $clue = 'Is the smallest number with the property that its first 5 multiples contain the digit 9.'; break; case 99: $clue = 'Is a Kaprekar number.'; break; } if (isset($_GET['alert'])) { header('Location: ./index2.php?alert='.$_GET['alert'].'&isan='.$clue); } else { header('Location: ./index2.php?isan='.$clue); } } if (isset($_GET['winneris'])) { $cs = createscoreselect($_GET['winneris'],1,0); if (isset($_GET['ss'])) { header('Location: ./index.php?ss='.substr($_GET['ss'],0,4)); } } if (!isset($_GET['midway']) || isset($_GET['waymid'])) { if (isset($_GET['bp'])) { if (strlen($_GET['bp']) > 0) { // if (isset($_GET['qpz'])) { // $file_handle = fopen($bigdrt."Test_" . server_remote_addr() .$isess. ".bcs", "w"); // fwrite($file_handle, str_replace("<", "<",str_replace(">", ">", $_GET['qpz']))); // fclose($file_handle); // } $blueprint = $_GET['bp']; $blueprintjs = "function getBP() { var x='".$blueprint."'; return x; }"."\n"; if (isset($_GET['isess'])) { $isess = substr($_GET['isess'],0,4); $file_handle = fopen($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_js_print" . ".blue", "w"); fwrite($file_handle, $blueprintjs); fclose($file_handle); if (file_exists($bigdrt."Player_" . server_remote_addr() . ".byline".$isess)) { $file_handle = fopen($bigdrt."Player_" . server_remote_addr() . ".byline".$isess, "r"); $postq = fread($file_handle, 1024); fclose($file_handle); //echo "
problem040 ".$postq."
"; $postq = str_replace("(2)", "( 1 )", $postq); $postq = str_replace("(1)", "(2)", $postq); $postq = str_replace("( 1 )", "(1)", $postq); if (isset($_GET['youare'])) { $postq = str_replace("nextis=".$_GET['iam'], "nextis="."(".$_GET['iam'].")", $postq); $postq = str_replace("nextis=".$_GET['youare'], "nextis=".$_GET['iam'], $postq); $postq = str_replace("nextis="."(".$_GET['iam'].")", "nextis=".$_GET['youare'], $postq); $postq = str_replace(" ".$_GET['iam'], " "."(".$_GET['iam'].")", $postq); $postq = str_replace(" ".$_GET['youare'], " ".$_GET['iam'], $postq); $postq = str_replace(" "."(".$_GET['iam'].")", " ".$_GET['youare'], $postq); } //$file_handle = fopen($bigdrt."Player_" . server_remote_addr() . ".byline".$isess, "w"); //fwrite($file_handle, $postq); //fclose($file_handle); } } } } } if (isset($_GET['isess'])) { if (file_exists($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_blue_print" . ".js")) { $file_handle = fopen($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_blue_print" . ".js", "r"); $blueprintjs = fgets($file_handle); if (strlen($blueprint) == 0) { $blueprint = str_replace("function getBP() { var x='","",$blueprintjs); $xfp = strpos($blueprint, "'"); $blueprint = str_replace("'","",substr($blueprint, 0, $xfp)); } fclose($file_handle); $file_handle = fopen($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_js_print" . ".blue", "w"); fwrite($file_handle, $blueprintjs); fclose($file_handle); } else if (file_exists($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_js_print" . ".blue")) { $file_handle = fopen($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_js_print" . ".blue", "r"); if (strlen($blueprint) == 0) { $blueprintjs = fgets($file_handle); $blueprint = str_replace("function getBP() { var x='","",$blueprintjs); $xfp = strpos($blueprint, "'"); $blueprint = str_replace("'","",substr($blueprint, 0, $xfp)); } fclose($file_handle); } if (file_exists($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_blue_print" . ".js")) { unlink($bigdrt."Test_" . server_remote_addr() . "_" . $_GET['isess'] . "_blue_print" . ".js"); } $welc=""; if (isset($_GET['welc'])) { $welc = "&midway=y&welc=".$_GET['welc']; if (isset($_GET['iam'])) { $welc .= "&iam=".$_GET['iam']; } if (isset($_GET['youare'])) { $welc .= "&youare=".$_GET['youare']; } if (isset($_GET['nextis'])) { $welc .= "&nextis=".$_GET['nextis']; } } if (isset($_GET['bp'])) { //sleep(2); if (!isset($_GET['midway'])) { header('Location: ./index.php?ss='.substr($_GET['isess'],0,4).$welc); } else { header('Location: ./index.php?midway=y&ss='.substr($_GET['isess'],0,4).$welc); } } } function who_am_i($inr) { global $bigdrt; $outr = $inr; if (file_exists($bigdrt."Player_" . server_remote_addr() . ".is")) { $file_handle = fopen($bigdrt."Player_" . server_remote_addr() . ".is", "r"); $outr=fgets($file_handle); //echo "".$outr.server_remote_addr() ."
"; fclose($file_handle); } return $outr; } function biassed($insl) { $fq = strpos($insl,">".who_am_i("")." "); $cfq = ""; if ($fq !== false) { $ofq = $fq + 1; while (substr($insl,$fq,1) != "<") { $cfq = substr($insl,$fq,1).$cfq; $fq--; } $cfq = substr($insl,$fq,1).$cfq; while (substr($insl,$ofq,1) != ">") { $cfq = $cfq.substr($insl,$ofq,1); $ofq++; } $cfq = $cfq.substr($insl,$ofq,1); $fqq = strpos($insl,">Computer "); $cfqq = ""; if ($fqq !== false) { $ofqq = $fqq + 1; while (substr($insl,$fqq,1) != "<") { $cfqq = substr($insl,$fqq,1).$cfqq; $fqq--; } $cfqq = substr($insl,$fqq,1).$cfqq; while (substr($insl,$ofqq,1) != ">") { $cfqq = $cfqq.substr($insl,$ofqq,1); $ofqq++; } $cfqq = $cfqq.substr($insl,$ofqq,1); return str_replace(">Scores",">Scores".$cfq.$cfqq,str_replace($cfq, "", str_replace($cfqq, "", $insl))); } return str_replace(">Scores",">Scores".$cfq,str_replace($cfq, "", $insl)); } return $insl; } function maybeemail($inth) { global $bigdrt; $iout = $inth; $fpd = strpos($inth,"@"); if ($fpd !== false) { while (strcmp(substr($inth,$fpd,1), " ") != 0) { $fpd--; } //if (!file_exists($bigdrt."Player_" . server_remote_addr() . ".email")) { $file_handle = fopen($bigdrt."Player_" . server_remote_addr() . ".email", "w"); fwrite($file_handle, substr($inth, ($fpd + 1))); fclose($file_handle); $iout = substr($inth,0,($fpd-1)); //} } return $iout; } function jsbit($inj) { //$inj = str_replace(">","*",$inj); //$inj = str_replace("<","!",$inj); $inj = str_replace("","",$inj); //$jbit = " onclick='javascript: var xx = parent.document.getElementById(" . '"' . "score" . '"' . "); var xxx = " . '"'; $jbit = " "; if (strlen($jsbit) > 0 && strlen($dojsc) > 0) { $jbit = ""; if (strpos($dojsc," 0) { echo ''.$clue."
"."\n"; } else { if (strlen($blueprint) == 0) { echo ''."\n"; } else if (isset($_GET['bp'])) { echo ""."\n"; } else { echo ""."\n"; } if(isset($_GET['isMobile'])) echo 'World Championship Battleshipsandcruisers'; else echo 'World Championship Battleshipsandcruisers'; } ?>