PrintHumanReadableSolutions.go 626 B

123456789101112131415161718192021
  1. package export
  2. import (
  3. "fmt"
  4. "log"
  5. )
  6. // Print solutions into a human friendly format for in the console.
  7. func (export *Export) PrintHumanReadableSolutions() {
  8. for solutionIndex, solution := range export.Controller.Solutions {
  9. log.Printf("\nSolution #%d:", solutionIndex+1)
  10. fmt.Println("╔═══════════╗")
  11. for rowIndex, row := range solution {
  12. if rowIndex == 3 || rowIndex == 6 {
  13. fmt.Println("╟───┼───┼───╢")
  14. }
  15. fmt.Println("║" + row[0:3] + "│" + row[3:6] + "│" + row[6:9] + "╢")
  16. }
  17. fmt.Println("╚═══════════╝")
  18. }
  19. }