Skip to content

Commit 6e9e162

Browse files
committed
update
1 parent fe4f7b8 commit 6e9e162

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,22 @@ Support Classic Form Only
249249
To generate new puzzle use `Generator.generate(size of puzzle, maximum time, minimum score, maximum score)`
250250
In which `size of puzzle` is length of puzzle edge. Example 9x9 is 9, 25x25 is 25, ..etc.
251251

252-
Example generate 8x8 puzzle within 5 seconds with minimum score of 10 and maximum score of 1.000.000:
252+
Example:
253253
```java
254-
Game game = Generator.generate(8, 5 * 1000, 10, 1000000);
254+
// register new form to generate puzzle
255+
// generator will select random form of registered forms
256+
// and generate a puzzle with that form
257+
Puzzle7.registerForm(new Puzzle7.Form(new int[][]{
258+
{0, 0, 1, 1, 1, 1, 2},
259+
{0, 0, 0, 1, 1, 1, 2},
260+
{3, 0, 0, 4, 4, 2, 2},
261+
{3, 3, 4, 4, 4, 2, 2},
262+
{3, 3, 4, 4, 6, 6, 2},
263+
{3, 5, 5, 5, 6, 6, 6},
264+
{3, 5, 5, 5, 5, 6, 6}
265+
}));
266+
// generate 7x7 puzzle within 5 seconds with minimum score of 10 and maximum score of 1.000.000
267+
Game game = Generator.generate(7, 5 * 1000, 10, 1000000);
255268
// score of generated puzzle
256269
System.out.println("Score: " + game.getScore());
257270
// puzzle
@@ -299,6 +312,7 @@ Puzzle solved = PuzzleSolver.solve(puzzle, 5 * 1000);
299312
System.out.println(solved);
300313
```
301314

315+
See Example: https://github.com/dangnguyendota/SudokuGeneratorAndSolver/blob/master/src/vn/com/dangnguyendota/Example.java
302316

303317

304318
Supported:

0 commit comments

Comments
 (0)