摘要: A*寻路初探 GameDev.net作者: Patrick Lester 译者:Panic 2005年3月18日译者序:很久以前就知道了A*算法,但是从未认真读过相关的文章,也没有看过代码,只是脑子里有个模糊的概念。这次决定从头开始,研究一下这个被人推崇备至的简单方法,作为学习人工智能的开始。 这篇文章非常知名,国内应该有不少人翻译过它,我没有查找,觉得翻译本身也是对自身英文水平的锻炼。经过努力,终于完成了文档,也明白的A*算法的原理。毫无疑问,作者用形象的描述,简洁诙谐的语言由浅入深的讲述了这一神奇的算法,相信每个读过的人都会对此有所认识(如果没有,那就是偶的翻译太差了--b)。 现在是20 阅读全文
posted @ 2012-03-09 17:07 zsounder 阅读(439) 评论(0) 推荐(1) 编辑
摘要: 这是德问技术社区的一个问题,测试了一下,使用typeid等方法都无法正确区分二者,不讨论二者是不是有必要进行区分;下面给出一个方案吧,其实就是利用了Traits,模板的匹配规则。 1: template<typename T> class _ischararray_; 2: 3: template<typename T, int N> 4: class _ischararray_<T[N]> { public: static bool _ischararray(){return true;}}; 5: 6: template<typename T... 阅读全文
posted @ 2012-03-09 11:00 zsounder 阅读(1033) 评论(0) 推荐(4) 编辑
摘要: 一篇介绍C++ Traits的文章:An introduction to C++ Traits,分享一下,后面会针对Traits做一点总结。It is not uncommon to see different pieces of code that have basically the same structure, but contain variation in the details. Ideally we would be able to reuse the structure, and factor out the variations. In 'C' this m 阅读全文
posted @ 2012-03-09 10:45 zsounder 阅读(395) 评论(0) 推荐(0) 编辑