Skip to content

Commit 07757ed

Browse files
author
Gregory Igelmund
committed
Move elixir/inputs to inputs
1 parent 77f89b7 commit 07757ed

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

elixir/lib/mix/tasks/day1.ex

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,17 @@ defmodule Mix.Tasks.Day1 do
7878
use Mix.Task
7979

8080
def run(_args) do
81-
{ :ok, input } = File.read("inputs/day1.txt")
81+
{ :ok, input } = File.read("../inputs/day1.txt")
8282
frequencies = input
8383
|> String.split
8484
|> Enum.map(&String.to_integer/1)
8585

86-
# final_frequency = frequencies |> Enum.sum
87-
# IO.puts("Hey Commander! I gave my best and according to my calculatiosn the the final frequency is #{final_frequency}!")
86+
final_frequency = frequencies |> Enum.sum
87+
IO.puts("Hey Commander! I gave my best and according to my calculatiosn the the final frequency is #{final_frequency}!")
8888

89+
IO.puts("This will take a while..")
90+
repeated_frequency = detect_repeated_frequency(frequencies)
91+
IO.puts("Hey Chief. Try `#{repeated_frequency}` for the second part.")
8992
end
9093

9194

File renamed without changes.

0 commit comments

Comments
 (0)