[Community Puzzle] Hexagonal Maze - part2

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Remi,validated by @PenguinPero,@cedricdd and @Darazdeblek.
If you have any issues, feel free to ping them.

I thought I could pre-compute neighbours of all cells, including the sliding effect, but the case where the slide ends with a door is mightily annoying : if you don’t have the key, the door is a wall and you stay on the last slide ‘_’. If you have the key you end up on the door ‘X’ (meaning, technically, that you hold the key while sliding, aim for the key hole, unlock, open and slide through the threshold ^^).

A bit hard for a medium puzzle I would have rated it ‘difficult’. But I also found ‘Rush hour’ difficult (though extremely fun), so maybe I am just not fit for Remi’s challenges.

Thanks for your feedback. Maybe it is my mistake, if other people give the same feedback on the difficulty i can change it.

About the keys, let’s say that the door open automatically when you are coming with the key in your pocket ^^

Hello there!
I found it quite amusing, passed all two days with it!
However for the last tests ‘skating with keys’ i time out. Of course, I do it purelly brute force …
Any algorithm or strategy to optimize the code?
Thanks in advance!

It is doable with a simple BFS, if you take care about to avoid going twice on the same cells with the same keys.

Thanks, that was one need in order to finish it.
The other one, which I probably fabricated it, was a rule to gather the most keys as possible.
Thanks in any case, I really enjoyed it!

1 Like

Great puzzle that made me think. Especially last test gave me hard time.

1 Like

Wow, I really enjoyed this one. It reminded me of Chip’s Challenge but on a hexagonal grid instead of a cartesian grid. That last test case was a doozy and it took me a while to find the flaw in my logic.

1 Like

This is a cool puzzle but it really doesn’t feel like it belongs in the easy category.
It’s alongside things like minimum difference problems and simple rule iterations.

This is significantly harder than Death First Search (simple graph), The Bridge (impossible to backtrack) and The Labyrinth (no keys, square grid), which are classed as hard puzzles.

You are not the first one talking about the difficulty category.
I’ve just changed it, it is now a “hard” puzzle.

(it wasn’t an easy one, but a medium one)

it is not harder than the Bridge and the Labyrinth.
If it is so, than why have I solved it and the Bridge&Lab have not???

I’ve solved all of the ones mentioned.
The bridge/labyrinth took under an hour, death first search took a couple. This took me nearly a whole day to solve, mostly because I was trying not to implement A* yet again.

The key difference is that this requires an exactly optimal solution, where as the others do not.
I had a solution working very quickly, but I couldn’t get it to match the path wanted by the tests while also completing in time.

I left the Bridge suspended in my schedule. When I start thinking about it I always plan to implement something very complicated. Some weird AI-type thingy that will calculate the rewards for chosing different types of jumps and will simulate all the decision tree while branching it from start to finish. Such complexity blows my mind.

Hello,
I would like to know if we are on sliding floors in direction R towards a door (dx, dy) and that we have the keys, we arrive at the position (dx, dy) or we position ourselves on the box before (dx-1, dy)?
Exemple:
. _ _ _ A
0 1 2 3 4
Direction R: arrival coordinate (3 or 4, y) ?

You arrive on y=3 if you don’t have the ‘a’ key, or y=4 if you do.

Hello, thank for your help.

Hello,

i clicked on the all tests button which validates me each test in green but when i click on submit (yellow button) i get a error on test 11, Skating rink with keys.
Error message: The following validators differ from those present in the IDE to avoid hard-coded solutions. It is for this reason that some of them may fail even if all of the IDE’s tests pass.

That means your code is not good enough to pass that validator, which is different from the test you can see.

Hello,
What can i do then ? On what criteria should I base myself to modify my code ?