[Community Puzzle] Hexagonal Maze - part2

You may try these first:

  • read the statement again to see if your code has missed anything.
  • read the previous discussion here to see if other players’ hints and experience may apply to you.
  • create custom cases to test your code.
  • check/improve/optimise your code for any inefficiencies, never-ending while loops, unreachable if-conditions, etc.

If you still get stuck after trying the above, you may ask again.

The last validator doesn’t check something that would not be checked by an IDE test. Maybe you just need some optimisation in your algorithm.

I checked the last validator, in comparison to the last test case, and there are more moves to do. So it might be an optimisation problem.

Hello,
I tried to redo the code but it does not validate it for test 11. I have provided the code on github along with some documentation if you want to take a look.

I’m not friend with python, but i ran your code on validator 11 and this is the error :

KeyError: (11, 77)
at Answer.py. in theWayTo on line 115
at Answer.py. in stepByStep on line 144
at Answer.py. in <module> on line 181

Does it help you ?

line 115 : end = p[end]

Challenging puzzle, yet very fun to solve
:slight_smile:

2 Likes

Hello,

From the error you show me, I can’t see how to fix it.
Actually my code is not working on the validator so, I thought it was working but it took too long to solve the maze 11.

I was able to reproduce the problem with validator 11.
Apparently it has to do with the collected set of keys.
Eg: If a route collects key “a”, another route collects key “b”, both arrive in cell X, then you mark this cell containing the two keys. In this case, even if another route passes through both keys, it will be discarded.
Solved it by creating in each cell, different sets of collected keys.

Did you see this problem only with validator 11 ?

The code described passes all tests and validators except validator 11.
The problem was with my code, not the validator.

Yes but the tests have to help you to debug, I should correct test 11 to make this bug appear …

I created this test to simulate the situation:

8 4
########
#Sa#####
##b.ABE#
########

R DL R R R R

It can also be DR UR DR R R R with the same length, so I can’t add this test. But I understand what to do, thank you very much.

You’re right, I think this is a better example:
8 5
########
#S.a####
##b.####
###ABE##
########

DR UR R DL DR R R

Thanks

Can you tell me if this test let reproduce the problem with validator 11 ?

6 12
######
#S####
##...#
##.#a#
###..#
###.##
###..#
##.#b#
##...#
#.####
##ABE#
######

DR R R DR DL DL DR DR DL L L DL DR R R

To make it easier to see :

# # # # # #
 # S # # # #
# # . . . #
 # # . # a #
# # # . . #
 # # # . # #
# # # . . #
 # # . # b #
# # . . . #
 # . # # # #
# # A B E #
 # # # # # #

Yes, this test reproduces the problem.

Thank you. I added this bonus test, I hope it will help everyone having a problem with Validator 11.

1 Like