Search the forum using the power of Google

Viewing 8 posts - 201 through 208 (of 208 total)
  • Advent of Code
  • 5lab
    Full Member

    Solved today in the same way I was taught years ago

    [Spoiler]popping equations off the side which has the human in, inverting them and putting them on the other side until no puzzles are left[/spoiler]

    5lab
    Full Member

    really easy today I found. just a case of chunking through the problem space. I almost assumed my initial approach (brute force) for part 2 wouldn’t work but it was fine!

    Aidy
    Free Member

    Just a lot of fiddly code yesterday, didn’t enjoy it.

    Today’s was nice and straight forward, though.

    euain
    Full Member

    Yesterday’s ended up involving drawing shapes on paper and cutting it out. I was convinced I’d find some way of programatically defining the transitions over the edges but ended up just hard-coding the 14 different transitions of my input. Pleased when it worked but not really fun.

    Todays was easy enough. I suspect there might be something clever way to do it but my laptop churned through my naive code (with some hideous inefficiencies that I kept thinking “I’ll come back and sort in part 2 when I need it to be faster”) in less than half a second. I’ll leave it there and get on with some proper work.

    Part 2 was trivial in mine – I just changed my for loop to execute for ever and added a “if (proposedMoves.isEmpty()){break;}” statement instead.

    I’m still waiting for something to cause the levels of pain that the scanners/beacons did last time. That hurt my brain.

    Aidy
    Free Member

    Yesterday’s ended up involving drawing shapes on paper and cutting it out.

    Yeah, I ended up writing numbers on the sides of a puzzle book (hacked most of it together on a plane, that’s what I had a available) to work out the relationships.

    euain
    Full Member

    High-tech programming

    State-of-the-art here… I even drew the shape in Omnigraffle to cut out.

    5lab
    Full Member

    yeah I also had a cut out cube 🙂

    today was quite simple after all the practice

    Spoiler:
    i used a breadth first search storing the hash of the grid state + move to avoid re-searching existing moves
    euain
    Full Member

    Yup – simple enough today. Quite a relief that I could just add an outer loop to handle part 2. That was unexpectedly easy.

    Spoiler:
    Well it was after I realised I’d been lazy in part 1 and thought we’ll have no need to check possible steps from the Exit location so don’t worry if we try to move to the row below the grid.

    I was getting ready to have to store a big cache of states and positions – I think the states repeat every width x height minutes but both solutions run in <1s so I settled for my simple implementation.

Viewing 8 posts - 201 through 208 (of 208 total)

You must be logged in to reply to this topic.

Search the forum using the power of Google

Join Singletrack From Only £12.501/2 Singletrack Offer

Use code HELLO54 when you join us as a print or digital member and your membership will be half price for the first year.

The Print+ membership where Singletrack magazine drops through your door, plus full digital access, is normally £45, now only £22.50 with the code. And a digital membership where you can read all the digital magazines is normally £25, and now £12.50 with the code.

Simply use code HELLO54 at checkout.

(New annually renewing membership only. Excludes Gift Memberships, Discount applies to first year. Cannot be used in conjunction with other offers, or when switching memberships)