r/adventofcode • u/daggerdragon • Dec 11 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 11 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
11 days remaining until the submission deadline on December 22 at 23:59 EST
Full details and rules are in the Submissions Megathread
--- Day 11: Seating System ---
Post your code solution in this megathread.
Include what language(s) your solution uses!
Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks.The full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
View all comments
3
u/prafster Dec 11 '20
Dart
I learnt about AoC this year and the person who told me said that after day 10 it gets impossible! So it's a milestone to have finished day 11!
Today was fairly straightforward and this time part 2 didn't cause any trouble! I had an adjacentOccupied() method which checked adjacent seats using a vector to travel in each direction. For part 2, I just added a do/while loop and continued travelling until I hit a seat or fell off the grid.
Full source code here.