}
function showList($list, $val, $ansStr, $cROOT, $cCATEGORY, $cGENDER, $cFORM, $cPERSON, $cTENSE, $cREFERENCE, $lang, $scr, $cat)
{
    foreach ($list as $i) {
        if ($i == $val) {
            $ansStr .= "<option value='" . update($cat, $cROOT, "root", $i) . "_" . update($cat, $cCATEGORY, "category", $i) . "_" . update($cat, $cGENDER, "gender", $i) . "_" . update($cat, $cFORM, "form", $i) . "_" . update($cat, $cPERSON, "person", $i) . "_" . update($cat, $cTENSE, "tense", $i) . "_" . update($cat, $cREFERENCE, "reference", $i) . "_" . $lang . "_" . $scr . "_" . $i . "' selected='true'>" . $i . "</option>";
        } else {
            $ansStr .= "<option value='" . update($cat, $cROOT, "root", $i) . "_" . update($cat, $cCATEGORY, "category", $i) . "_" . update($cat, $cGENDER, "gender", $i) . "_" . update($cat, $cFORM, "form", $i) . "_" . update($cat, $cPERSON, "person", $i) . "_" . update($cat, $cTENSE, "tense", $i) . "_" . update($cat, $cREFERENCE, "reference", $i) . "_" . $lang . "_" . $scr . "_" . $i . "'>" . $i . "</option>";
        }
    }
    $ansStr .= "</select>";
    return $ansStr;
}
$lang = $_GET['lang'];
$scr = $_GET['scr'];
$listROOT = getOptionValueRestrict(1, $lang, $scr);
$listCATEGORY = getOptionValue(2);
$listGENDER = getOptionValue(3);
$listFORM = getOptionValue(4);
$listPERSON = getOptionValue(6);
$listTENSE = getOptionValue(9);
$listREFERENCE = getOptionValue(5);
$cROOT;
if ($_GET['root'] == "%") {
    $cROOT = $listROOT[rand(0, sizeof($listROOT) - 1)];
} else {
    $cROOT = $_GET['root'];
}
$cCATEGORY;
if ($_GET['category'] == "%") {
    $cCATEGORY = $listCATEGORY[rand(0, sizeof($listCATEGORY) - 1)];
    $I = $_GET['index'];
}
$fp = fopen("features.txt", "r");
$root = array();
while (!feof($fp)) {
    $str = fgets($fp);
    $str = str_replace("\n", "\t", $str);
    $try = explode("\t", $str);
    if (in_array($try[1], $root) == false and $try[0] == $I) {
        array_push($root, $try[1]);
    }
}
fclose($fp);
$rootWord = $root[0];
$myWord = $I;
$listROOT = getOptionValueRestrict($rootWord);
$listCATEGORY = getOptionValue(2);
$listGENDER = getOptionValue(3);
$listFORM = getOptionValue(4);
$listPERSON = getOptionValue(6);
$listTENSE = getOptionValue(9);
$listREFERENCE = getOptionValue(5);
$cROOT;
$flag = 1;
if ($_GET['root'] == "%") {
    $flag = 0;
    $cROOT = $listROOT[rand(0, sizeof($listROOT) - 1)];
} else {
    $cROOT = $_GET['root'];
}
$cCATEGORY;