Blunder - Episode 1 - Puzzle discussion

Okay, I misunderstood, I thought in case of loop we should write everything until we realize the LOOP, but it was avoid to write anything but LOOP.

Kind of stuck in the second test. For some reason while moving east and hitting an obstacle the console is telling me i should have moved south instead of north (there’s no reversal in the map)

You are supposed to try south direction first if the current direction would land you on an obstacle…

When Bender encounters an obstacle, he changes direction using the following priorities: SOUTH, EAST, NORTH and WEST.

1 Like

Yea found out the second i sent this message but then i couldn’t find the message to delete it. Thanks for the help anyway ~~~~

Hello coders :),
I’m writting the program in Java and I am getting time outs all the time. If I run the text locally everything is nice (tested locally) and smooth (like running android apps in the AVD of Android Studio). I am using a big while(true) loop with 3 switchs inside (first one for storing next posion, second one for checking map [here there ir more switch and if-else logic but ther is’t loops] and the last one for printing directions to System.out). Can anyone give me some advice on time optimization of the algorithm?

Thanks in advance,
Happy coding.

Wow what a big working loop…perhaps it’s time to take a break :grinning:.

3 Likes

Hey, loved this puzzle.
I just loved it in python but I had troubles with the last one. I figured it wasnt a loop but I didnt understand why it was looping.

Then I saw that the TP positions I saved earlier got corrupted during the run and one of the position was replaced by the other (they were both the same) so I just had a loop in the end. I dont understand why it happens. Solved it by recalculating the TP positions each round.

Hi, i don’t know if it is the right place to put this. But i can’t complete to 100% Bender, even though all test are clear and no anwser are harcoded. Is it normal ?

Yes, it’s normal, that’s because the final test cases are different from the ones you can see. You’ll have to check your code again for any possible bugs or inefficiencies.

1 Like

The validator you’re failing is the same validator I shared earlier in this thread:

Sorry I didn’t see it, thank you.

@TwoSteps could you also share validator for “06 Breaker mode”? I’m having some nasty bug I cannot trace…
Thanks

Breaker mode

10 10
##########
#    @   #
#        #
#    B   #
#    X   #
#    X   #
#    B   #
#     BX$#
#    XXXX#
##########

SOUTH
SOUTH
SOUTH
SOUTH
SOUTH
SOUTH
EAST
EAST
EAST

Hi,
I’m back on Blunder episode 1 where i’m stuck at 91%, the LOOP validator fail,
To understand what i miss @TwoSteps could you also share the validator for “11 LOOP”.
Thanks

here you go:

Loop validator

15 15
###############
#      X$     #
#      X      #
#  @   X      #
#  SW  X     T#
#      XXXXXXX#
#  B   TS     #
#  XN   W     #
#  X          #
#  B          #
#    B  BI  NX#
#  XXXXXX     #
#             #
#             #
###############

LOOP

Thank you !

This so far, has been my favorite puzzle. Really makes you think about a good logic-tree.
Thank you! :smiley:

I think tests are not complete enough. For example, let’s consider this input:

5 4
####
#@$#
#I #
#  #
####

The answer should be LOOP. But my solution (Coding Games and Programming Challenges to Code Better), that stuck with an eternal loop on that situation, gets 100% result on the platform.
The same would be if we change ‘I’ to ‘B’ in the input.
The correct solution is here (Coding Games and Programming Challenges to Code Better) - 100% result too.

Probably there’re some more hidden unchecked test cases, but I’m not sure.

in my case it works to clear the visited list every time we break a wall, because this wall breaking updates the map so we can revisit if the map was updated.

HOW does multiple loops work? I have hashed the state of the game with the player state as well as the X destroyed status and it works everywhere except for Multiple loops… HOW and WHY would you be able to complete this maze if you come back a second time at the same position with you and the map at the exact same state?