consistent naming

This commit is contained in:
Ben Harris 2018-12-03 08:49:39 -05:00
parent ddcb127761
commit 7d9b68597b
Signed by: ben
GPG Key ID: 4E0AF802FFF7960C
4 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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()