consistent naming
This commit is contained in:
parent
ddcb127761
commit
7d9b68597b
6
day1.exs
6
day1.exs
|
@ -1,8 +1,8 @@
|
|||
defmodule Day1 do
|
||||
@initial_state %{found: [], sum: 0}
|
||||
|
||||
def get_numlist do
|
||||
File.stream!("day1.in")
|
||||
def input() do
|
||||
File.stream!("input/day1.in")
|
||||
|> Stream.map(&String.to_integer(String.trim(&1)))
|
||||
end
|
||||
|
||||
|
@ -27,6 +27,6 @@ defmodule Day1 do
|
|||
end
|
||||
end
|
||||
|
||||
numlist = Day1.get_numlist()
|
||||
numlist = Day1.input()
|
||||
IO.puts(Enum.sum(numlist))
|
||||
Day1.find_first_repeat(numlist)
|
||||
|
|
8
day2.exs
8
day2.exs
|
@ -1,11 +1,11 @@
|
|||
defmodule Day2 do
|
||||
def get_lines() do
|
||||
File.stream!("day2.in")
|
||||
def input() do
|
||||
File.stream!("input/day2.in")
|
||||
|> Stream.map(&String.trim/1)
|
||||
end
|
||||
|
||||
def find_subcount(count) do
|
||||
get_lines()
|
||||
input()
|
||||
|> Enum.reduce(0, fn x, acc ->
|
||||
if x
|
||||
|> String.graphemes()
|
||||
|
@ -22,7 +22,7 @@ defmodule Day2 do
|
|||
end
|
||||
|
||||
def find_common_chars() do
|
||||
get_lines()
|
||||
input()
|
||||
|> Enum.reduce(%MapSet{}, fn x, acc ->
|
||||
x
|
||||
|> String.graphemes()
|
||||
|
|
Loading…
Reference in New Issue