aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin53
1 files changed, 52 insertions, 1 deletions
diff --git a/src/main.odin b/src/main.odin
index 84d8955..d4240ce 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -3,5 +3,56 @@ package main
import "core:fmt"
main :: proc() {
- fmt.println("Hellope!")
+ test()
+}
+
+test :: proc() {
+
+ fmt.println("\n--- TESTING PRINT STUFFS ---")
+
+ test_delta: Delta = {1, 1, 1}
+ fmt.println(toString(test_delta))
+ test_delta = {0, 0, 0}
+ fmt.println(toString(test_delta))
+ test_delta = {45, 12, 1}
+ fmt.printf("I've been waiting for %s! That's a long time!\n", toString(test_delta))
+
+ start: Moment = {45, 8, 20, 4, 2023}
+ end: Moment = {45, 8, 20, 4, 2023}
+ block: Timeblock = {start, end, 0, ""}
+ fmt.println(toString(block))
+
+ fmt.println(timeprint(block))
+
+
+
+ fmt.println("\n--- TESTING WINDING ---")
+
+ test_moment: Moment = {45, 8, 30, 12, 2023}
+ fmt.println(toString(test_moment))
+ test_delta = {30, 1, 2}
+ fmt.printf("Winding forward by %s\n", toString(test_delta))
+ wind(&test_moment, 30, 1, 2)
+ fmt.println(toString(test_moment))
+
+
+ fmt.println("\n--- TESTING OPERATIONS ---")
+
+ fmt.printf("So far test_moment, holds: %s.\n", toString(test_moment))
+ fmt.printf("Using add(), that is: %s ephemerally,\n", toString(add(test_moment, test_delta)))
+ fmt.printf("but test_moment, is still: %s.\n", toString(test_moment))
+ fmt.printf("Using sub(), that is: %s ephemerally,\n", toString(sub(test_moment, test_delta)))
+ fmt.printf("but test_moment, is still: %s.\n", toString(test_moment))
+
+
+
+ fmt.println("\n--- TESTING DELTA ---")
+ fmt.printf("The diff() between %s and %s is %s.\n",
+ toString(test_moment),
+ toString(add(test_moment, test_delta)),
+ toString(diff(test_moment, add(test_moment, test_delta))))
+
+ //for i: int=1; i < 14; i += 1 {
+ // fmt.println(days_in(i, 2023))
+ //}
} \ No newline at end of file