Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
code-shoily committed Jun 29, 2024
1 parent 46d9257 commit 0909fa3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/advent_of_code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ defmodule AdventOfCode do
_ in UndefinedFunctionError -> {:error, :not_yet_solved}
end

# It takes whole four digits years (i.e. "Y2015")
defp get_year_module(year) when year >= 2015 and year <= @latest_year do
"Y" <> Integer.to_string(year)
end

# Single digit days are zero padded
defp get_day_module(day) when day >= 1 and day <= 25 do
day
|> Integer.to_string()
Expand Down

0 comments on commit 0909fa3

Please sign in to comment.