There is no Spoon - Episode 1 puzzle discussion

My code was passing all the test cases but was failing a tunnel validator too.

when you check the animation for tunnel validator I could see that it was not printing the data for the lowest level points.

I assumed that,like in all other puzzles, if the height is H then the lowest point will be either 0 either H-1. But here it is actually H as it turned out.
so if youre using a for(;;){} loop, then consider checking you actually cover all the area :slight_smile:

I usually code in C++. This kinda looks like python, but python doesnโ€™t do i++. I think I can still read the code even though Iโ€™m not sure what language this is.

I traced through searchNextD. the First return was c.x =1 c.y =0;

My second time going through:

while (1 <= 2 or grid[0,1] is โ€˜0โ€™) //go into because 1<=2 also [0,1] is โ€˜0โ€™ either
if (1 == 2-1) //break out of while loop
if (grid[0,1] != โ€˜0โ€™) //grid[0,1] does == โ€˜0โ€™ so we wonโ€™t change x or y to -1
return c.x = 1 c.y = 0

So we started with x=0 y=0
After first pass x=1 y=0
After second pass x=1 y=0
After Third pass x=1 y=0

Your X and Y will never update because X wonโ€™t increment.
Iโ€™m not a superstar at coding, do you think I figured it out or did I get it wrong?

True. I struggled for 15 minutes until I realised Iโ€™ve switched x and y when I added the nodes in my vector. Modified it and everything went green.