diff options
Diffstat (limited to 'src/11/part2')
| -rw-r--r-- | src/11/part2 | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/11/part2 b/src/11/part2 new file mode 100644 index 0000000..0aa31f5 --- /dev/null +++ b/src/11/part2 @@ -0,0 +1,56 @@ +--- Part Two --- + +As soon as people start to arrive, you realize your mistake. People don't just care about adjacent +seats - they care about [1m[37mthe first seat they can see[0m in each of those eight directions! + +Now, instead of considering just the eight immediately adjacent seats, consider the [1m[37mfirst +seat[0m in each of those eight directions. For example, the empty seat below would see +[1m[37meight[0m occupied seats: + +.......#. ...#..... .#....... ......... ..#L....# ....#.... ......... #........ ...#..... + +The leftmost empty seat below would only see [1m[37mone[0m empty seat, but cannot see any of the +occupied ones: + +............. .L.L.#.#.#.#. ............. + +The empty seat below would see [1m[37mno[0m occupied seats: + +.##.##. #.#.#.# ##...## ...L... ##...## #.#.#.# .##.##. + +Also, people seem to be more tolerant than you expected: it now takes [1m[37mfive or more[0m +visible occupied seats for an occupied seat to become empty (rather than [1m[37mfour or more[0m +from the previous rules). The other rules still apply: empty seats that see no occupied seats become +occupied, seats matching no rule don't change, and floor never changes. + +Given the same starting layout as above, these new rules cause the seating area to shift around as +follows: + +L.LL.LL.LL LLLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL L.LLLLL.LL ..L.L..... LLLLLLLLLL L.LLLLLL.L +L.LLLLL.LL + +#.##.##.## #######.## #.#.#..#.. ####.##.## #.##.##.## #.#####.## ..#.#..... ########## #.######.# +#.#####.## + +#.LL.LL.L# #LLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL L.LLLLL.LL ..L.L..... LLLLLLLLL# #.LLLLLL.L +#.LLLLL.L# + +#.L#.##.L# #L#####.LL L.#.#..#.. ##L#.##.## #.##.#L.## #.#####.#L ..#.#..... LLL####LL# #.L#####.L +#.L####.L# + +#.L#.L#.L# #LLLLLL.LL L.L.L..#.. ##LL.LL.L# L.LL.LL.L# #.LLLLL.LL ..L.L..... LLLLLLLLL# #.LLLLL#.L +#.L#LL#.L# + +#.L#.L#.L# #LLLLLL.LL L.L.L..#.. ##L#.#L.L# L.L#.#L.L# #.L####.LL ..#.#..... LLL###LLL# #.LLLLL#.L +#.L#LL#.L# + +#.L#.L#.L# #LLLLLL.LL L.L.L..#.. ##L#.#L.L# L.L#.LL.L# #.LLLL#.LL ..#.L..... LLL###LLL# #.LLLLL#.L +#.L#LL#.L# + +Again, at this point, people stop shifting around and the seating area reaches equilibrium. Once +this occurs, you count [1m[37m26[0m occupied seats. + +Given the new visibility method and the rule change for occupied seats becoming empty, once +equilibrium is reached, [1m[37mhow many seats end up occupied?[0m + + |
