diff options
Diffstat (limited to 'main.odin')
-rw-r--r-- | main.odin | 45 |
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 +} |