I suppose it just uses the Jikstra algorithm (or equivalent), which is unweighted which is well suited to solve this particular problem.
The cat is an easy trap, playing a few spots in front - the “intelligence” is easy to deceive :) The cat does not seem to take into account non-blocking tiles that play ahead along a potential path, which makes me believe that this is just a simple calculation of weight in an unweighted state.
When a cat falls into a trap, it seems to pick a random direction, which can happen on a tie.
A cat could be made smarter by adding weight to certain tiles (for example, adjacent to blocking tiles).
Happy coding.
user166390
source share