|
@@ -25,7 +25,7 @@ fn main() {
|
|
.arg(arg!(-d --debug ... "Debug output").action(ArgAction::SetTrue))
|
|
.arg(arg!(-d --debug ... "Debug output").action(ArgAction::SetTrue))
|
|
.get_matches();
|
|
.get_matches();
|
|
|
|
|
|
- let mut debug : bool = false;
|
|
|
|
|
|
+ let mut debug: bool = false;
|
|
if args.get_flag("debug") {
|
|
if args.get_flag("debug") {
|
|
debug = true;
|
|
debug = true;
|
|
}
|
|
}
|
|
@@ -47,15 +47,21 @@ fn main() {
|
|
} else {
|
|
} else {
|
|
if debug {
|
|
if debug {
|
|
s.display_possible();
|
|
s.display_possible();
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
while s.solve(debug) {
|
|
while s.solve(debug) {
|
|
println!("Try it again...");
|
|
println!("Try it again...");
|
|
if debug {
|
|
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 {
|
|
if !debug {
|
|
s.display();
|
|
s.display();
|
|
}
|
|
}
|