[Community Puzzle] Jump Point Search - Preprocessing


Send your feedback or ask for help here!

Created by @aCat,validated by @radekmie,@Ramdeath and @Zylo.
If you have any issues, feel free to ping them.

Great educational puzzle. However, I don’t fully understand Listing 14.2 in the article. The caption says it is for the southwest diagonal jumps and it is sweeping down to up. But the code seems to me like working for the northwest diagonals (sweeping up to down and also the code checks r - 1 and c - 1 which is the NW direction.
What do I miss?

(Note: I had test fails until I modified my code according to my understanding above. Now I pass 100% with the code in 14.2 being for NW, and other diagonals treated accordingly.)

EDIT: Okay, I figured it out: there is nothing wrong with the pseudocode in the article, but for them 0,0 is not the top left, but the bottom left.


The second part of the puzzle: https://www.codingame.com/training/hard/jump-point-search---runtime


I finally found some time to finish this puzzle - thank you so much for it :slight_smile:

1 Like