39 lines
983 B
Rust
39 lines
983 B
Rust
use factorio_blueprint::{
|
|
belt_finding::{
|
|
brute_force::{Bruteforce, PathField},
|
|
Direction, Position,
|
|
},
|
|
misc::Map,
|
|
};
|
|
|
|
fn main() {
|
|
let mut b = Bruteforce {
|
|
map: Map::new(5, 10),
|
|
path: vec![],
|
|
end_pos: Position::new(4, 9),
|
|
end_dir: Direction::Up,
|
|
count: 0,
|
|
solution_count: 0,
|
|
};
|
|
|
|
b.apply_path_field(PathField::Belt {
|
|
pos: Position::new(1, 0),
|
|
dir: Direction::Down,
|
|
});
|
|
|
|
b.map.get_mut(0, 2).blocked = true;
|
|
b.map.get_mut(1, 2).blocked = true;
|
|
b.map.get_mut(2, 2).blocked = true;
|
|
b.map.get_mut(3, 2).blocked = true;
|
|
b.map.get_mut(4, 2).blocked = true;
|
|
|
|
b.map.get_mut(0, 4).blocked = true;
|
|
b.map.get_mut(1, 4).blocked = true;
|
|
b.map.get_mut(2, 4).blocked = true;
|
|
b.map.get_mut(3, 4).blocked = true;
|
|
b.map.get_mut(4, 4).blocked = true;
|
|
|
|
while b.next_finish_state() {
|
|
println!("{}\n{}\n{}", b.count, b.solution_count, b);
|
|
}
|
|
}
|