Don't Panic - Episode 1 - Puzzle discussion

Argh… thanks for the mention of the later tests being out of order. I had originally set the array to insert the elevator position in the array with the floor as the index then changed it to just append the array, thus it threw the later tests a curve ball. Changing back to insert using the floor as the index it worked perfectly :slight_smile:

The input for this test seems really wack and it has me really confused. The test case inputs don’t match AT ALL with what seems to actually be input. Am I crazy?

For example, first line of test case 1’s input is supposedly “14 1 100 3”. But the first line is supposed to have a lot more data than this. And if you output all of the different variables from the initialization, it doesn’t seem to be drawing from these numbers.

Hi there,

I’ve got some troubles with that one.

Well that’s what i’ve in mind, but it doesn’t work.
Cause when the headClone change his direction, direction is not updated the next turn, there’s one turn when headClone go to the left but his direction is… right ?! (See the picture)
So the algo block him to.
[http://www.hostingpics.net/viewer.php?id=527178wrongDirection.jpg]

Actually there’s no issue if we block clone asap, so i simplify the code (i thought i couldn’t block a elevator exit with a blocked clone, so my code allowed clone to do one step before being blocked) and it works, the bug remains anyway.

There’s a bug, maybe on slow computers, that if you block near the bot exit on the first level the clone_floor variable can show the wrong value.

This isn’t a blocking error, but you need a hack if you need to use this parameter.

Used python3 as language.

are you referring to the fact that clone_floor = -1 when there is no leading clone? If yes this is normal since the clone hasn’t appeared yet.

Oh! Now i see my error. Thanks for the answer. :slight_smile:

Literally 10 lines of code.
My biggest problem was understanding which clone was the leading one… doh!

if leading clone walks in the correct direction WAIT.
if leading clong walks in the wrong direction BLOCK.
Thats it…

1 Like

Is there a part two to this where there are multiple elevators per floor?

In the problem description it seems like it kind-of implied multiple elevators per floor, but then I realized halfway in that its irrelevant because there is only ever one in any of your test cases… >_>

Yes: Don’t panic Episode 2

For those who is having the “Elevator Floor” problem;
you can use SortedDictionary<…>(); for fixing the problem.
(The key will be the elevator floor and the value will be the elevator’s position)
SortedDictionary will sort your values according to your keys, without you doing anything.
(I am using C#)

1 Like

Hello guys!

I am having some troubles with this puzzle, and I would like to ask for some help. I think that there might be a bug.
For example, in the test “Several floors”, at turn 22, after I block a clone I get a position of the leading clone of 19, while it should be 18. This “lag” doesn’t let me get 100% for my code.

Am I doing something wrong? I am using C++.

You can find in the screenshot a debug session :smiley:
https://s22.postimg.org/5efd35lpt/Debug.jpg

You only can print “WAIT” or “BLOCK”.
All other information must be printed in stderr.

Thank you! i will print another debug session! :smiley:

Hello! Here I am again. Thanks nicola1 for the debug error suggestion. In this screenshots I will refer to the testcase Several Floors.

  1. In the first screenshot, what you see at step 14 of the game is that the position of the leading clone is one step behind what is shown in the GUI. (The leading clone is at position 17, but the code provides 16)

  1. This lag seems to propagate at step 35 as you can see in this second screenshot where the position provided by the code is now two steps behind the GUI. (Leading clone on elevator at first floor, position 4, code provides 6).

  2. As a result for my code the clones do not block as soon as they jump on an elevator if they have the wrong direction.

Can you guys help me? :cry:

My first solution is a complete graph exploration and I don’t know how it solves it without a timeout. :grin:
If you want a smarter solution, try to know if your leader goes in the direction of the teleporter or not.

Nicola, I am thinking whether something changed in the original code. Would you be so kind to run again your code and check if you get full score? :grin:

I think that nothing changed: my two codes are OK.

Well, it looks like at least another user had the same problem. I found it in the discussion

Don’t Panic - Episode 1 - Codesize - Puzzle discussion

he managed to solve it the old good way, come back tomorrow… Unfortunately this is not working for me.

Even tried to change language (gone for C). Same lag, same results… :frowning: