From c603f2d153917d7b76395de05681b2fb3fa3cbcd Mon Sep 17 00:00:00 2001 From: hanemile Date: Thu, 4 Oct 2018 16:03:53 +0200 Subject: nice prints --- print.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/print.go b/print.go index c24917d..3ef2abc 100644 --- a/print.go +++ b/print.go @@ -1,3 +1,5 @@ +// Collection of functions handling printing specific stuff + package main import ( @@ -10,10 +12,13 @@ func print_arr(arr []star) { log.Printf("[+] Printing array") - // Iterate over all the elements in the array and print their content + fmt.Println("x\t\ty\t\t | Fx\t\tFy\t\t | mass\n") + + for _, el := range arr{ - fmt.Printf("%f\t%f\t|%f\t%f\t|%f\n", el.c.x, el.c.y, el.f.x, el.f.y, el.mass) + fmt.Printf("%.6f\t%.6f\t | %.6f\t%.6f\t | %.6f\n", el.c.x, el.c.y, el.f.x, el.f.y, el.mass) } - fmt.Println("---") + fmt.Println("") } + -- cgit 1.4.1