Skip to content

Commit ea0a237

Browse files
committed
Prepare for 2025 nbr days change
1 parent d33001d commit ea0a237

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bin/stats.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ done
3636
shift $((OPTIND - 1))
3737

3838
nbr_solved() {
39-
local path="./${1:-}" # Unify so that path always starts with ./, so cut below works.
39+
local year="${1:-}"
40+
local path="./${year:-}" # Unify so that path always starts with ./, so cut below works.
4041

4142
# sort -u: account for the fact that a puzzle part can be solved in multiple languages.
4243
# Regex written to work for both GNU/BSD find meaning e.g. `+` quantifier can't be used.
4344
stars=$(find "$path" -iregex '.*/part[12]\.[a-z][a-z]*$' -print | cut -d. -f2 | sort -u | wc -l)
4445

4546
# Day 25 only as part1, part2 for free.
47+
# TODO update this to check day12 instead if $year>=2025. Rename to stars_last_day
4648
stars_d25=$(find "$path" -iregex '.*/25/part1\.[a-z][a-z]*$' | cut -d. -f2 | sort -u | wc -l)
4749
((stars+=stars_d25))
4850

0 commit comments

Comments
 (0)