54 lines
1.4 KiB
Rust
54 lines
1.4 KiB
Rust
use factorio_blueprint::belt_finding::{brute_force::BruteforceBuilder, Direction, Position};
|
|
|
|
fn main() {
|
|
let mut b = BruteforceBuilder::new(14, 6);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 0), Direction::Right),
|
|
(Position::new(13, 0), Direction::Right),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 1), Direction::Right),
|
|
(Position::new(13, 1), Direction::Right),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 2), Direction::Right),
|
|
(Position::new(13, 2), Direction::Right),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 3), Direction::Right),
|
|
(Position::new(13, 3), Direction::Right),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 4), Direction::Right),
|
|
(Position::new(13, 4), Direction::Right),
|
|
);
|
|
|
|
b.add_path(
|
|
(Position::new(0, 5), Direction::Right),
|
|
(Position::new(13, 5), Direction::Right),
|
|
);
|
|
|
|
// b.set_blocked_range(7, 2, 10, 2, true);
|
|
// b.set_blocked_range(7, 3, 10, 4, true);
|
|
|
|
b.set_blocked_range(3, 2, 10, 3, true);
|
|
|
|
let mut b = b.build();
|
|
|
|
println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
|
|
while b.next_finish_state() {
|
|
println!("{}\n{}\n{}", b.count(), b.solution_count(), b);
|
|
}
|
|
println!("{}\n{}", b.count(), b.solution_count());
|
|
|
|
// println!("{}\n{}", b.count(), b);
|
|
|
|
// while b.next_state() {
|
|
// println!("{}\n{}", b.count(), b);
|
|
// }
|
|
}
|