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

📄 gnuchess.h

📁 GNU国际象棋C++源代码Windows版的
💻 H
📖 第 1 页 / 共 2 页
字号:
     extern long reminus, replus;
     extern unsigned long GenCnt, NodeCnt, ETnodes, EvalNodes;
     extern tshort HashDepth, HashMoveLimit;
     extern struct GameRec GameList[];
     extern SHORT GameCnt, Game50;
     extern SHORT Sdepth, MaxSearchDepth;
     extern int Book;
     extern struct TimeControlRec TimeControl;
     extern int TCadd;
     extern SHORT TCflag, TCmoves, TCminutes, TCseconds, OperatorTime;
     extern int timecomp[MINGAMEIN], timeopp[MINGAMEIN];
     extern int compptr,oppptr;
     extern SHORT XCmore,XCadd[], XCmoves[], XCminutes[], XCseconds[], XC;
     extern const SHORT otherside[];
     extern const SHORT Stboard[];
     extern const SHORT Stcolor[];
     extern SHORT hint;
     extern SHORT TOflag;
     extern SHORT stage, stage2, Developed[];
     extern SHORT ChkFlag[], CptrFlag[], PawnThreat[];
     extern SHORT QueenCheck[];  /* tom@izf.tno.nl */
     extern SHORT NMoves[];  /* tom@izf.tno.nl */
     extern SHORT Threat[];  /* tom@izf.tno.nl */
     extern SHORT ThreatSave[];  /* tom@izf.tno.nl */
     extern SHORT Pscore[], Tscore[];
     extern SHORT mtl[], pmtl[], hung[], emtl[];
     extern SHORT Pindex[];
     extern SHORT PieceCnt[];
     extern SHORT FROMsquare, TOsquare;
     extern SHORT HasKnight[], HasBishop[], HasRook[], HasQueen[];
     extern const SHORT qrook[];
     extern const SHORT krook[];
     extern const SHORT kingP[];
     extern const SHORT rank7[];
     extern const SHORT sweep[];
     extern const SHORT epmove1[], epmove2[];
     extern UTSHORT killr0[], killr1[];
     extern UTSHORT killr2[], killr3[];
     extern UTSHORT PV, SwagHt, Swag0, Swag1, Swag2, Swag3, Swag4, sidebit;
     extern tshort killt[0x4000];
     extern SHORT mtl[2], pmtl[2], hung[2];
     extern const SHORT value[];
     extern const SHORT control[];
     extern UCHAR nextpos[8][64][64];
     extern UCHAR nextdir[8][64][64];
     extern const SHORT ptype[2][8];
     extern unsigned int starttime;
     extern SHORT distdata[64][64], taxidata[64][64];
     extern CHAR mvstr[5][7];
#ifndef AMIGADOS
     extern union U admin;
#endif
     extern UTSHORT bookmaxply;
     extern unsigned long bookcount;
     extern unsigned long booksize;
     extern CHAR *CP[];
#ifdef QUIETBACKGROUND
     extern SHORT background;
#endif /* QUIETBACKGROUND */

     extern CHAR *DRAW;

     extern char szAppName[];
     extern SHORT command;
     extern char move[6];
     extern HWND hWnd;
     extern HFONT hFont;
     extern SHORT LineSpace,SLineSpace,CharWidth,CompColorExt,WhoseTurnExt,
            squarebd;
     extern char msg[200];
     extern HWND hComputerColor,hWhoseTurn,hInCheck,hComputerMove,hClockBlack,
         hClockWhite,hBlack,hWhite,hDepth,hStats;
     extern HANDLE hInst;
     extern tshort WXwindow, BXwindow;

     extern POINT boardpg[4];
     extern POINT squares[8][8][4];
     extern POINT pieceloc[64];

     extern DWORD clrBackGround;
     extern DWORD clrBlackSquare;
     extern DWORD clrWhiteSquare;
     extern DWORD clrBlackPiece;
     extern DWORD clrWhitePiece;
     extern DWORD clrText;
     extern DWORD clrEdge;

     extern SHORT sqwidthF;
     extern SHORT sqwidthB;
     extern SHORT sqdepth;
     extern SHORT boardsize;
     extern SHORT deltaX;
     extern SHORT bmsize;

#define distance(a,b) distdata[a][b]
#define row(a) ((a) >> 3)
#define column(a) ((a) & 7)
#define locn(a,b) (((a) << 3) | (b))
     extern SHORT distdata[64][64];

/* init external functions */
     extern void InitConst (CHAR *lang);
     extern void Initialize_dist (void);
     extern void NewGame (void);
     extern int parse (FILE * fd, UTSHORT *mv, SHORT side, CHAR *opening);
     extern void GetOpenings (void);
     extern int OpeningBook (SHORT *hint, SHORT side);
     extern int GOpeningBook (SHORT *hint, SHORT side, CHAR *mv);
     extern void SelectMove (SHORT side, SHORT iop);
     extern int
      search (SHORT side,
          SHORT ply,
          SHORT depth,
               SHORT ext,
          SHORT alpha,
          SHORT beta,
          UTSHORT *bstline,
          SHORT *rpt,
          SHORT SAVEHT,
          SHORT didnull );
     extern void Initialize_moves (void);
     extern void MoveList (SHORT side, SHORT ply);
     extern void CaptureList (SHORT side, SHORT ply);
     extern int castle (SHORT side, SHORT kf, SHORT kt, SHORT iop);
     extern void ataks (SHORT side, SHORT *a);
     extern void
      MakeMove (SHORT side,
       struct leaf * node,
       SHORT *tempb,
       SHORT *tempc,
       SHORT *tempsf,
       SHORT *tempst);
     extern void
      UnmakeMove (SHORT side,
         struct leaf * node,
         SHORT *tempb,
         SHORT *tempc,
         SHORT *tempsf,
         SHORT *tempst);
     extern void InitializeStats (void);
     extern int
      evaluate (SHORT side,
       SHORT ply,
       SHORT depth,
       SHORT ext,
       SHORT alpha,
       SHORT beta,
            SHORT *terminal,
       SHORT *InChk);
     extern SHORT ScorePosition (SHORT side);
     extern void ExaminePosition (void);
     extern void UpdateWeights (void);
     extern void Initialize (void);
     extern void InputCommand (void);
     extern void SetTimeControl (void);
     extern void SelectLevel (CHAR *sx);
     extern void
      UpdateDisplay (SHORT f,
            SHORT t,
            SHORT flag,
            SHORT iscastle,
            HDC hDc);
     extern void ElapsedTime (SHORT iop);
     extern void ShowSidetoMove (void);
     extern void SearchStartStuff (SHORT side);
     extern void ShowDepth (CHAR ch);
     extern void TerminateSearch (int);
     extern void
      ShowResults (SHORT score,
          UTSHORT *bstline,
          CHAR ch);
     extern void PromptForMove (void);
     extern void SetupBoard (void);
     extern void algbr (SHORT f, SHORT t, SHORT flag);
     extern void OutputMove (SHORT score);
     extern void ShowCurrentMove (SHORT pnt, SHORT f, SHORT t);
     extern void ListGame (void);
     extern void ShowMessage (CHAR *s);
     extern void DrawPiece (SHORT sq,HDC hDC);
     extern void UpdateClocks (void);
     extern void DoDebug (void);
     extern void DoTable (SHORT table[64]);
     extern void ShowPostnValues (void);
     extern void ChangeXwindow (void);
     extern void SetContempt (void);
     extern void ChangeHashDepth (void);
     extern void ChangeBetaWindow (void);
     extern void ChangeAlphaWindow (void);
     extern void GiveHint (void);
     extern void ShowPrompt (void);
     extern void EditBoard (void);
     extern void help (void);
     extern void ChangeSearchDepth (void);
     extern void skip (void);
     extern void skipb (void);
     extern void EnPassant (SHORT xside, SHORT f, SHORT t, SHORT iop);
     extern void ShowNodeCnt (long int NodeCnt);
     extern void ShowLine (UTSHORT *bstline);
     extern int pick (SHORT p1, SHORT p2);
     extern int VerifyMove (CHAR *s, SHORT inp, UTSHORT *mv);
     extern void VMoveList (SHORT side, register SHORT ply);

     extern void CheckMessage(void);
     extern void InitScreen(void);
     extern void SetStaticPos(void);
     extern void Exit(int);

#if !defined(AMIGADOS)
     extern struct gdxadmin B;
#endif

#if defined(AMIGADOS)  &&  !defined(XBOARD)
#define exit(retcode) CleanExit(retcode)
#endif
/* Take care of MEMSET once and for all... */
#if (!defined(HAVE_MEMSET) || defined(MSDOS)) && !defined(__GNUC__)
#define memset(s,c,l) {\
  unsigned long j; \
    for (j = 0; j < (l); j++) \
      ((CHAR *)s)[j] = (c);}
#endif /* MEMSET */

#define CBLACK    RGB(0,0,0)
#define BLUE      RGB(0,0,255)
#define GREEN     RGB(0,255,0)
#define CYAN      RGB(128,255,255)
#define RED       RGB(255,0,0)
#define PINK      RGB(255,0,255)
#define YELLOW    RGB(255,255,0)
#define PALEGRAY  RGB(192,192,192)
#define DARKGRAY  RGB(127,127,127)
#define DARKBLUE  RGB(0,0,128)
#define DARKGREEN RGB(0,128,0)
#define DARKCYAN  RGB(0,255,255)
#define DARKRED   RGB(128,0,0)
#define DARKPINK  RGB(255,0,128)
#define BROWN     RGB(128,128,64)
#define CWHITE    RGB(255,255,255)

#define SMALL 0
#define MEDIUM 12
#define LARGE 24
#define BRD_EDGE 5
#define LEFTMARGIN  25
#define BACKMARGIN  5

#define IDM_NEW         101
#define IDM_GET         102
#define IDM_SAVE        103
#define IDM_LIST        104
#define IDM_QUIT        105

#define IDM_EDIT        201
#define IDM_REVIEW      202
#define IDM_UNDO        203
#define IDM_REMOVE      204
#define IDM_FORCE       205

#define IDM_BEEP        301
#define IDM_COORD       302
#define IDM_POST        303
#define IDM_TEST        304
#define IDM_BOOK        305
#define IDM_HASH        306
#define IDM_HDEPTH      307
#define IDM_HFILE       308
#define IDM_COMPILE     318
#define IDM_WIN         309
#define IDM_CONTEMP     310
#define IDM_ANIMATE     311
#define IDM_MATERIAL    312
#define IDM_RCPTR       313
#define IDM_THREAT      314
#define IDM_PVS         315
#define IDM_NEWEVAL     316
#define IDM_GAMEIN      317

#define IDM_TIME        401
#define IDM_RANDOM      402
#define IDM_EASY        403
#define IDM_DEPTH       404

#define IDM_REVERSE     501
#define IDM_SWITCH      502
#define IDM_BLACK       503
#define IDM_WHITE       504
#define IDM_BOTH        505
#define IDM_WTM         506
#define IDM_BTM         507
#define IDM_SWITCHDM    508

#define IDM_BACKGROUND  601
#define IDM_BLACKSQUARE 602
#define IDM_WHITESQUARE 603
#define IDM_BLACKPIECE  604
#define IDM_WHITEPIECE  605
#define IDM_TEXT        606
#define IDM_EDGE        607
#define IDM_DEFAULT     608
#define IDM_SMALL       609
#define IDM_MEDIUM      610
#define IDM_LARGE       611
#define IDM_SQUARE      612
#define IDM_3D          613

#define IDM_HINT        701

#define IDM_INDEX       801
#define IDM_HELP        802
#define IDM_ABOUT       803

#define IDM_CLEAR   901
#define IDM_RESTORE 902
#define IDM_DONE    903
#define IDM_PREV    904
#define IDM_NEXT    905

#define CHANGEWINDOW 1
#define IDC_WA 101
#define IDC_WB 102
#define IDC_WX 103
#define IDC_BA 104
#define IDC_BB 105
#define IDC_BX 106
#define IDC_APROMPT 201
#define IDC_BPROMPT 202
#define IDC_XPROMPT 203
#define IDC_WHITE   204
#define IDC_BLACK   205

#define NUMDLG 2
#define IDC_NUM   101
#define IDC_PROMPT 201

#define ABOUT  3

#define TIME   4
#define IDC_MOVES1 101
#define IDC_MOVES2 102
#define IDC_MOVES3 103
#define IDC_MINS1  104
#define IDC_MINS2  105
#define IDC_MINS3  106
#define IDC_MAXRT  107
#define IDC_MRTEXT 108
#define IDC_MRSECS 109

#define STATS  5
#define IDC_POS 101
#define IDC_SCORE 102
#define IDC_NODE 103
#define IDC_NODESEC 104
#define IDC_TREE 105
#define IDC_BESTLINE 106

#define HASHDEPTHDLG 6
#define IDC_DEPTH 101
#define IDC_MOVELIM 102
#define IDC_DPROMPT 201
#define IDC_MLPROMPT 202

#define PROMOTE 7
#define IDC_N 101
#define IDC_B 102
#define IDC_R 103
#define IDC_Q 104

#define CREATEHASH 8
#define IDC_HFSIZE 101

#define COMPILEBOOK  9
#define IDC_OFFSET 101
#define IDC_REC   102
#define IDC_GAMES 103

⌨️ 快捷键说明

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