first successful run to solve a simple puzzle

This commit is contained in:
2026-07-25 06:58:15 +02:00
parent 8e99087a30
commit 7bf4a8d725
15 changed files with 201 additions and 28 deletions
+17 -1
View File
@@ -1,6 +1,9 @@
package board
import "strings"
import (
"fmt"
"strings"
)
func (f *Field) String() string {
//TODO: auf beliebige größen anpassen
@@ -45,6 +48,19 @@ func (f *Field) String() string {
return sb.String()
}
func (f *Field) StringNotesForNumber(n int) string {
return "StringNotesForNumber is not implementet"
}
func (f *Field) StringNotes() string {
var str strings.Builder
fmt.Fprintf(&str, "Notes:\n")
f.ForEachCell(func(cell *Cell) {
fmt.Fprintf(&str, "Pos: %d/%d - Notes: %v\n", cell.Pos.row, cell.Pos.column, cell.Notes.numbers)
})
return str.String()
}
func (f *Field) IsSolved() bool {
result := true
f.ForEachCell(func(cell *Cell) {