Detailed rules
- Given a grid of the size width×height, with
0 0 being the upper left corner in column row notation. - The grid contains only open (passable) tiles, encoded as
. , and wall tiles (impassable), encoded as# . - There are eight possible directions of movement: N NE E SE S SW W NW, where N means "up", and E "right".
- Moving diagonally is possible only when tiles of both related cardinal directions are passable.
For example, going NE requires both N and E neighboring tiles to be open. - The JPS+ preprocessing procedure should work as described in the section 14.6 of the cited publication.
- For each of the open tiles, your goal is to send one line, containing computed distances to the closest wall / jump point in each of the eight directions.
- Each line should be formatted as column row N NE E SE S SW W NW, where column row contains the tile coordinates, and the remaining numbers are distances in the corresponding directions.
For example,2 0 3 -2 1 4 2 -1 -1 4 means that for the tile of column 2 and row 0 going north there is a jump point 3 tiles away, going northeast there is a wall 2 tiles away, etc. - Ordering of the lines is irrelevant as long as all open nodes are assigned all their corresponding distance values.