As below, the effect:
2 3 4 5 6 7 8 9 1
3 4 5 6 7 8 9 1 2
4 5 6 7 8 9 1 2 3
5 6 7 8 9 1 2 3 4
6 7 8 9 1 2 3 4 5
7 8 9 1 2 3 4 5 6
8 9 1 2 3 4 5 6 7
9 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9
Reply to discussion (solution)
$arr 1 = Array (' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 '); for ($i =0; $i
";}
$start = 1; $arr = Array (1, 2, 3, 4, 5, 6, 7, 8, 9); $length = count ($arr); for ($stepX =0; $stepX < $length; $stepX + +) {for ($ste Py=0, $stepY < $length, $stepY + +) {echo $arr [($stepX + $stepY + $start)% $length]. ' ';} Echo '
';}
To seek the rub points.
As below, the effect:
2 3 4 5 6 7 8 9 1
3 4 5 6 7 8 9 1 2
4 5 6 7 8 9 1 2 3
5 6 7 8 9 1 2 3 4
6 7 8 9 1 2 3 4 5
7 8 9 1 2 3 4 5 6
8 9 1 2 3 4 5 6 7
9 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9
$arr 1 = Array (' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 ', ' 6 ', ' 7 ', ' 8 ', ' 9 '); for ($i =0; $i
";}
The last one was wrong, sorry.
=10) {$tmp = $tmp%10+1;} printf ("%3d", $tmp), if (($i + 1)%9==0) {echo '
';}}? >
What are you doing here?
Nine Gongge is a 3x3 matrix (fill 1-9 number)
Sudoku is a combination of 9 nine Gongge