From 8cd6e34a29dcd799dac0505dd249ac987e0f41ec Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Mon, 28 Nov 2022 00:28:42 +0900 Subject: [PATCH] Update template for easier input debugging --- dayN.exs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dayN.exs b/dayN.exs index d415f0b..ba7ecec 100644 --- a/dayN.exs +++ b/dayN.exs @@ -3,16 +3,23 @@ defmodule DayREPLACE_ME do input end - def part2(input) do - input + def part2(_input) do + :ok end def run do + case input() do + :usage -> print_usage() + input -> run_parts_with_timer(input) + end + end + + def input do with [input_filename] <- System.argv(), {:ok, input} <- File.read(input_filename) do - run_parts_with_timer(input) + input else - _ -> print_usage() + _ -> :usage end end