字棋源代码.docVIP

  • 8
  • 0
  • 约6.34万字
  • 约 7页
  • 2017-08-22 发布于河南
  • 举报
字棋源代码

#include iostream #include windows.h #include conio.h #include string #include ctime using namespace std; #define MAX_NUM 1000 //计算机获胜的标志 #define NO_BLANK -1001//人获胜的标志 #define TREE_DEPTH 3 //递归深度 #define NIL 1001 //根节点的函数走步评估值 class State //棋盘状态节点,一个State实例就是一个棋盘的状态节点,从而形成一颗树状结构 { public: int QP[3][3]; //当前棋盘数组 int e_fun; //评分结果 int child[9]; //当前棋盘状态下的后一步的所有状态节点 int parent; //当前棋盘状态下的父母节点下标 int bestChild;//在child[9]里e_fun最优的节点下标 }; class Tic { public: int tmpQP[3][3]; //用于3层递归的临时棋盘 static int s_count;//叶子节点的静态总数 State States[MAX_NUM];//棋盘状态节点数组 Tic() { } void in

文档评论(0)

1亿VIP精品文档

相关文档