Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Advent of Code 2024: Day 2

days/Day10.livemd

Advent of Code 2024: Day 2

Mix.install([
  {:req, "~> 0.5.8"}
])

Data

require Integer
opts = [headers: [{"cookie", "session=#{System.fetch_env!("AOC_SESSION_COOKIE")}"}]]
input = Req.get!("https://adventofcode.com/2024/day/10/input", opts).body
test_input = ""

Parser

Parser Description

defmodule Parser do
  def parse input do
    input
  end
end

Parser.parse test_input
Parser.parse input

Solution

Part 1

Solution Part 1 Description

Part 2

Solution Part 2 Description

defmodule Day10 do
  def part1 input do
    input
  end

  def part2 input do 
    input
  end 
end

Day10.part1 test_input

Testing

ExUnit.start(auto_run: false, exclude: [:skip])

defmodule Day10Specs do
  @test_input test_input
  @real_input input
  use ExUnit.Case, async: false

  test "part 1 should return x for the test input" do
    assert Day10.part1(@test_input) === 0
  end

  @tag :skip
  test "part 1 should return x for the real input" do
    assert Day10.part1(@real_input) === 0
  end
  
  test "part 2 should return x for the test input" do
    assert Day10.part2(@test_input) === 0
  end

  @tag :skip
  test "part 2 should return x for the real input" do
    assert Day10.part2(@real_input) === 0
  end
  
end

ExUnit.run()

Results

Part 1 Result

Day10.part1(input)

Part 2 Result

Day10.part2(input)