⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 中国象棋对弈程序elephanteye(象眼).htm

📁 象棋程序设计全资料集(介绍编写象棋程序的方法思路)
💻 HTM
📖 第 1 页 / 共 2 页
字号:
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>的着法排序非常简单清晰,依次是迭代加深着法、好的吃子着法、杀手着法和按历史表排序的生成着法。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(7) </FONT>将军<FONT 
  face="Times New Roman">/</FONT>杀棋<FONT face="Times New Roman">/</FONT>兑子延伸: 
  </DT></DIV>
  <DIV align=left>
  <DT>  在选择性延伸上,<FONT face="Times New Roman">ElephantEye 
  </FONT>采用了将军、杀棋和兑子延伸,由于<FONT face="Times New Roman">ElephantEye 
  </FONT>没有避将的着法生成器,所以无法实现单一应着延伸。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(8) </FONT>历史表裁剪: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>参考了国际象棋 <FONT 
  face="Times New Roman">Fruit </FONT>的设计思路,使用阈值为<FONT 
  face="Times New Roman">1/8</FONT>的历史表裁剪。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(9) Alpha-Beta</FONT>主要变例搜索: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>使用传统意义上的递归式<FONT 
  face="Times New Roman">Alpha-Beta</FONT>主要变例搜索。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(10) </FONT>开局库: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>的开局库共包含了<FONT 
  face="Times New Roman">20,000</FONT>个着法,是从<FONT 
  face="Times New Roman">1990</FONT>年到<FONT 
  face="Times New Roman">2005</FONT>年全国象棋个人赛、团体赛、五羊杯、联赛等<FONT 
  face="Times New Roman">8,000</FONT>局顶尖比赛中提取的。开局库是以<FONT 
  face="Times New Roman">FEN</FONT>串为主的文本格式,读取时直接导入到置换表中。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(11) </FONT>后台思考和时间分配策略: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>支持后台思考功能,同时提供了时段制和加时制两种时间分配策略,会自动合理分配时间。 </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>六、源程序</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>的源程序包括<FONT 
  face="Times New Roman">9</FONT>个模块,内容大致为: </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(1) ucci.h/ucci.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">UCCI</FONT>协议的命令解释模块,包括 <FONT 
  face="Times New Roman">Windows </FONT>和 <FONT face="Times New Roman">Unix 
  </FONT>下的行输入接收程序; </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(2) pregen.h/pregen.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">Zobrist </FONT>数组和着法预置表的生成模块。<FONT 
  face="Times New Roman">ElephantEye </FONT>的预置表分两个部分,一是滑动棋子的着法预置表<FONT 
  face="Times New Roman">(</FONT>包括不吃子、车吃子、炮吃子和隔两子吃子<FONT 
  face="Times New Roman">)</FONT>,它是实现位行和位列技术的基础;二是其他棋子的着法预置表,使得着法生成时避免了烦琐的边界判断。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(3) position.h/position.cpp</FONT> 
</DT></DIV>
  <DIV align=left>
  <DT>  主要描述着法和局面的数据结构及功能。局面的处理是本模块的重点,处理内容包括局面初始化、<FONT 
  face="Times New Roman">FEN</FONT>串导入、棋子移动、杀手着法的合理性判断、将军判断、长将和循环检测、子力价值分调整等过程,还包括<FONT 
  face="Times New Roman">5</FONT>个子力位置价值表。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(4) genmoves.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  着法生成器,包括生成吃子着法和生成不吃子着法的两个,但不能只生成解除将军的着法。在生成吃子着法的同时赋予每个着法以相应的<FONT 
  face="Times New Roman">MVV(LVA)(</FONT>或称准<FONT 
  face="Times New Roman">SEE)</FONT>值。该模块还有一个专门判断棋子是否有保护的函数,来计算<FONT 
  face="Times New Roman">MVV(LVA)</FONT>值,对于有保护的棋子,计算<FONT 
  face="Times New Roman">MVV-LVA</FONT>的值<FONT 
  face="Times New Roman">(</FONT>小于零不计<FONT 
  face="Times New Roman">)</FONT>,对于无保护的棋子,只计算<FONT 
  face="Times New Roman">MVV</FONT>的值。因此,判断棋子是否有根的程序也包括在本模块中。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(5) evaluate.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  局面评价函数,<FONT face="Times New Roman">ElephantEye 
  </FONT>采用了终端结点和四级偷懒评价的机制,最粗的层次包括防守缺陷和特殊棋型的评价,进一层次包括子力区域平衡和牵制的评价,再进一层次包括兵的保护和子力互相联系保护的评价,最高层次包括马的阻碍和车的灵活性的评价。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(6) hashbook.h/hashbook.cpp</FONT> 
</DT></DIV>
  <DIV align=left>
  <DT>  置换表、历史表和着法列表管理模块,包括置换表的分配和存取、开局库的导入和读取、主要变例获取等操作。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(7) movesort.h/movesort.cpp</FONT> 
</DT></DIV>
  <DIV align=left>
  <DT>  根据历史表对着法列表赋值、着法列表排序等操作。该模块是整个程序的核心模块。 </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(8) search.h/search.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  搜索模块,除了静态搜索、完全搜索和根结点搜索这三个主要过程外,还包括迭代加深控制、后台思考、时间分配、搜索参数统计和搜索信息输出等内容。该模块是整个程序的核心模块。 
  </DT></DIV>
  <DIV align=left>
  <DT><FONT face="Times New Roman">(9) eleeye.cpp</FONT> </DT></DIV>
  <DIV align=left>
  <DT>  主程序<FONT face="Times New Roman">(</FONT>即 <FONT 
  face="Times New Roman">main </FONT>函数<FONT face="Times New Roman">)</FONT>。 
  </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>七、程序表现</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>偏重于搜索,但在知识上非常欠缺。在<FONT 
  face="Times New Roman">2.8GHz</FONT>的处理器上每秒可搜索约<FONT 
  face="Times New Roman">1,200,000</FONT>个结点<FONT 
  face="Times New Roman">(</FONT>包括常规搜索和静态搜索<FONT 
  face="Times New Roman">)</FONT>,一般的中局局面在<FONT 
  face="Times New Roman">1</FONT>分钟内可搜索约<FONT face="Times New Roman">11</FONT>层。 
  </DT></DIV>
  <DIV align=left>
  <DT>  在棋力上,<FONT face="Times New Roman">ElephantEye </FONT>和“棋隐”、<FONT 
  face="Times New Roman">SaoLa (</FONT>象棋挑战者<FONT 
  face="Times New Roman">)</FONT>等程序具有同等水平,但由于局面评估函数上的缺陷,<FONT 
  face="Times New Roman">ElephantEye </FONT>距离顶尖的商业象棋软件<FONT 
  face="Times New Roman">(</FONT>谢谢大师、象棋世家、象棋奇兵等<FONT 
  face="Times New Roman">)</FONT>尚有一定的差距。 </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye 
  </FONT>在联众、弈天等象棋对弈网站上作过测试,用等级分来衡量,联众网的战绩在<FONT 
  face="Times New Roman">2500</FONT>分左右,弈天网快棋的战绩在<FONT 
  face="Times New Roman">2000</FONT>分左右,慢棋在<FONT 
  face="Times New Roman">1500</FONT>分左右。 </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>于<FONT 
  face="Times New Roman">2005</FONT>年<FONT 
  face="Times New Roman">9</FONT>月参加在台北举行的第<FONT 
  face="Times New Roman">10</FONT>届<FONT 
  face="Times New Roman">ICGA</FONT>电脑奥林匹克大赛中国象棋组比赛,战绩是<FONT 
  face="Times New Roman">7</FONT>胜<FONT face="Times New Roman">5</FONT>和<FONT 
  face="Times New Roman">14</FONT>负,在<FONT 
  face="Times New Roman">14</FONT>个程序中排名第<FONT face="Times New Roman">11</FONT>。 
  </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT><FONT face=楷体_GB2312 size=4><STRONG>八、相关资源</STRONG></FONT> </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>必须在支持<FONT 
  face="Times New Roman">UCCI</FONT>协议<FONT 
  face="Times New Roman">(</FONT>如《象棋巫师》<FONT 
  face="Times New Roman">)</FONT>的象棋程序下运行,《象棋巫师》安装程序包含了最新版本的 <FONT 
  face="Times New Roman">ElephantEye</FONT>,下载地址是: </DT></DIV>
  <DIV align=left>
  <DT>    <A href="http://www.elephantbase.net/download/xqwizard_simp.exe"><FONT 
  face="Times New Roman">http://www.elephantbase.net/download/xqwizard_simp.exe</FONT></A><FONT 
  face="Times New Roman"> (</FONT>简体版<FONT face="Times New Roman">) </FONT>或 
  </DT></DIV>
  <DIV align=left>
  <DT>    <A href="http://www.elephantbase.net/download/xqwizard_trid.exe"><FONT 
  face="Times New Roman">http://www.elephantbase.net/download/xqwizard_trid.exe</FONT></A><FONT 
  face="Times New Roman"> (</FONT>繁体版<FONT face="Times New Roman">)</FONT> 
  </DT></DIV>
  <DIV align=left>
  <DT>  如果已经安装好《象棋巫师》,也可直接安装最新版本的 <FONT face="Times New Roman">ElephantEye 
  </FONT>及其源程序包: </DT></DIV>
  <DIV align=left>
  <DT>    <A href="http://www.elephantbase.net/download/eleeye.rar"><FONT 
  face="Times New Roman">http://www.elephantbase.net/download/eleeye.rar</FONT></A> 
  </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">ElephantEye </FONT>的源程序包除了 <FONT 
  face="Times New Roman">ElephantEye </FONT>本身的源程序外,还包括以下几个附加模块: </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(1) </FONT>通用低级接口<FONT 
  face="Times New Roman">(utility)</FONT>:提供了汇编指令、快速位操作、随机数、位棋盘、多线程输入、<FONT 
  face="Times New Roman">Visual Basic </FONT>下的原子语句等功能; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(2) </FONT>中国象棋规则模块<FONT 
  face="Times New Roman">(cchess)</FONT>:为其他软件使用 <FONT 
  face="Times New Roman">ElephantEye </FONT>代码提供了接口; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(3) </FONT>浅红象棋适配器<FONT 
  face="Times New Roman">(ucci2qh)</FONT>:为浅红象棋调用<FONT 
  face="Times New Roman">UCCI</FONT>引擎提供了接口; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(4) UCCI</FONT>引擎联赛模拟器<FONT 
  face="Times New Roman">(uccileag)</FONT>:为<FONT 
  face="Times New Roman">UCCI</FONT>引擎测试和比赛提供了自动批量对局的平台; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(5) BIG5</FONT>码和<FONT 
  face="Times New Roman">GB</FONT>码转换器<FONT 
  face="Times New Roman">(BIG2GB)</FONT>:一个用 <FONT face="Times New Roman">Visual 
  Basic </FONT>制作的文本文件转换程序; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(6) BBS Chess(BBSCHESS)</FONT>:一个用 <FONT 
  face="Times New Roman">Visual Basic </FONT>制作的国际象棋局面设置工具,可在各高校<FONT 
  face="Times New Roman">BBS</FONT>上粘贴彩色的国际象棋局面; </DT></DIV>
  <DIV align=left>
  <DT>  <FONT face="Times New Roman">(7) </FONT>棋盘图片生成器<FONT 
  face="Times New Roman">(FEN2BMP)</FONT>:一个可以把国际象棋和中国象棋的<FONT 
  face="Times New Roman">FEN</FONT>文件转换成<FONT 
  face="Times New Roman">BMP</FONT>文件的实用工具。 </DT></DIV>
  <DIV align=left>
  <DT>  以上模块都提供了源程序,<FONT face="Times New Roman">"cchess"</FONT>、<FONT 
  face="Times New Roman">"ucci2qh"</FONT>、<FONT 
  face="Times New Roman">"BBSCHESS"</FONT>和<FONT 
  face="Times New Roman">"FEN2BMP"</FONT>这四个模块必须在遵循<FONT 
  face="Times New Roman">GPL</FONT>协议的前提下使用。 </DT></DIV>
  <DIV align=left>
  <DT>  </DT></DIV>
  <DIV align=left>
  <DT>  如果要获得关于 <FONT face="Times New Roman">ElephantEye 
  </FONT>的更加详细的信息,可登录《象棋百科全书》网站: </DT></DIV>
  <DIV align=left>
  <DT>    <A href="http://www.elephantbase.net/"><FONT 
  face="Times New Roman">http://www.elephantbase.net/</FONT></A> </DT></DIV></DL>
<DIR>
<LI>上一篇 <A href="http://www.elephantbase.net/league/coony.htm"><FONT 
face="Times New Roman">UCCI</FONT>引擎——<FONT 
face="Times New Roman">Coony</FONT></A> 
<LI>下一篇 <A href="http://www.elephantbase.net/league/eychessu.htm"><FONT 
face="Times New Roman">UCCI</FONT>引擎——爱华象棋<FONT 
face="Times New Roman">/EYChessU</FONT></A> 
<LI>返 回 <A href="http://www.elephantbase.net/league.htm">象棋百科全书——电脑象棋联赛</A> 
</LI></DIR>
<DIV align=center>
<CENTER>
<TABLE border=0>
  <TBODY>
  <TR>
    <TD>
      <P align=center><A href="http://www.elephantbase.net/" target=_blank><IMG 
      height=31 src="中国象棋对弈程序ElephantEye(象眼)_files/elephantbase.gif" width=88 
      border=0></A></P></TD></TR>
  <TR>
    <TD><A href="http://www.elephantbase.net/" target=_blank><FONT face=Arial 
      size=2><STRONG>www.elephantbase.net</STRONG></FONT></A></TD></TR></TBODY></TABLE></CENTER></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -