sudoku-funpark/export/PrintHumanReadableSolutions.go

22 lines
626 B
Go

package export
import (
"fmt"
"log"
)
// Print solutions into a human friendly format for in the console.
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("╚═══════════╝")
}
}