[Community Puzzle] Lunar Lockout

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @oolivierr,validated by @Konstant,@pluieciel and @Baptistin.
If you have any issues, feel free to ping them.

Consider this one

.....
..B.C
..A..
....D
..X..

This could be the official answer: AD AR XU

Yes it can achieve the target.
But I think it can be better.

Sometimes a little sacrifice can bring a more efficient result.
I’m not sure if it is really banned (or why banned) in the puzzle. But the best solution could have been:

AL XU

.....
..B.C
..X..
....D
.....

My interpretation is that rule 2 bans such a solution. The reason(s) for that rule will be left for the puzzle author to provide.

Regardless of Rule2 is reasonable or not, the main issue is that all current test cases and validators do not test whether this rule is followed. My no-sacrifice code can pass. My sacrifice-allowed code can pass too.

Sacrifice is a strategy in many chess and games. I feel it is a better design to embrace this extra strategy than forbidding it.

As the puzzle has been published it won’t be desirable to change the rules now. The author is free to determine the rules, and the players are also free to comment on them and even vote down the puzzle if they want.

However, a stated rule not being covered by any test cases and validators is an issue. I have left a comment on the contribution to request the author to follow up.

2 Likes

Thanks your response. U’re always so cool.

1 Like

Ok, I saw the messages. I will add the example of the statement as a test. Thank you for this feedback.

Could someone explain Rule 4? My code passes all test cases and all but the last validator (“Validator 6”). I am not sure what I am missing. Thanks.

I think Rule 4 is a specific case applying Rule 3, meaning that the Spacepod won’t stop at the Emergency Entry Port (and will continue to move, or “jet over” the Port) unless a blocking Helper-Bot stops it there.

1 Like

Hi,

Either I’m not on the good algorythme or the optimisation is quite hard. I get all tests ok out of the tests 5 (IDE and validator).
I’m trying to backtrack in recursive way but the avoidance of Left/Right Cycle and Up Down cycles without limiting to much some moves is making this quite over my skillset…
Either I’m reaching the end of calculation but with limited solutions and not the targeted one, either I open the recursivity too much and the cycles are way to many…

Could anyone MP any hint, I would be very thanks full.

Thanks!

A simple breadth first search without much optimisation should be sufficient, and remember to keep a record of seen puzzle states so you don’t repeat those.