Day 14, puzzle 1
This commit is contained in:
17
src/bin/d14p1.rs
Normal file
17
src/bin/d14p1.rs
Normal file
@ -0,0 +1,17 @@
|
||||
use aoc22::{day14, util};
|
||||
|
||||
pub fn main() {
|
||||
let mut cave = day14::parse_cave(&util::parse_input());
|
||||
|
||||
println!("Initial cave:");
|
||||
cave.print();
|
||||
|
||||
let mut sand = 0;
|
||||
while cave.drop_sand() {
|
||||
sand += 1;
|
||||
}
|
||||
|
||||
println!("Final cave:");
|
||||
cave.print();
|
||||
println!("Total sand dropped: {}", sand);
|
||||
}
|
||||
Reference in New Issue
Block a user