refactore to new project structure

This commit is contained in:
2026-07-19 11:18:16 +02:00
parent 1ff0efb557
commit 9a69d4610c
12 changed files with 108 additions and 81 deletions
+10 -7
View File
@@ -1,30 +1,33 @@
package logic
import "git.kleiax.de/homepage/libs/sudoku/board"
import (
"git.kleiax.de/homepage/board"
"git.kleiax.de/homepage/logic/strategies"
)
// ────────────────────────────────────────────────────────────────────────────── //
// SOLVER STRUCTURE //
// ────────────────────────────────────────────────────────────────────────────── //
type Solver struct {
strategies []Strategy
strategies []strategies.Strategy
conf struct {
all bool
repeat bool
}
}
func (s *Solver) Add(strategy Strategy) {
func (s *Solver) Add(strategy strategies.Strategy) {
s.strategies = append(s.strategies, strategy)
}
func (s *Solver) initStragies(field *board.Field) {
func (s *Solver) InitStragies(field *board.Field) {
for _, strategy := range s.strategies {
strategy.Init(field)
}
}
func (s *Solver) run(i int) bool {
func (s *Solver) Run(i int) bool {
//TODO: clean und Fehlerauffangen
s.strategies[i].SearchProgressableCells()
numberOfChanges := s.strategies[i].ApplyAll()
@@ -34,10 +37,10 @@ func (s *Solver) run(i int) bool {
return true
}
func (s *Solver) search() {
func (s *Solver) Search() {
}
func (s *Solver) getSolutionPath() []board.Change {
func (s *Solver) GetSolutionPath() []board.ExternalChange {
return nil
}