[code=php]
<?php
$puzzle = array();
//get the known
foreach($_POST as $coordinates => $value){
//make sure that its posted coordinates
if(substr($coordinates, 0, 5)== “coord”){
//strip the string “coord” from the beginning of the coordinates
$coordinates = str_replace(“coord”, “”, $coordinates);
//make sure that its only two integers
$coordinates = int(substr($coordinates, 0, 2));
//stick it’s value in the array
$puzzle[$coordinates][$value] = TRUE;
}
}
//fill in the rest of the puzzle with all possibilites
for ($x = 0; $x <= 8; $x++) {
for ($y = 0; $y <= 8; $y++) {
if(!array_key_exists($x . $y, $puzzle)){
for ($i = 1; $i <= 9; $i++) {
$puzzle[$x . $y][$i] = TRUE;
}
}
}
}
function get_box(){
}
function is_in_row($row, $number){
}
function is_in_column($blankRow, $blankColumn){
}
function is_in_box(){
}
function is_solved(){
}
while(!is_solved()){
}
?>
<fieldset>
<form method=”post” action=”<?php $_SERVER[‘PHP_SELF’] ?>”>
<table>
<?php
for ($x = 0; $x <= 8; $x++) {
echo “nt” . ‘<tr>’;
for ($y = 0; $y <= 8; $y++) {
echo “ntt” . ‘<td>’;
echo “nttt” . ‘<input type=”text” name=”coord’ . $x . $y . ‘” />’;
echo “ntt” . ‘</td>’;
}
echo “nt” . ‘</tr>’;
}
?>
</table>
</form>
</fieldset>
this is my source so far. ive seen a couple nice sudoku sites around before, and i wanted to see if i could make a nicer one. i know im probably getting in over my head, but i wanted to see how far i could take this. quickly ran into my first problem, the server times out before the array of all possibilities is finished. the solvers ive seen around have solved the puzzle instantly. i’d rather not have to change the server configs to be able to work on one page for 10 minutes, because the average visitor isnt going to sit around that long anyway. right now it times out at a minute. is there something im doing wrong? will this just not be fast enough with php? would it be faster if i used a bunch of variables instead of a big array? HELP!