This is what the view source looks like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Patterncatch Solutions Page</title>
<link type="text/css" rel="stylesheet" href="Patterncatch.css" />
</head>
<body>
<div class="header" id="headersolutions"> <!--header-->
<img class="headerimage" src="images/Header-Solutions-Pic bamboo.gif" alt="Header-Solutions-Pic bamboo" height="160" />
</div> <!--end of header-->
<div> <!--menu-->
<ul class="nav navsolutions">
<li><a id="ButtonHomeBorder" href="Patterncatch Home.html">Home</a></li>
<li><a href="Patterncatch Order.html">To Order</a></li>
<li><a href="Patterncatch Tips.html">Tips</a></li>
<li><a id="ButtonSolutions" href="Patterncatch Solutions.html">Solutions</a></li>
<li><a href="Patterncatch Play Online.html">Play Online</a></li>
<li><a href="Patterncatch Daily Challenge.html">Daily Puzzle</a></li>
<li><a href="Forum">Forum</a></li>
<li><a href="Video">Video</a></li>
<li><a href="Gallery">Gallery</a></li>
<li><a href="Maths">Maths</a></li>
</ul>
</div> <!-- end menu -->
<div class="main mainsolutions">
<h1 class="h1 h1solutions">PatternCatch Solution Finder</h1>
<p>
On this page you can find out how to solve your PatternCatch if it has defeated you.<br class="wide" />
This page will give a method for solving all PatternCatch designs from a common starting point.
You just have to type in the location you are trying to reach, and select what level of help you want to receive.
</p>
<p>
You may be surprised by how few moves are required, but you have to make them in the right order! What's best is that these short solutions are often easy to learn and very neat to demonstrate.
</p>
<h2 class="h2 h2solutions">Fill in the sections below and click "Get help"</h2>
<div id="solutionsexample">
<img src="images/Solution5wheels.gif" alt="Model solution" />
</div>
<p>
1. Firstly you need to find the Start position by lining up the red pins. This is usually quick to do just by pushing pins away from you until they all line up. If this proves troublesome, there is a little <a id="video" href="images/test1.mpg" width=600 target="_blank">video</a> showing how you can get back to Start easily.
</p>
<p>
2. Next you have to look for the cells you are trying to line up, and enter their positions in the box. In the example on the right you are trying to line up the green cells. You will see that the green cell on Wheel 1 is 2 spaces above its red pin. The other green cells are 1, 4, 6, and 5 spaces above their red pins. These five numbers 2, 1, 4, 6 and 5 would be entered in the box. Do the same exercise for your puzzle.
</p>
<table>
<th id="solutions5digits">
<span id=bold>Enter YOUR five digits in this box, eg 21465</span>
</th>
<?php
$target = $_POST['targetpos'];
$minmoves = ! empty($_POST ['howmanymoves']) ? $_POST ['howmanymoves'] : "0";
$firstmove = ! empty($_POST ['firstmove']) ? $_POST ['firstmove'] : "0";
$nextmove = ! empty($_POST ['secondmove']) ? $_POST ['secondmove'] : "0";
$fullsolution = ! empty($_POST ['fullsolution']) ? $_POST ['fullsolution'] : "0";
$digit1 = !empty($target[0]) ? $target[0]:"0";
$digit2 = !empty($target[1]) ? $target[1]:"0";
$digit3 = !empty($target[2]) ? $target[2]:"0";
$digit4 = !empty($target[3]) ? $target[3]:"0";
$digit5 = !empty($target[4]) ? $target[4]:"0";
if(!empty($target)) {
$dbc = mysqli_connect('localhost','root','1729','rollplay')
or die ('Error connecting to MySQL server');
$query = "SELECT * FROM sol2 WHERE position = $target";
$result = mysqli_query($dbc,$query)
or die ('Error querying fat database');
$row = mysqli_fetch_row($result);
mysqli_close($dbc);
}
?>
<td>
<br />
<form method="post" action="Patterncatch Solutions.php">
<input name="targetpos" type="text" size="10" value= "<?php echo $target; ?>" /><br/><br/>
</td>
</table>
<?php
if(empty($target)) {
echo '<span id=moveright>You forgot to enter a number.</span>';
}
if(strlen($target)>5) {
echo '<span id=moveright>Your number is too long.</span><br /><br />';
$output_form = true;
}
if((strlen($target)<5)&&(strlen($target)>0)){
echo '<span id=moveright>Your number is too short.</span><br /><br />';
$output_form = true;
}
else if(($digit1>6)||($digit2>6)||($digit3>6)||($digit4>6)||($digit5>6)){
echo '<span id=moveright>You have a digit higher than 6. Please re-enter.</span><br /><br />';
$output_form = true;
}
?>
<p>
3. Now select the level of help you require. You can always get more. If you just want to know what the least number of moves from Start is, check only that box. Otherwise, choose as required.
<div id="Solutionscheckboxes">
<table>
<tr>
<th id=solutionsthwidth>
<input type="checkbox" value = "1" name="howmanymoves" />Minimum moves<br/>
</th>
<td>
<?php if($minmoves) {echo 'the shortest solution is '. $row[1]. ' moves.';} ?>
</td>
</tr>
<tr>
<th id=solutionsthwidth>
<input type="checkbox" value = "1" name="firstmove" />First move<br />
</th>
<td>
<?php if($firstmove) {echo 'the first move is: '. $row[2];} ?>
</td>
</tr>
<tr>
<th id=solutionsthwidth>
<input type="checkbox" value = "1" name="secondmove" />Second move<br /> </th>
<td>
<?php if($nextmove) {echo 'the second move is: '. $row[3];} ?>
</td>
</tr>
<tr>
<th id=solutionsthwidth>
<input type="checkbox" value = "1" name="fullsolution" />Full Solution<br /> </th>
<td>
<?php if($fullsolution) {echo $row[10];} ?>
</td>
</table>
</div>
</p>
<p>
4. Press the button<br /><br />
<input id="solutionshelpbutton" type="submit" name="submit" value="Get help" />
</form>
</p>
<p>
5. The only tricky bit is working out where to locate the red pins for the first move,
because it may not be against the obvious cell on the reference wheel.
The simplest method is to look at the full solution and assess what moves have to be made to wheel 1 to
line it up with the reference wheel. For example, the solution 25D, 13U, 1U, 24D, 234D,
which would deliver you a line of green cells from the layout above, requires the 1 wheel to go up two cells, on the second and third moves. So if you line up the red pins to start with exactly as they are shown above,
running through those five moves will line up all the greens against the reference wheel.
This method is reliable, but takes a little getting used to. Press the test button to see how it works.
</p>
<p>
6. Make sure the red pins are lined up and follow the solution.
The move notation is very simple, eg 25U means find a row where only the 2nd and 5th of the moving wheels have pins,
and move it up, or away from you, by one cell.
There may be a second row containing only these pins, you can use either.
</p>
<div class="footer footersolutions"><!--footer -->
© Rolloworks 2009 <br />
All rights reserved
</div><!-- end footer -->
</body>
</html>