Do you know what's better than one kind of interpreter? Two kinds of interpreter!
Day 20 - The Problem
We safely finished testing our tractor beam and have landed on Pluto to do some exploring.
Part 1 needs us to find the best path through a maze with warp tiles. Man, those Plutonians (Plutoids?) were good at using minimal space!
Part 2 reveals that the warp tiles actually move us up and down through recursive space, and we need to find the shortest path into a recursively generated maze.
Ongoing Meta
Dev.to List of Leaderboards
-
120635-5c140b9a
- provided by Linda Thompson
If you were part of Ryan Palo's leaderboard last year, you're still a member of that!
If you want me to add your leaderboard code to this page, reply to one of these posts and/or send me a DM containing your code and any theming or notes you’d like me to add. (You can find your private leaderboard code on your "Private Leaderboard" page.)
I'll edit in any leaderboards that people want to post, along with any description for the kinds of people you want to have on it. (My leaderboard is being used as my office's leaderboard.) And if I get something wrong, please call me out or message me and I’ll fix it ASAP.
There's no limit to the number of leaderboards you can join, so there's no problem belonging to a "Beginner" and a language specific one if you want.
Top comments (5)
Dirty simple kotlin solution for part 1...
I'm not proud, part 2 is basically just part 1 with the ability to move up and down levels.
I let it run overnight to get my answer. :-\
Ok time to do something different. I've done part 1 for this one in Rust! Scanning the maze for the labels was the tricky bit as I just did a row-by-row scan looking for capital letters. The route finding was easy - just count portal partners as neighbours and do a standard flood-fill or dijkstra type search.
Full code here. I'll come back for part 2.
Solving part 2 in 45ms - JavaScript
Part 2 of this one has me quite confused. The level shifting seems straightforward but the example given has the possibility to loop ever deeper into the maze, which you have to detect and prevent. I've tried various ideas of checking past transits through the same portal in the same direction for equally spaced level deltas, etc., but I seem to be closing off valid routes and exiting the search without an answer. I think I'm missing some important detail of the representation of the portals that would make things much simpler. Any tips?