package export

import (
	"fmt"
	"strconv"
)

// Print solutions into a human friendly format for in the console.
func (export *Export) RenderHumanReadableSolutions() (render string) {
	for solutionIndex, solution := range export.Controller.Solutions {
		render += fmt.Sprintln("\nSolution #" + strconv.Itoa(solutionIndex+1) + ":")
		render += fmt.Sprintln("╔═══════════╗")
		for rowIndex, row := range solution {
			if rowIndex == 3 || rowIndex == 6 {
				render += fmt.Sprintln("╟───┼───┼───╢")
			}
			render += fmt.Sprintln("║" + row[0:3] + "│" + row[3:6] + "│" + row[6:9] + "╢")
		}
		render += fmt.Sprintln("╚═══════════╝")
	}
	return
}
