Day 24
Mix.install([
{:kino, "~> 0.24.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 Day24 do
def solve1(text) do
text
end
def solve2(text) do
text
end
end
# Example data:
p1data.()
|> Day24.solve1()
|> IO.inspect(label: "\n*** Part 1 solution (example: 2)")
# cqjxxyzz
p1data.()
|> Day24.solve2()
|> IO.inspect(label: "\n*** Part 2 solution (example: 2)")
#