update
This commit is contained in:
parent
c4c3abd6d2
commit
45b114d7ef
3 changed files with 15 additions and 8 deletions
|
@ -1,4 +0,0 @@
|
|||
package Solver
|
||||
|
||||
type SudokuSolver struct {
|
||||
}
|
10
SudokuValidator/Solver.go
Normal file
10
SudokuValidator/Solver.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package SudokuValidator
|
||||
|
||||
type SudokuSolver struct {
|
||||
Validator *SudokuValidator
|
||||
}
|
||||
|
||||
func NewSudokuSolver() *SudokuSolver {
|
||||
solver := &SudokuSolver{Validator: NewSudokuValidator()}
|
||||
return solver
|
||||
}
|
9
main.go
9
main.go
|
@ -31,11 +31,12 @@ func main() {
|
|||
{'.', '.', '.', '.', '8', '.', '.', '7', '9'},
|
||||
}
|
||||
tick := time.Tick(time.Millisecond)
|
||||
|
||||
validator := SudokuValidator.NewSudokuValidator()
|
||||
start := <-tick
|
||||
fmt.Println("Example 1 is valid:", validator.IsValidSudoku(&board1))
|
||||
fmt.Println("Example 2 is valid:", validator.IsValidSudoku(&board2))
|
||||
|
||||
solver := SudokuValidator.NewSudokuSolver()
|
||||
fmt.Println("Example 1 is valid:", solver.Validator.IsValidSudoku(&board1))
|
||||
fmt.Println("Example 2 is valid:", solver.Validator.IsValidSudoku(&board2))
|
||||
|
||||
end := <-tick
|
||||
elapsed := end.Sub(start)
|
||||
fmt.Println("Time elapsed:", elapsed.Microseconds(), "microseconds")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue