32 lines
		
	
	
	
		
			1,017 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			1,017 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use factorio_blueprint::belt_finding::{common::Position, Problem};
 | |
| 
 | |
| fn main() {
 | |
|     let mut p = Problem::new(33, 13);
 | |
| 
 | |
|     p.set_blocked_range(1, 3, 2, 5, true);
 | |
|     p.set_blocked_range(1, 7, 2, 9, true);
 | |
| 
 | |
|     p.set_blocked(0, 3, true);
 | |
|     p.set_blocked(0, 8, true);
 | |
| 
 | |
|     p.set_blocked_range(10, 0, 21, 2, true);
 | |
|     p.set_blocked_range(10, 5, 21, 7, true);
 | |
|     p.set_blocked_range(10, 10, 21, 12, true);
 | |
| 
 | |
|     p.set_blocked_range(30, 3, 31, 5, true);
 | |
|     p.set_blocked_range(30, 7, 31, 9, true);
 | |
|     p.set_blocked(32, 3, true);
 | |
|     p.set_blocked(32, 9, true);
 | |
| 
 | |
|     p.add_connection(Position::new(3, 3), Position::new(29, 7));
 | |
|     p.add_connection(Position::new(3, 4), Position::new(29, 9));
 | |
|     p.add_connection(Position::new(3, 5), Position::new(29, 8));
 | |
| 
 | |
|     p.add_connection(Position::new(3, 7), Position::new(29, 3));
 | |
|     p.add_connection(Position::new(3, 8), Position::new(29, 5));
 | |
|     p.add_connection(Position::new(3, 9), Position::new(29, 4));
 | |
| 
 | |
|     println!("{p}");
 | |
|     p.find_path();
 | |
|     println!("{p}");
 | |
| }
 |