下载此文档

围棋程序源代码.doc


文档分类:IT计算机 | 页数:约84页 举报非法文档有奖
1/84
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/84 下载此文档
文档列表 文档介绍
围棋程序源代码
#include <>
/* #include <> */
#include <>
#ifdef ADDED
# define PATCHLEVEL 2
# define WALLY_OUTPUT 0
# define MGT_OUTPUT 1
# define CAT_OUTPUT 2
# define M_LETTER(x) \
((x < 8) ? lettercol(x) : ((x == 8) ? 'i' : lettercol(x - 1)))
int outputmode = WALLY_OUTPUT;
#endif
#define ASSERT 1 /*flag for whether assert() macros should be */
/* expanded*/
#define BIGU 10000 /*a number higher than any meaningful "urgency" */
/* or move importance*/
#define RESIGN (-2) /*codes for resigning */
#define PASS (-1) /* passing moves*/
#define BOTHPASS (-3) /*code for both sides passed, game is over*/ #define EDGE 23 /*max # intersections on the edge of a go board*/ int edge= 9; /*the number of intersections which we are using (a */
/* command line parameter)*/
#define NPLAYERS 2 /*# players (hence # copies to keep of score &c.)*/ int debugattack= 0; /*flag for printing debugging messages in attack()*/ /*Return the absolute value of i.*/
#define abs(i) ((i)>=0?(i):-(i))
/*Return TRUE if (x,y) corresponds to a point on the board.*/ #define on1board(x) (0<=(x)&&(x)<edge)
#define onboard(x,y) (on1board(x)&&on1board(y))
/*Return TRUE if (x,y) is on the edge of the board.*/ #define onedge1(x) (0==(x)||edge-1==(x))
#define onedge(x,y) (onedge1(x)||onedge1(y))
/*codes for players; and a code for something (. a point on the board) */ /* which belongs to neither*/
#define BLACK 0
#define WHITE 1
#define EMPTY 2
/*flags in shape table entries for types of points*/
#define F_BLACK 1 /*the point has a black stone*/
#define F_WHITE 2 /*the point has a white stone*/
#define F_EMPTY 4 /*the point is empty*/
#define F_OFF 8 /*the point is off the board*/
int flookup[]= /*sets of flags corresponding to codes*/ { F_BLACK, F_WHITE, F_EMPTY };
int evenmode= 0; /*Are we (against our better judgment) to play */
/* an even game?*/
/*Return TRUE if a move violates ko.*/
#define ko(x,y) (theg

围棋程序源代码 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数84
  • 收藏数0 收藏
  • 顶次数0
  • 上传人amikiri
  • 文件大小177 KB
  • 时间2021-11-10