Initial commit

This commit is contained in:
2026-07-17 22:35:11 +02:00
parent 3121a7d818
commit 1ff0efb557
31 changed files with 895046 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package logic
import "git.kleiax.de/homepage/libs/sudoku/board"
// ────────────────────────────────────────────────────────────────────────────── //
// SOLVER STRUCTURE //
// ────────────────────────────────────────────────────────────────────────────── //
type Solver struct {
strategies []Strategy
conf struct {
all bool
repeat bool
}
}
func (s *Solver) Add(strategy Strategy) {
s.strategies = append(s.strategies, strategy)
}
func (s *Solver) initStragies(field *board.Field) {
for _, strategy := range s.strategies {
strategy.Init(field)
}
}
func (s *Solver) run(i int) bool {
//TODO: clean und Fehlerauffangen
s.strategies[i].SearchProgressableCells()
numberOfChanges := s.strategies[i].ApplyAll()
if numberOfChanges == 0 {
return false
}
return true
}
func (s *Solver) search() {
}
func (s *Solver) getSolutionPath() []board.Change {
return nil
}