经典游戏"圆猫"算法?算法、经典游戏、QUOT、圆猫

2023-09-11 04:32:18 作者:独自生长

您好我玩这个游戏圈的猫 http://www.gamedesign.jp/flash/chatnoir/chatnoir.html

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

我想知道什么算法使猫智能?如何猫决定采取哪个方向?

I was wondering what algorithm makes the cat "intelligent"? How does the cat decide which direction to take?

一个解决方案,这使我的心是广度优先搜索和走在最短的退出路径的方向。

One solution that comes to my mind is breadth first search and go in the direction with the shortest exit path.

我只是好奇这里。 : - )

I'm just inquisitive here. :-)

推荐答案

我相信这只是使用 Djikstra算法(或同等学历),这是未加权单源最短路径算法是解决这方面的问题相当不错的。

I believe it is just using Djikstra's algorithm (or equivalent) which is an unweighted single-source shortest-path algorithm that is quite good at solving this particular problem.

猫是很容易捕获的通过玩几个景点提前 - 在智慧是很容易骗过:)猫似乎并没有考虑到在的潜力发挥在它前面的无阻塞瓷砖的路径,这使我相信这只是一个简单的加权距离计算。

The cat is easily trappable by playing a few spots ahead -- the "intelligence" is easy to fool :) The cat doesn't seem to account for non-blocking tiles played ahead of it in a potential path, which makes me believe it's just a simple unweighted distance calculation.

在猫成为被困它似乎随机选择一个方向,这可能对平局出现为好。

When the cat becomes trapped it seems to pick a random direction, which might happen on a tie as well.

猫可以的可能的可以通过添加重量某些瓷砖(如相邻阻断砖)制造更聪明。

The cat could possibly be made "smarter" by adding a weight to certain tiles (such as those adjacent to blocking tiles).

快乐编码。