Skip to content

Commit

Permalink
Add stats to reflections
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacG committed Dec 25, 2022
1 parent 27443ea commit b4841df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
32 changes: 32 additions & 0 deletions 2022/reflections.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
# Personal Stats

```
--------Part 1-------- --------Part 2-------- --------Delta---------
Day Time Rank Score Time Rank Score Time Rank Score
25 00:13:47 424 0 00:13:57 367 0 00:00:10 -57 0
24 00:39:30 511 0 00:49:35 578 0 00:10:05 67 0
23 01:45:17 2802 0 01:50:56 2643 0 00:05:39 -159 0
22 00:30:23 385 0 02:20:36 787 0 01:50:13 402 0
21 00:10:57 892 0 00:43:40 1160 0 00:32:43 268 0
20 03:28:43 4332 0 03:38:20 3833 0 00:09:37 -499 0
19 01:24:11 707 0 04:07:57 1794 0 02:43:46 1087 0
18 00:37:52 3545 0 01:29:05 2695 0 00:51:13 -850 0
17 00:58:36 1316 0 03:20:28 2018 0 02:21:52 702 0
16 01:22:05 1045 0 04:40:30 1803 0 03:18:25 758 0
15 00:46:53 3021 0 01:19:37 1988 0 00:32:44 -1033 0
14 00:30:59 1903 0 00:34:15 1478 0 00:03:16 -425 0
13 00:11:14 217 0 00:38:15 1748 0 00:27:01 1531 0
12 00:31:26 2167 0 00:35:08 1924 0 00:03:42 -243 0
11 00:45:21 4022 0 00:50:31 1988 0 00:05:10 -2034 0
10 00:06:54 318 0 00:15:42 311 0 00:08:48 -7 0
9 00:08:47 198 0 00:14:31 115 0 00:05:44 -83 0
8 00:24:34 4252 0 00:30:12 2189 0 00:05:38 -2063 0
7 00:18:24 574 0 00:21:18 435 0 00:02:54 -139 0
6 00:03:29 809 0 00:05:09 1231 0 00:01:40 422 0
5 01:44:42 16539 0 01:46:47 15448 0 00:02:05 -1091 0
4 00:04:09 859 0 00:05:28 559 0 00:01:19 -300 0
3 00:03:54 246 0 00:06:32 204 0 00:02:38 -42 0
2 00:06:06 806 0 00:12:41 1634 0 00:06:35 828 0
1 00:04:20 2131 0 00:05:36 1622 0 00:01:16 -509 0
```

# Day 1: Calorie Counting. Count how many calories the elves have.

I spend the first three minutes trying to create a file since my template generator was broken.
Expand Down
6 changes: 5 additions & 1 deletion add_deltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@


def time_to_sec(timestr: str) -> int:
if timestr == ">24h":
return 0
parts = timestr.split(":")
return int(parts[0]) * 60 * 60 + int(parts[1]) * 60 + int(parts[2])


def fmt_time(seconds: int) -> str:
if seconds == 0:
return ">24h"
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
return f"{hours:02}:{minutes:02}:{seconds:02}"
Expand All @@ -24,6 +28,6 @@ def fmt_time(seconds: int) -> str:
td = fmt_time(time_to_sec(t2) - time_to_sec(t1))
rd = int(r2) - int(r1)
ss = int(s1) + int(s2)
print(f"{d:>3} {t1} {r1:>5} {s1:>5} {t2} {r2:>5} {s2:>5} {td} {rd:>5} {ss:>5}")
print(f"{d:>3} {t1:>8} {r1:>5} {s1:>5} {t2:>8} {r2:>5} {s2:>5} {td:>8} {rd:>6} {ss:>5}")


0 comments on commit b4841df

Please sign in to comment.