diff options
Diffstat (limited to 'advent/src/12.rs')
-rw-r--r-- | advent/src/12.rs | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/advent/src/12.rs b/advent/src/12.rs index 4eefad0..a1f32ae 100644 --- a/advent/src/12.rs +++ b/advent/src/12.rs @@ -1,3 +1,22 @@ +// [nix-shell:~/projects/sandbox/advent]$ cargo run --bin 12 +// Compiling advent v0.1.0 (/home/orbekk/projects/sandbox/advent) +// Finished dev [unoptimized + debuginfo] target(s) in 0.40s +// Running `target/debug/12` +// After 10 steps: +// pos=<x= 2, y= 1, z= -3>, vel=<x= -3, y= -2, z= 1> +// pos=<x= 1, y= -8, z= 0>, vel=<x= -1, y= 1, z= 3> +// pos=<x= 3, y= -6, z= 1>, vel=<x= 3, y= 2, z= -3> +// pos=<x= 2, y= 0, z= 4>, vel=<x= 1, y= -1, z= -1> +// +// energy=179 +// +// After 1000 steps: +// pos=<x=-26, y= 45, z=-31>, vel=<x= 2, y= 17, z= 6> +// pos=<x= 87, y= 23, z=-12>, vel=<x=-14, y=-13, z= 9> +// pos=<x=-33, y= -2, z=-24>, vel=<x= -2, y=-15, z= -5> +// pos=<x=-20, y=-86, z= 77>, vel=<x= 14, y= 11, z=-10> +// +// energy=14645 use std::fmt; #[derive(Debug)] @@ -99,15 +118,8 @@ fn main() { make_moon(2, -7, 3), make_moon(9, -8, -3), )); - run_steps(_ex1, 10, true); + run_steps(_ex1, 10, false); println!(); run_steps(_ex2, 1000, false); } -// After 1000 steps: -// pos=<x=-26, y= 45, z=-31>, vel=<x= 2, y= 17, z= 6> -// pos=<x= 87, y= 23, z=-12>, vel=<x=-14, y=-13, z= 9> -// pos=<x=-33, y= -2, z=-24>, vel=<x= -2, y=-15, z= -5> -// pos=<x=-20, y=-86, z= 77>, vel=<x= 14, y= 11, z=-10> -// -// energy=14645 |