2024-12-07 19:23:45 +01:00
|
|
|
package solver
|
|
|
|
|
|
|
|
import (
|
2025-01-21 21:43:27 +01:00
|
|
|
"log"
|
2024-12-07 19:23:45 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func Run() {
|
2025-01-21 21:44:21 +01:00
|
|
|
// Instantiate the Solver interface
|
2024-12-07 19:23:45 +01:00
|
|
|
solver := Solver{}
|
2025-01-21 21:37:53 +01:00
|
|
|
|
2025-01-23 22:39:59 +01:00
|
|
|
// Parse and handle flags
|
|
|
|
solver.parse_flags()
|
2025-01-23 20:26:43 +01:00
|
|
|
|
2025-01-21 21:32:50 +01:00
|
|
|
// Load blocks from CSV file
|
2024-12-07 19:23:45 +01:00
|
|
|
solver.load_blocks()
|
|
|
|
|
|
|
|
// Find rows that fit with the entered rows
|
2025-01-21 21:32:50 +01:00
|
|
|
solver.populate_blocks()
|
2024-12-07 19:23:45 +01:00
|
|
|
|
2025-01-21 21:37:07 +01:00
|
|
|
// Print the total number of solutions to validate
|
2025-01-23 20:26:43 +01:00
|
|
|
log.Println("Number of (potential) solutions:", solver.iter)
|
2024-12-07 19:23:45 +01:00
|
|
|
|
2025-01-21 21:37:53 +01:00
|
|
|
// Check the number of solutions
|
2025-01-23 20:26:43 +01:00
|
|
|
go solver.check_combinations()
|
|
|
|
solver.tracker()
|
2024-12-07 19:23:45 +01:00
|
|
|
|
2025-01-21 21:37:53 +01:00
|
|
|
// Print the valid solutions
|
2025-01-23 20:26:43 +01:00
|
|
|
solver.print_solutions()
|
2024-12-07 19:23:45 +01:00
|
|
|
|
|
|
|
}
|