Day 11 Parts 1 and 2

This commit is contained in:
Adam Millerchip 2020-12-11 16:09:17 +09:00
parent 7e21418813
commit bf0a9e6ff7
5 changed files with 362 additions and 1 deletions

View file

@ -2,7 +2,7 @@
My (attempted) solutions to [Advent of Code 2020](https://adventofcode.com/2020) in Elixir. My (attempted) solutions to [Advent of Code 2020](https://adventofcode.com/2020) in Elixir.
<img width="975" alt="image" src="https://user-images.githubusercontent.com/498229/101786711-97c33d80-3b41-11eb-831a-d6a9b3670f30.png"> <img width="975" alt="image" src="https://user-images.githubusercontent.com/498229/101872701-0a2b3080-3bc9-11eb-97da-884b52168ecc.png">
## Strategy ## Strategy

37
day11/README Normal file
View file

@ -0,0 +1,37 @@
Day 11 Notes
+--------+
| Part 1 |
+--------+
$ elixir day11part1.exs
2238
Pretty simple brute force that just iterates the full grid, checking the surrounding
seats for each case.
The main point seemed to be that the state was calculated immediately, which means
we need to keep the original state around while building the new state.
+--------+
| Part 2 |
+--------+
$ elixir day11part2.exs
2013
Added check_visible_in_direction to check the full line of sight, rather than just the
adjacent squares, and converted occupied_adjacent to occupied_visible to take advantage
of the new function.
+------------------+
| Overall Thoughts |
+------------------+
Naive, kind of slow brute-force techniques today.
Could look into a more efficient solution, but I didn't find the problem that interesting
so will leave it here.
What's a nice way to track/visualise a coordinate grid in Elixir? 🤔

111
day11/day11part1.exs Normal file
View file

@ -0,0 +1,111 @@
defmodule Day11Part1 do
def run do
File.read!("input")
|> String.split("\n", trim: true)
|> Enum.map(&String.to_charlist/1)
|> parse_seat_plan()
|> run_until_stable()
|> elem(2)
|> count_occupied()
|> IO.inspect()
end
def run_until_stable(state) do
new_state = tick(state)
if new_state == state do
state
else
run_until_stable(new_state)
end
end
def tick({width, height, old_seats}) do
new_seats =
for(
x <- 0..(width - 1),
y <- 0..(height - 1),
do: {x, y}
)
|> Enum.reduce(%{}, fn {x, y}, new_seats ->
toggle(old_seats[{x, y}], x, y, old_seats, new_seats)
end)
{width, height, new_seats}
end
def toggle(:empty, x, y, old_seats, new_seats) do
if occupied_adjacent(x, y, old_seats) == 0 do
Map.put(new_seats, {x, y}, :occupied)
else
Map.put(new_seats, {x, y}, :empty)
end
end
def toggle(:occupied, x, y, old_seats, new_seats) do
if occupied_adjacent(x, y, old_seats) >= 4 do
Map.put(new_seats, {x, y}, :empty)
else
Map.put(new_seats, {x, y}, :occupied)
end
end
def toggle(:floor, x, y, _, new_seats), do: Map.put(new_seats, {x, y}, :floor)
def occupied_adjacent(x, y, seats) do
adjacent = [
{x - 1, y - 1},
{x - 1, y},
{x - 1, y + 1},
{x, y - 1},
{x, y + 1},
{x + 1, y - 1},
{x + 1, y},
{x + 1, y + 1}
]
seats
|> Map.take(adjacent)
|> count_occupied()
end
def count_occupied(seats) do
Enum.count(seats, &match?({_, :occupied}, &1))
end
def parse_seat_plan(input) do
Enum.reduce(input, {0, 0, %{}}, fn row, {_x, y, seats} ->
{x, seats} =
Enum.reduce(row, {0, seats}, fn seat, {x, seats} ->
seat =
case seat do
?L -> :empty
?. -> :floor
end
{x + 1, Map.put(seats, {x, y}, seat)}
end)
{x, y + 1, seats}
end)
end
def visualize({width, height, seats}) do
for y <- 0..(height - 1) do
for x <- 0..(width - 1) do
char =
case seats[{x, y}] do
:empty -> "L"
:floor -> "."
:occupied -> "#"
end
IO.write(char)
end
IO.write("\n")
end
end
end
Day11Part1.run()

121
day11/day11part2.exs Normal file
View file

@ -0,0 +1,121 @@
defmodule Day11Part2 do
def run do
File.read!("input")
|> String.split("\n", trim: true)
|> Enum.map(&String.to_charlist/1)
|> parse_seat_plan()
|> run_until_stable()
|> elem(2)
|> count_occupied()
|> IO.inspect()
end
def run_until_stable(state) do
new_state = tick(state)
if new_state == state do
state
else
run_until_stable(new_state)
end
end
def tick({width, height, old_seats}) do
new_seats =
for(
x <- 0..(width - 1),
y <- 0..(height - 1),
do: {x, y}
)
|> Enum.reduce(%{}, fn {x, y}, new_seats ->
toggle(old_seats[{x, y}], x, y, old_seats, new_seats)
end)
{width, height, new_seats}
end
def toggle(:empty, x, y, old_seats, new_seats) do
if occupied_visible(x, y, old_seats) == 0 do
Map.put(new_seats, {x, y}, :occupied)
else
Map.put(new_seats, {x, y}, :empty)
end
end
def toggle(:occupied, x, y, old_seats, new_seats) do
if occupied_visible(x, y, old_seats) >= 5 do
Map.put(new_seats, {x, y}, :empty)
else
Map.put(new_seats, {x, y}, :occupied)
end
end
def toggle(:floor, x, y, _, new_seats), do: Map.put(new_seats, {x, y}, :floor)
def occupied_visible(x, y, seats) do
directions = [
{-1, -1},
{-1, 0},
{-1, +1},
{0, -1},
{0, +1},
{+1, -1},
{+1, 0},
{+1, +1}
]
Enum.count(directions, fn {vx, vy} -> check_visible_in_direction(x, y, vx, vy, 1, seats) end)
end
def count_occupied(seats) do
Enum.count(seats, &match?({_, :occupied}, &1))
end
def check_visible_in_direction(x, y, vx, vy, distance, seats) do
next = seats[{x + vx * distance, y + vy * distance}]
case next do
nil -> false
:empty -> false
:occupied -> true
:floor -> check_visible_in_direction(x, y, vx, vy, distance + 1, seats)
end
end
def parse_seat_plan(input) do
Enum.reduce(input, {0, 0, %{}}, fn row, {_x, y, seats} ->
{x, seats} =
Enum.reduce(row, {0, seats}, fn seat, {x, seats} ->
seat =
case seat do
?L -> :empty
?. -> :floor
?# -> :occupied
end
{x + 1, Map.put(seats, {x, y}, seat)}
end)
{x, y + 1, seats}
end)
end
def visualize({width, height, seats}) do
for y <- 0..(height - 1) do
for x <- 0..(width - 1) do
char =
case seats[{x, y}] do
:empty -> "L"
:floor -> "."
:occupied -> "#"
end
IO.write(char)
end
IO.write("\n")
end
end
end
Day11Part2.run()

92
day11/input Normal file
View file

@ -0,0 +1,92 @@
LLLLLLLLLL.LLLLL.LLLLL.LLLLL.LLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLLLLLLLLLLL.LLLLLLLLL.LLLLL.LLLLLLLL
LLLLLLLLLL.LLLLL.LLLLLLLLLLL.LLLLLL.LLLLLLLL.LLLLLLL.LLLLLLL.LLLLLLLL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LLLLLLLLLLLLL.L.LLLLL.LLLLLLLL
LLLLLLLLLL.LLLLL.LLLL.LLLLLL.LLLLLL.LLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLLL.LLLLLLLLL.LLLLLLLLLLLLLL
LLLLLLLLLL..LLLL.LLLL.LLLLLL.LLL.LL.LLLLLLLL.LLLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLLL.LLLLL..LLLLLLL
LLLLLLLLLL.LLLLLLLLLL.LLLLLL.LLLLLL.LLLLLLLLLLLLLLLL.LLLLLLL.LLLLLLLLLLLLLLLLLLL.LLLLL.LLLLLLLL
LLLLLLLLLLLLLLLL.LLLLLLLLLLLLLLLLLL.LLLLLLLL.LLLLLL..LLLLLLLLLLLLLLLLLLLLLLLLLLL.LLLLL.LLLLLLLL
....LLL........L......L.LL.......LL.LL.LL.L.L..LL.L.....L.LLL.....L........LL......L..L.......L
LLLLLLLLL.LLLLLLLLLLLLLLLLLL.LLLLLLLLLLLLLLL.LL.LLLL.LLLLLLL.LLLLLLLLL.LLLLLLLLL.LLLLL.LLLLLL.L
LLLLLLLLLLLLLLLLLLLLL.LLLLLL.LLLLLL.LLLLLLLL.LLLLLLL.LLLLLLL.LLLLLLLLL.LLLLLLLLLLLLLLL.LLLLLLLL
LLLLLLLLLL.LLLLL.LLLL.L.LLLL.LLL.LL.LLLLLLLL.LLLLLLL.LLLLLLL.LLLLLLLLLLLLLLLLLLL.LLLLL..LLLLLLL
LLLLLLLLLL.LLLLLLLLLLLLLLLLLLLLLLLL.LLLLLLLL.LLLLLLL..LLLLLL.LLLLLLLLL.LLLLLLLLLLLLLLL.LLLLLLLL
...............L.L...L...L....L..L..L......L.......L..L......LL.LL.LL.L.......L....L......L...L
LLLLL.LLLL.LLLLL.LLLLLLLLLLL.LLLLLL.LLLLLLLL.LLLLLLL.LLLLLLL.LLLLLLLLLLL.LLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL.L.LL.LL.LLL.LLLLLL.LLLL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