Refactor Direction and Position.
This commit is contained in:
parent
2bdfd8cc6c
commit
9751764611
6 changed files with 206 additions and 220 deletions
|
|
@ -1,58 +0,0 @@
|
|||
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);
|
||||
b.set_blocked(2, 0, true);
|
||||
b.set_blocked(11, 0, true);
|
||||
b.set_blocked(2, 5, true);
|
||||
b.set_blocked(11, 5, 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);
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use factorio_blueprint::belt_finding::{Position, Problem};
|
||||
use factorio_blueprint::belt_finding::{common::Position, Problem};
|
||||
|
||||
fn main() {
|
||||
let mut p = Problem::new(17, 13);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use factorio_blueprint::belt_finding::{Position, Problem};
|
||||
use factorio_blueprint::belt_finding::{common::Position, Problem};
|
||||
|
||||
fn main() {
|
||||
let mut p = Problem::new(33, 13);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue