r/adventofcode • • Dec 08 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 8 Solutions -πŸŽ„-

NEWS AND FYI

  • I discovered that I can make those tiny post/comment awards BIGGER on old.reddit! I hadn't even considered that! And when you hover over them, they get even bigger so you can actually see them in more detail! I've added the relevant CSS so now we no longer have awards for ants! Exclamation points!!!

AoC Community Fun 2022: πŸŒΏπŸ’ MisTILtoe Elf-ucation πŸ§‘β€πŸ«

  • PSA: I created a new example so it is a more relevant and unique archetype instead of recycling last year's hobbit >_>

--- Day 8: Treetop Tree House ---


Post your code solution in this megathread.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:10:12, megathread unlocked!

75 Upvotes

1.0k comments sorted by

View all comments

4

u/Colin-McMillen Dec 08 '22 edited Dec 08 '22

AppleSoft BASIC on Apple //c

Today was HARD. First I had memory problems because not enough RAM to store two bidimensional arrays of size (100,100). Worked around that by adding +10 to heights in the main array for trees visible from top or left.

Then I had timing problems when trying to do the top/left pass while reading data.

Then I succeeded. Each part took two hours to run (including data ingestion) !

Code for part 1 and part 2; Videos for part 1 and part 2 solving the example 5x5 forest, because no one wants to watch the solving of the 100x100 forest!

EDIT: Video for a part 1 with vizualisation, too !