Part 1
In this puzzle we need to find a way through a maze. The difference to other route finding puzzle are the available directions each step. To get the possible directions, we MD5-hash the current route prepended with a seed. The first 4 characters of the hash tell us, if a direction is possible. We need to find the shortest path from the top-left to the bottom right corner.
We keep a list of all currently available paths. In a loop, we take the currently shortest path, check for the possible directions (both by the MD5-hash and restricting paths to the 4x4 grid). If a path leads to the target location, we return its path as the solution.
No comments:
Post a Comment