Ejemplo n.º 1
0
function writeComment($db, $value)
{
    writeToDb($db, "Comment", "examen_comment", $value);
}
Ejemplo n.º 2
0
        #foreach ($chewsOutput as $line) {
        #	       echo "chewsOutput = ".$line."<br/>";
        #	       }
        echo "</p>";
        echo "<p>";
        echo "<h3>Image</h3>";
        echo "<img src=" . PATH_SVG_WWW . basename($svgName) . ">";
        writeToDb($word, True);
    } else {
        echo "<p class=\"error\">No Solution Found, sorry!<br/>";
        #echo "<p class=\"error\">chewsRetval=".$chewsRetval."</p>";
        # foreach ($chewsOutput as $line) {
        # 	       echo "chewsOutput = ".$line."<br/>";
        # 	       }
        echo "</p>";
        writeToDb($word, False);
    }
} else {
    echo "<p><span class=\"error\">Please enter a word above and press 'Submit'.</span></p>";
}
?>

<h1>How it Works</h1>
<h2>Word Solver</h2>
<p>The ChEWS solver is written in python (file ChEWS.py), and uses the svgwrite library to produce the output images.</p>
<ul>
<li>We have a database of all the chemical elements and their symbols.</li>
<li>Starting with the first letter of the required word, we search through the elements to find the first one that matches the required letter, and add that element to the output list.</li>
<li>We work our way through each remaining letter in the target word until we find the solution.</li>
<li>If we have added an element that has added a second letter that does not match the word, we remove it, and look for another possibility.</li>
<li>If we get to the end of the list of elements without finding a match, we remove the previous element, and try searching again.</li>
Ejemplo n.º 3
0
function writeAnatomicOrientation($db, $value)
{
    writeToDb($db, "AnatomicOrientation", "anatomicOrientation_name", $value);
    writeAnatomicOrientationLogs($db, $value);
}