diff options
author | San Jacobs | 2023-05-16 22:28:37 +0200 |
---|---|---|
committer | San Jacobs | 2023-05-16 22:28:37 +0200 |
commit | e12cbc76905216c33d280950f20283df1281b618 (patch) | |
tree | 55ccbab26257bfb460053dbd983bee423c4536ce /src/main.odin | |
parent | ca6fdc3d98bfca6414ff9e14aab92f0094e2890e (diff) | |
download | satscalc-e12cbc76905216c33d280950f20283df1281b618.tar.gz satscalc-e12cbc76905216c33d280950f20283df1281b618.tar.bz2 satscalc-e12cbc76905216c33d280950f20283df1281b618.zip |
Taking a massive W on this, got quite far on the odin port
Diffstat (limited to 'src/main.odin')
-rw-r--r-- | src/main.odin | 53 |
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 |