File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 3636shift $(( OPTIND - 1 ))
3737
3838nbr_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
You can’t perform that action at this time.
0 commit comments