经典游戏"圆猫"算法? [英] Classic Game "Circle the Cat" algorithm?

查看:301
本文介绍了经典游戏"圆猫"算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我玩这个游戏圈的猫 <一href="http://www.gamedesign.jp/flash/chatnoir/chatnoir.html">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).

快乐编码。

这篇关于经典游戏&QUOT;圆猫&QUOT;算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆