Death First Search - Episode 1 - Puzzle discussion

What do you mean ?

I mean that in IDE my code works fine, but here, works only 1 and 4 tests. I can not understand why.

Yeah. But I donā€™t understand how you can tell that your code works fine in your local IDE, since the inputs of a turn depend of your output of the previous turn. Have you set up a copy of the game referee on your computer ?

Bonjour,

Je viens de finir le 4eme niveau avec 56 link left et un algo donc pas de brute force mais je me retrouve avec un bug dans le cas (different du lvl 4 pour eviter les brute force) de la validation et pas possible de le debug a la validationā€¦
Serait tā€™il possible dā€™avoir quelques tests en plus pour eviter ce genre de chose?

I just finish the lvl 4 with 56 link left and no brute force but i got a bug in validation lvl 4 i got 42 link left (different lvl for bruteforce protection) but i canā€™t debug it in validation caseā€¦

Maybe its possible to get more test cases for avoid this? its not fun to debug without info

I would love to have some inputs on how the validators are working.
So the unit tests pass, nothing in my solution is hardcoded.
Actually my code implements this:

"For all edges that are part of the current best path to the gateways, pick the edge that has the most severe impact on the graph.

Severe impact : best -> the remaining graph cuts agent from all gateways, good -> the next best path becomes longer and longer. "

I noticed than tracing the validators, my algo simply picks edges that are even not on the shortest path.
is it really not possible that i m reading an invalid graph or something - or the reading is inaccurate?
even not on a shortest path to a given gateway.

The fact that my solution works with this complex tests makes me doubtful to where to look at this

if anyone could points me in some directions - or just have any suggestions ? it would be really appriciated

The validators works exactly like the IDEā€™s tests, and they are perfectly valid. Telling us which ones do not pass would help us to help you.

thank you for the very quick reply


but then how can it pass successfully (see attachments) with the tests and not when uploaded ?
stillā€¦ i will double check if i have something fishy when more than one gateways is set up.
thx anyway

the two last ones are stubborn with me :slight_smile:

Itā€™s totally possible that your algorithm works in most of the cases, but fail on specific graph configurations, which can be presents in validators and not in the IDEā€™s testsā€¦
For example, reading your algorithm description I donā€™t see if you always cut next to the Skynet agent. Is it the case ?

Hello BlaiseEbuth, finally found and fixed my issues which were more located in my graph acquistion and as well in my breadth first ā€¦
I found it with the built in help of the debug flag set onā€¦ then i realized the validator tests, keeping the same graph were simply renaming edgesā€¦ pointing me to my original errors.

Thank you

2 Likes

Hi,
During program execution, all of a sudden, I stopped receiving any inputs at all from the Game, and got a Time Error. Even while Debugging it, print no inputs.
This problem is happening continuously.
Any solutions.

Thanks though.
I have found the reason.
The program was just too slow. So optimized it a bit.
And passed all the cases fluently.

1 Like

Ambush achieved! On my own, no random edge submission spamming.

I got a 100% but it feels like I didnā€™t solve the problem as intended.

  1. If agent is adjacent to an exit, cut that link
  2. Otherwise just cut the first link to agent to restrict options

This simple algorithm (no path finding, no distance calculations) seems to be enough to prevent the agent from reaching exits in any of the test cases.

Thatā€™s about all thatā€™s required for 100% on episode 1. :slight_smile: Now you can go for 100% on episode 2 or for the episode 1 challenge goal.

3 Likes

I am confused on what went wrong.

Is it a bug, or I am missing something?

Language used: TypeScript

If you tap the three dots at the bottom right of the playback, youā€™ll be able to see the console output.

It looks like your code is timing out when the agent is not adjacent to a node. Iā€™d look for an infinite loop, missing output statement, or logic error in that branch of your decision logic.

2 Likes

Thank you!

I found the reason of my bug. It was a rare case I didnā€™t consider it would happen.
Lucky me, there are different movements in both test! :slight_smile:

exactly, I wonder if itā€™s a bug in tests or not, but my solution is the same as yours and works in 10 lines of code, if less. Did not used any BFS.

1 Like

I see achievements listed for skynet revolutions 1 and 2, but I canā€™t find them anywhere in the puzzles.

Can someone tell me how to find them, or what is going on?

The puzzles have been renamed as Death First Search.

1 Like