Creating a Sudoku program 2

Creating blank boxes

Set the blank boxes based on the answer.
Set the number of blanks and create blank boxes.
In the program, I create arrangements 1~81 and randomize them. After removing the number of blanks, we get our blank boxes.

But problems created using this method do not look very nice.
I guess it’s ok, but through my research I learned beautiful symmetrical shapes are preferred in Japan.
Furthermore, when the blank is about 45 (36 clue boxes), I can create solvable problems, but from about 50 blanks (31 clue boxes), the chance of ending up with an unsolvable problem increases. It seems there is a problem with arrangement, so I came up with a program to create beautiful arrangements.

The diagram above is point symmetrical.

Sponsored Links

Creating clues

Although an even amount of clues are nice, sometimes I still want to see columns with all 9 boxes filled in.
So, I started with the middle column (5th) first, then randomized the remaining blanks in columns 1~4.
I thought about making it even (for instance, 2~4 per column), but it seemed boring so I didn’t do that.

Point symmetrical arrangement

For columns 6~9, I flipped the arrangement of columns 1~4.
This is quite easy to do with a program, so it was no trouble.