-/* Write into "neighbor_scores" scores for immediate neighbors to cell at
- * "pos_yx" (YX coordinates) and "pos_i" (arry_index) in "score_map". Directions
- * determining neighborhood are defined by the letters of "dir"; their order
- * also determines in what order scores are written into "neighbor_score".
- * "len_dirs" is to store the result of a previous strlen(dir) (so it does not
- * have to be called repeatedly and costly in dijkstra_map(); same reason for
- * "pos_i"'s redundancy.). "max_score" is written into "neighbor_scores" for
- * illegal directions (that from "pos_yx" would lead beyond the map's border).
+#define N_DIRS 6
+
+
+
+/* Write into "neighbors" scores of the N_DIRS immediate neighbors of the
+ * "score_map" cell at "pos_i" (array index), as found in the directions
+ * north-east, east, south-east etc. (clockwise order). Use "max_score" for
+ * illegal neighborhoods (i.e. if direction would lead beyond the map's border).
+ */
+static void get_neighbor_scores(uint16_t * score_map, uint16_t pos_i,
+ uint16_t max_score, uint16_t * neighbors);
+
+/* Iterate over scored cells in "score_map" of world.map's geometry. Compare
+ * each cell's score against the score of its immediate neighbors in N_DIRS
+ * directions. If it's neighbors are low enough that the result would be lower
+ * than the current value, re-set it to 1 point higher than its lowest-scored
+ * neighbor. Repeat this whole process until all cells have settled on their
+ * final score. Ignore cells whose position in "score_map" fits cells of
+ * unreachable terrain in world.map.cells or whose score is greater than
+ * "max_score". Expect "max_score" to be the maximum score for cells, marking
+ * them as unreachable.
+ */
+static void dijkstra_map(uint16_t * score_map, uint16_t max_score);
+
+/* Return numpad char of direction ("8", "6", "2", "4" etc.) of enemy with the
+ * shortest path visible to "mo_origin". If no enemy is around, return 0.