sudoku-funpark/export/PrintHumanReadableSolutions.go

22 lines
626 B
Go
Raw Normal View History

package export
2025-01-23 20:26:43 +01:00
import (
"fmt"
"log"
)
// Print solutions into a human friendly format for in the console.
2025-01-28 18:12:03 +01:00
func (export *Export) PrintHumanReadableSolutions() {
for solutionIndex, solution := range export.Controller.Solutions {
log.Printf("\nSolution #%d:", solutionIndex+1)
fmt.Println("╔═══════════╗")
for rowIndex, row := range solution {
if rowIndex == 3 || rowIndex == 6 {
fmt.Println("╟───┼───┼───╢")
}
fmt.Println("║" + row[0:3] + "│" + row[3:6] + "│" + row[6:9] + "╢")
}
fmt.Println("╚═══════════╝")
2025-01-23 20:26:43 +01:00
}
}