Created
December 4, 2020 01:46
-
-
Save mhanberg/02a9355c1dbc04d83b0f154bd8c3952a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mix.Tasks.D03.P1 do | |
use Mix.Task | |
import AdventOfCode.Day03 | |
@shortdoc "Day 03 Part 1" | |
def run(args) do | |
# Downloads your input for the given day and year | |
# and caches it in ~/.cache. | |
input = AdventOfCode.Input.get!(3, 2020) | |
if Enum.member?(args, "-b"), | |
do: Benchee.run(%{part_1: fn -> input |> part1() end}), | |
else: | |
input | |
|> part1() | |
|> IO.inspect(label: "Part 1 Results") | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment