25 lines
		
	
	
	
		
			680 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			680 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use factorio_blueprint::{
 | |
|     belt_finding::common::Position,
 | |
|     layout::{Layout, Problem},
 | |
| };
 | |
| use rand::SeedableRng;
 | |
| 
 | |
| fn main() {
 | |
|     let mut p = Problem::new(Position::new(10, 10));
 | |
| 
 | |
|     let b1 = p.add_block(Position::new(3, 2));
 | |
|     let b2 = p.add_block(Position::new(5, 2));
 | |
|     let b3 = p.add_block(Position::new(5, 7));
 | |
| 
 | |
|     p.add_connection(b1, Position::new(0, 0), b2, Position::new(0, 0));
 | |
|     p.add_connection(b2, Position::new(3, 1), b3, Position::new(4, 6));
 | |
| 
 | |
|     for i in 0..10 {
 | |
|         let mut rng = rand::rngs::SmallRng::seed_from_u64(i);
 | |
| 
 | |
|         let l = Layout::new(&p, &mut rng);
 | |
| 
 | |
|         println!("Seed: {i}, Score {}", l.score());
 | |
|         l.print();
 | |
|     }
 | |
| }
 |