51 lines
1.1 KiB
Rust
51 lines
1.1 KiB
Rust
use factorio_blueprint::{
|
|
belt_finding::{
|
|
brute_force::{Bruteforce, BruteforceBuilder, PathField},
|
|
Direction, Position,
|
|
},
|
|
misc::Map,
|
|
};
|
|
|
|
fn main() {
|
|
let mut b = BruteforceBuilder::new(6, 8);
|
|
|
|
b.add_path(
|
|
(Position::new(1, 0), Direction::Down),
|
|
(Position::new(0, 0), Direction::Up),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(4, 0), Direction::Down),
|
|
(Position::new(1, 7), Direction::Up),
|
|
);
|
|
|
|
b.set_blocked_range(0, 2, 5, 5, true);
|
|
// b.set_blocked_range(2, 0, 2, 2, true);
|
|
|
|
let mut b = b.build();
|
|
|
|
while b.next_finish_state() {
|
|
println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
|
|
}
|
|
|
|
println!("{}\n{}", b.count(), b.solution_count());
|
|
|
|
// println!(
|
|
// "{}\n{}\n{}\n{}",
|
|
// b.count(),
|
|
// b.solution_count(),
|
|
// b.modify_pointer(),
|
|
// b
|
|
// );
|
|
|
|
// for i in 0..20 {
|
|
// b.next_state();
|
|
// println!(
|
|
// "{}\n{}\n{}\n{}",
|
|
// b.count(),
|
|
// b.solution_count(),
|
|
// b.modify_pointer(),
|
|
// b
|
|
// );
|
|
// }
|
|
}
|