Restroom Redoubt [Day 14 - Advent of Code 2024 - Python]

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ม.ค. 2025

ความคิดเห็น • 8

  • @ninadsachania3652
    @ninadsachania3652 หลายเดือนก่อน +1

    Cool way to solve part 2!
    I just printed the first 10,000 iterations and scrolled through in VSCode while keeping an eye on the mini-map.

  • @nauden
    @nauden หลายเดือนก่อน

    I agree part 2 was annoying. I misread the problem description where it said that *most* robots would form an image and looked for a state where *all* robots were connected in one big Christmas tree, DOH!
    What worked for me was looping until no robots overlapped, and at least one robot had eight neighbors.

    • @0xdf
      @0xdf  หลายเดือนก่อน

      Yeah. Seems like a bad problem

  • @davidrudel6939
    @davidrudel6939 29 วันที่ผ่านมา

    Here is how I did part 2:
    I figured that Christmas Tree should have several long horizontal lines of robots, and there should be a high degree of symmetry. So I calculated a "Symmetry Score" for each time second that measured the degree of horizontal symmetry and looked for when that symmetry score spiked up.

    • @0xdf
      @0xdf  27 วันที่ผ่านมา

      Ah smart. It's an interesting challenge, though I still don't like not knowing if my solution also solves other inputs.

  • @illu1na
    @illu1na หลายเดือนก่อน

    Yeah this method is cool, me being thick as brick i had to create 10,000 images and then painfully going through thumbnails in the finders locate the solution lol!

    • @illu1na
      @illu1na หลายเดือนก่อน

      Note to other viewers, my input tree is located almost in the middle of the image. This makes the safety scores not much larger/smaller than other false images. Seems like better heuristics might be necessary for cases like this. Removing "Robots that are exactly in the middle (horizontally or vertically) don't count as being in any quadrant" condition from the safety score calculation didn't help.

    • @0xdf
      @0xdf  หลายเดือนก่อน

      That sounds painful