|
@@ -25,7 +25,7 @@ fn main() {
|
|
|
.arg(arg!(-d --debug ... "Debug output").action(ArgAction::SetTrue))
|
|
|
.get_matches();
|
|
|
|
|
|
- let mut debug : bool = false;
|
|
|
+ let mut debug: bool = false;
|
|
|
if args.get_flag("debug") {
|
|
|
debug = true;
|
|
|
}
|
|
@@ -47,15 +47,21 @@ fn main() {
|
|
|
} else {
|
|
|
if debug {
|
|
|
s.display_possible();
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
while s.solve(debug) {
|
|
|
println!("Try it again...");
|
|
|
if debug {
|
|
|
- s.display();
|
|
|
- s.display_possible();
|
|
|
+ s.display();
|
|
|
+ s.display_possible();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if !s.puzzle_complete() {
|
|
|
+ println!("Failed to solve by logic alone. Trying bruteforce.");
|
|
|
+ println!("Bruteforce solutions: {}", s.bruteforce_solver());
|
|
|
+ }
|
|
|
+
|
|
|
if !debug {
|
|
|
s.display();
|
|
|
}
|