Change internal Solution storage to [][]string (Closes #24)

This commit is contained in:
2025-01-28 01:43:47 +01:00
parent 515034a64e
commit 647476f6d8
3 changed files with 9 additions and 15 deletions

View File

@ -5,7 +5,7 @@ import (
)
// Prepare a valid solution for storage.
func (solver *Solver) renderCombination(row1 int, row2 int, row3 int, row4 int, row5 int, row6 int, row7 int, row8 int, row9 int) string {
func (solver *Solver) renderCombination(row1 int, row2 int, row3 int, row4 int, row5 int, row6 int, row7 int, row8 int, row9 int) []string {
row1s := strconv.Itoa(row1)
row2s := strconv.Itoa(row2)
@ -17,5 +17,5 @@ func (solver *Solver) renderCombination(row1 int, row2 int, row3 int, row4 int,
row8s := strconv.Itoa(row8)
row9s := strconv.Itoa(row9)
return row1s + "\n" + row2s + "\n" + row3s + "\n" + row4s + "\n" + row5s + "\n" + row6s + "\n" + row7s + "\n" + row8s + "\n" + row9s + "\n"
return []string{row1s, row2s, row3s, row4s, row5s, row6s, row7s, row8s, row9s}
}