about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--print.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/print.go b/print.go
new file mode 100644
index 0000000..c24917d
--- /dev/null
+++ b/print.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+	"fmt"
+	"log"
+)
+
+// print_arr prints all the items in the given array
+func print_arr(arr []star) {
+
+	log.Printf("[+] Printing array")
+
+	// Iterate over all the elements in the array and print their content
+	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.Println("---")
+}