Skip to content

Commit

Permalink
Add heart example
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Nov 17, 2015
1 parent 674fba6 commit 1c4e499
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions sudoku_test.go
Expand Up @@ -193,3 +193,35 @@ func ExampleSudoku_Resolve_hardest4() {
// |1 5 7 3 8 4 2 9 6|
// +-----------------+
}

func ExampleSudoku_Resolve_heart() {
sudoku := NewSudoku()
sudoku.BruteLimit = 2
sudoku.ParseString(`
+-----------------+
| 5 8 4 1 |
|7 4 5 3|
|2 1 9|
|9 4 2|
| 7 3 |
| 6 5 |
| 1 8 |
| 2 7 |
| 5 |
+-----------------+
`)
sudoku.Resolve()
fmt.Println(sudoku.String())
// Output:
// +-----------------+
// |3 5 8 6 2 9 4 1 7|
// |7 1 9 4 8 5 6 2 3|
// |2 4 6 7 1 3 5 8 9|
// |9 8 3 5 4 1 7 6 2|
// |5 7 2 8 9 6 1 3 4|
// |1 6 4 3 7 2 9 5 8|
// |6 2 1 9 3 4 8 7 5|
// |8 9 5 2 6 7 3 4 1|
// |4 3 7 1 5 8 2 9 6|
// +-----------------+
}

0 comments on commit 1c4e499

Please sign in to comment.