summaryrefslogtreecommitdiff
path: root/main.odin
diff options
context:
space:
mode:
authorSan Jacobs2024-11-05 14:36:54 +0100
committerSan Jacobs2024-11-05 14:36:54 +0100
commitb8d343e0ded8b39eee8a8295675a26c7677ac319 (patch)
tree7ca2c9f9c26401df645ff7a3518196e3ce723f2a /main.odin
downloadstatics-b8d343e0ded8b39eee8a8295675a26c7677ac319.tar.gz
statics-b8d343e0ded8b39eee8a8295675a26c7677ac319.tar.bz2
statics-b8d343e0ded8b39eee8a8295675a26c7677ac319.zip
Diffstat (limited to 'main.odin')
-rw-r--r--main.odin45
1 files changed, 45 insertions, 0 deletions
diff --git a/main.odin b/main.odin
new file mode 100644
index 0000000..da72be7
--- /dev/null
+++ b/main.odin
@@ -0,0 +1,45 @@
+package main
+
+import "core:fmt"
+import "core:os"
+
+dayrate : f64 = 3500
+
+main :: proc() {
+
+ arg_count := len(os.args)-1
+
+ total_hours : f64 = 0;
+ for i in 1..=arg_count {
+
+ fmt.printf("%d: ", i)
+
+ timeblocks, ok := importICS(os.args[i])
+
+ if ok {
+ hours : f64 = 0
+ for each_block in timeblocks {
+ hours += f64(hourcount(each_block))
+ }
+ minutes := int(f64(hours-f64(int(hours)))*60.0)
+ fmt.println(os.args[i])
+ fmt.printf(" Hour count: %f\nHours & Minutes: %02d:%02d\n\n",
+ hours, int(hours), minutes)
+ total_hours += hours
+ } else {
+ // Noffin i guess
+ fmt.printf("\n\n")
+ }
+ }
+
+ fmt.printf("\nTOTAL\n\n")
+
+ total_final_hour_fraction : f64 = total_hours - f64(int(total_hours));
+
+ total_minutes := int(total_final_hour_fraction*60.0)
+
+ fmt.printf(" Hour count: %f\nHours & Minutes: %02d:%02d\n",
+ total_hours, int(total_hours), total_minutes)
+
+ return
+}