围棋程序源代码
#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转载请标明出处.