The algorithm of the classic game "Surround the cat"?

Hi, I played this game "Circle the Cat" http://www.gamedesign.jp/flash/chatnoir/chatnoir.html

I was wondering which algorithm makes a cat “smart”? How does a cat decide which direction to take?

One solution that comes to my mind is a breadth-first search and going sideways with the shortest exit path.

I'm just curious here. :-)

+8
algorithm
source share
1 answer

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.

+2
source share

All Articles