"; $myp = ""; $mypp = ""; $mypbefore = ""; $mypmiddle = ""; $mypafter = ""; $one = "1"; $callbit = ""; $prefixbit = ""; $language = "en_US"; $score = 1; $goes = 1; if (isset($_GET['score'])) $score = $_GET['score'] + 1; if (isset($_GET['goes'])) $goes = $_GET['goes'] + 1; if (isset($_POST['score'])) $score = $_POST['score'] + 1; if (isset($_POST['goes'])) $goes = $_POST['goes'] + 1; $cols = array('lime','orange','blue','purple','navy','teal','fuchsia','olive','maroon','gray','green'); $colpick = rand(0, (sizeof($cols) - 1)); $mycol = $cols[$colpick]; if (isset($_GET['1'])) { $thewordis = urldecode($_GET['1']); $myp = urldecode($_GET['1']) . " -> "; $mypp = urldecode($_GET['1']) . " -> "; $mypbefore = urldecode($_GET['1']) . " -> "; $callbit = "?1=" . urlencode($_GET['1']); $one = $one + 1; while (isset($_GET[$one])) { if ($one > 2) { $mypmiddle = " ... "; $prefixbit = " -> "; } else if ($one == 2) { $rest = str_replace("", "   Optionally Email Snapshot of Game   /   Chat", $rest); } $thewordis = urldecode($_GET[$one]); $myp .= urldecode($_GET[$one]) . " -> "; if (($one % 6) == 0) { $instructions = str_replace('""', '"' . $mypp . '"', $instructions); $instructions = str_replace($gpy . "); ", $gpy . "); " . 'context.strokeText("",5,' . ($gpy + 30) . '); ', $instructions); $gpy = $gpy + 30; $mypp = ""; } $mypp .= urldecode($_GET[$one]) . " -> "; $mypafter = $prefixbit . urldecode($_GET[$one]) . " -> "; $callbit .= "&" . $one . "=" . urlencode($_GET[$one]); $one = $one + 1; } $callbit = "&" . $one . "="; if (strpos($_SERVER['QUERY_STRING'], "score=") === false) $callbit = str_replace("&", "?score=1&goes=1&", $callbit); } else { if ($startword == "") { $persist = "y"; $startword = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/PHP/surprise.php?min=4&max=8"); } $callbit = "?score=1&goes=1&1=" . urlencode($startword) . "&2="; $rest = "   Optionally Email Snapshot of Game   /    Chat"; $myp = $startword . " -> "; $mypp = $startword . " -> "; $mypbefore = $startword . " -> "; $thewordis = $startword; } $selname = urldecode($thewordis); $mylist = explode('x', 'y'); while ($selname != "") { // look up Yahoo YQL thesaurus below $pageContent = file_get_contents("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20thesaurus%20where%20key%3D%22test_only%22%20and%20word%3D%22".urlencode($selname)."%22%20and%20language%3D%22" . $language . "%22&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback="); //$json_output = json_decode($pageContent); //echo $pageContent; $mylist = explode('"synonyms":"', $pageContent); if (sizeof($mylist) > 1 || $persist == "n") { for ($i=1; $i " . $proposed . " -> ", "", " -> " . $myp . " -> ")) == strlen(" -> " . $myp . " -> ") && strlen(str_replace(">" . $proposed . "<", "", ">" . $rest . "<")) == strlen(">" . $rest . "<")) { if (strpos($mywords[$ii], " (antonym)") !== false) { $selname = ""; $rest = str_replace("", "", $rest); //echo "" . str_replace(" (antonym)", "", $mywords[$ii]) . ""; } else { $selname = ""; $rest = str_replace("", "", $rest); //echo "" . str_replace(" (antonym)", "", $mywords[$ii]) . ""; } } } } if ($selname != "") { $selname = ""; $rest .= "<" . "script type='text/javascript'> alert('Oh well ... it is the end of the line ... and you scored " . $score . "'); "; $myp = str_replace("~", "", str_replace(" -> ~", "", ($myp . "~"))); $mypp = str_replace("~", "", str_replace(" -> ~", "", ($mypp . "~"))); } } else { $startword = file_get_contents("http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/PHP/surprise.php?min=4&max=8"); $callbit = "?score=1&goes=1&1=" . $startword . "&2="; $rest = "   Optionally Email Snapshot of Game   /    Chat"; $myp = $startword . " -> "; $mypp = $startword . " -> "; $mypbefore = $startword . " -> "; $thewordis = $startword; $selname = urldecode($thewordis); } } //if ($rest == "") $rest = ""; $instructions = str_replace('""', '"' . $mypp . '"', $instructions); ?> English Word Association Game - RJM Programming - January, 2015

Click to specify your word