gnuchess.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* This file contains the header definitions for CHESS.
  2. Copyright (C) 1986 Free Software Foundation, Inc.
  3. This file is part of CHESS.
  4. CHESS is distributed in the hope that it will be useful,
  5. but WITHOUT ANY WARRANTY. No author or distributor
  6. accepts responsibility to anyone for the consequences of using it
  7. or for whether it serves any particular purpose or works at all,
  8. unless he says so in writing. Refer to the CHESS General Public
  9. License for full details.
  10. Everyone is granted permission to copy, modify and redistribute
  11. CHESS, but only under the conditions described in the
  12. CHESS General Public License. A copy of this license is
  13. supposed to have been given to you along with CHESS so you
  14. can know your rights and responsibilities. It should be in a
  15. file named COPYING. Among other things, the copyright notice
  16. and this notice must be preserved on all copies. */
  17. #define BOOKSRC "/usr/redwood/cracraft/cc/Chess/bookin" /* Source book */
  18. #define BOOKOBJ "/usr/redwood/cracraft/cc/Chess/book" /* DBM book(s) */
  19. /*
  20. * The following entry is used whenever the program tries to be clever
  21. * and send data to the GNU Chess maintainers. Entries within the string
  22. * should be separated by a space.
  23. */
  24. #define GNUPEOPLE "cracraft@math.ucla.edu"
  25. #define FALSE 0
  26. #define TRUE 1
  27. #define NOMATCH -1
  28. #define CAPSORT 0
  29. #define SCORESORT 1
  30. #define MATE 30000
  31. #define DRAW 30001
  32. #define TABLE 0
  33. #define MAILBOX 1
  34. #define WHITE 0
  35. #define BLACK 1
  36. #define OPENING 10
  37. #define MAXPC 6
  38. #define MAXDIRS 8
  39. #define MAXMOVES 100
  40. #define MAXGAME 200
  41. #define MAXSTACK 10000
  42. #define MAXATTACKS 40
  43. #define HASHTBLSZ 65536
  44. #define MAXSTR 128 /* Maximum length of our strings */
  45. #define WP 1
  46. #define WN 2
  47. #define WB 3
  48. #define WR 4
  49. #define WQ 5
  50. #define WK 6
  51. #define BP -WP
  52. #define BN -WN
  53. #define BB -WB
  54. #define BR -WR
  55. #define BQ -WQ
  56. #define BK -WK
  57. #define WMAT 0
  58. #define BMAT 1
  59. #define TOMOVE 2
  60. #define WPOS 3
  61. #define BPOS 4
  62. #define WKING 5
  63. #define BKING 6
  64. #define MAXINT 32767
  65. #define MININT -32767
  66. #define OFF 99
  67. #define EMP 0
  68. #define NORMAL 1
  69. #define CAPTURE 2
  70. #define DEFENSE 3
  71. #define CAPFLAG 1
  72. #define PROMFLAG 2
  73. #define KCASFLAG 4
  74. #define QCASFLAG 8
  75. #define VALID 16
  76. #define LBOUND 32
  77. #define UBOUND 64
  78. #define NULLMV 128
  79. #define OPPCOLOR(col) ((col == WHITE) ? BLACK : WHITE)
  80. #define COLOR(pc) ((pc < 0) ? BLACK : ((pc > 0 && pc < 99) ? WHITE : OFF))
  81. #define MAX(A,B) (((A) > (B)) ? (A) : (B))
  82. #define MIN(A,B) (((A) < (B)) ? (A) : (B))
  83. #define abs(A) (((A) >= 0) ? (A) : (-1 * (A)))
  84. struct pvstr {
  85. int from;
  86. int to;
  87. };
  88. struct bdtype {
  89. int piece;
  90. int moved;
  91. };
  92. struct dirtypes {
  93. int ndirs;
  94. int slide;
  95. int dirs[MAXDIRS];
  96. };
  97. struct mvlist {
  98. int from;
  99. int to;
  100. int movpiece;
  101. int cappiece;
  102. int capcount;
  103. int propiece;
  104. int score;
  105. char flags;
  106. };
  107. struct gmlist {
  108. int depth;
  109. long nodes;
  110. int score;
  111. float cpu;
  112. float rate;
  113. struct mvlist wmove;
  114. struct mvlist bmove;
  115. };
  116. struct hashentry {
  117. int depth;
  118. long match;
  119. struct mvlist move;
  120. };