aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
authorSan Jacobs2023-05-20 09:03:25 +0200
committerSan Jacobs2023-05-20 09:03:25 +0200
commit74ed85075819146fe9be4310bb709d80fa96c294 (patch)
treed44e2e8b6c86b5b4f015dc1507d91f5794905b91 /src/main.odin
parent46fdf2827e80e1dab0efd7173c9f518af8e38831 (diff)
downloadsatscalc-74ed85075819146fe9be4310bb709d80fa96c294.tar.gz
satscalc-74ed85075819146fe9be4310bb709d80fa96c294.tar.bz2
satscalc-74ed85075819146fe9be4310bb709d80fa96c294.zip
Implemented lunch() like a boss
The lunch() function was pretty broken in v0.2.0-alpha, so a long lunch would cause all sorts of problems. Not anymore, friends!
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main.odin b/src/main.odin
index 89ff39e..d64d5e3 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -4,12 +4,23 @@ import "core:fmt"
main :: proc() {
//test()
- new_workday({10, 22, 1, 5, 2023},
- {00, 08, 5, 5, 2023},
- {00, 05, 6, 5, 2023},
- {30, 21, 5, 5, 2023})
+ workday: = new_workday({10, 22, 4, 5, 2023},
+ {00, 08, 5, 5, 2023},
+ {00, 05, 6, 5, 2023},
+ {30, 21, 5, 5, 2023})
+ //lunch(&workday, {00, 16, 5, 5, 2023}, {00, 17, 5, 5, 2023})
+ lunch(&workday, {00, 12, 5, 5, 2023}, {45, 22, 5, 5, 2023})
+ //lunch(&workday, {00, 12, 5, 5, 2023}, {30, 12, 5, 5, 2023})
+ //lunch(&workday, {30, 16, 5, 5, 2023}, {30, 17, 5, 5, 2023})
+ //lunch(&workday, {30, 19, 5, 5, 2023}, {30, 22, 5, 5, 2023})
+ for each_block, i in workday.blocks {
+ fmt.printf("Block %2i: %s $f: %i%% %s\n", i+1, toString(each_block), int((each_block.value-1)*100), each_block.reason)
+ }
}
+// TODO: Separate tests into different procedures
+// TODO: Write dedicated tests for lunch
+
test :: proc() {
fmt.println("\n--- TESTING PRINT STUFFS ---")