Sudoku | |
function getSudoku ()
{
// Fast and simple solution for big files
$ls = 164;
$filename = "sudoku.txt";
$size = filesize ($filename);
$lines = $size / $ls;
$rand = rand(0, $lines);
$handle = fopen ($filename, "r");
$pos = $ls * $rand;
fseek ($handle, $pos, SEEK_SET);
$contents = fread ($handle, $ls);
fclose ($handle);
return $contents;
}
$sudokustr = getSudoku ();
$sudoku = explode(";", $sudokustr);
echo "
| |
|
Anleitung | phpSudoku by M-Software |