Resolve warnings.
This commit is contained in:
parent
2bf648f657
commit
5575cb134a
6 changed files with 103 additions and 143 deletions
|
|
@ -42,19 +42,20 @@ fn main() {
|
|||
|
||||
let mut b = args.problem.get_problem();
|
||||
|
||||
println!("{b}");
|
||||
b.print();
|
||||
|
||||
match args.mode {
|
||||
Mode::Solutions => {
|
||||
while b.next_finish_state() {
|
||||
println!("{}\n{}\n{}\n{}", b.count(), b.solution_count(), b.cost(), b);
|
||||
println!("{}\n{}\n{}", b.count(), b.solution_count(), b.cost());
|
||||
b.print();
|
||||
}
|
||||
|
||||
println!("Solutions: {}\nStates: {}", b.solution_count(), b.count());
|
||||
}
|
||||
Mode::Step => {
|
||||
while b.next_state() {
|
||||
println!("{}", b);
|
||||
b.print();
|
||||
let mut s = String::new();
|
||||
let _ = io::stdin().read_line(&mut s);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use std::io;
|
||||
|
||||
use clap::{Parser, ValueEnum};
|
||||
use factorio_blueprint::belt_finding::{conflict_avoidance::ConflictAvoidance, problems, Problem};
|
||||
use std::io;
|
||||
|
||||
#[derive(ValueEnum, Clone)]
|
||||
enum Mode {
|
||||
|
|
@ -44,40 +43,40 @@ fn main() {
|
|||
|
||||
match args.mode {
|
||||
Mode::Solve => {
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
}
|
||||
Mode::ConflictAvoidance => {
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
let mut c = ConflictAvoidance::new(p);
|
||||
println!("{}", c);
|
||||
c.print();
|
||||
while c.remove_conflict() {
|
||||
println!("{}", c)
|
||||
c.print();
|
||||
}
|
||||
}
|
||||
Mode::ConflictStep => {
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
p.find_path();
|
||||
println!("{}", p);
|
||||
p.print();
|
||||
let mut c = ConflictAvoidance::new(p);
|
||||
println!("{}", c);
|
||||
c.print();
|
||||
while c.remove_conflict() {
|
||||
println!("{}", c);
|
||||
c.print();
|
||||
let mut s = String::new();
|
||||
let _ = io::stdin().read_line(&mut s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue