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

Day 23

day23.livemd

Day 23

Mix.install([
  {:kino, "~> 0.23.2"}
])

IEx.Helpers.c("/Users/johnb/dev/2015adventOfCode/advent_of_code.ex")
alias AdventOfCode, as: AOC
alias Kino.Input
require Integer

# Note: when making the next template, something like this works well:
#   `cat day01.livemd | sed 's/01/02/' > day02.livemd`
#

Installation and Data

input_p1example = Kino.Input.textarea("Example Data")
input_p1puzzleInput = Kino.Input.textarea("Puzzle Input")
input_source_select =
  Kino.Input.select("Source", [{:example, "example"}, {:puzzle_input, "puzzle input"}])
p1data = fn ->
  (Kino.Input.read(input_source_select) == :example &&
     Kino.Input.read(input_p1example)) ||
    Kino.Input.read(input_p1puzzleInput)
end

Part 1

defmodule Day23 do

  def solve1(text) do
    text
  end

  def solve2(text) do
    text
  end
end

# Example data:

p1data.()
|> Day23.solve1()
|> IO.inspect(label: "\n*** Part 1 solution (example: 2)")
# cqjxxyzz

p1data.()
|> Day23.solve2()
|> IO.inspect(label: "\n*** Part 2 solution (example: 2)")
#