From 57d228685e3197dddfb784dfb6f154af94db80d0 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 14 Jan 2020 09:33:17 -0500 Subject: [PATCH] Move println out of the loop --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 17f9bf7..fd4c140 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,9 +127,9 @@ fn output_energy(bodies: &mut [Body; BODIES_COUNT]) { + sqr(body.position[2] - body2.position[2]), ); } - - println!("{:.9}", energy); } + + println!("{:.9}", energy); } /// Steps the simulation foward by one time step