algdefs.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /* This file contains bitmap 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. /*
  18. * Algdefs.h -- algebraic definitions for the 64 squares.
  19. * bitmaps are ordered left-to-right, bottom-to-top
  20. * as viewing the board with square a1 bottom left.
  21. * rank: 1st 2nd 3rd 8th
  22. * bits: [0-7] [8-15] [16-23] ... [56-63]
  23. * For example, square 16 is a3.
  24. */
  25. #define a1 1<<0
  26. #define b1 1<<1
  27. #define c1 1<<2
  28. #define d1 1<<3
  29. #define e1 1<<4
  30. #define f1 1<<5
  31. #define g1 1<<6
  32. #define h1 1<<7
  33. #define a2 a1<<8
  34. #define b2 b1<<8
  35. #define c2 c1<<8
  36. #define d2 d1<<8
  37. #define e2 e1<<8
  38. #define f2 f1<<8
  39. #define g2 g1<<8
  40. #define h2 h1<<8
  41. #define a3 a2<<8
  42. #define b3 b2<<8
  43. #define c3 c2<<8
  44. #define d3 d2<<8
  45. #define e3 e2<<8
  46. #define f3 f2<<8
  47. #define g3 g2<<8
  48. #define h3 h2<<8
  49. #define a4 a3<<8
  50. #define b4 b3<<8
  51. #define c4 c3<<8
  52. #define d4 d3<<8
  53. #define e4 e3<<8
  54. #define f4 f3<<8
  55. #define g4 g3<<8
  56. #define h4 h3<<8
  57. /* could change these so a5 = h1 */
  58. #define a5 a1
  59. #define b5 b1
  60. #define c5 c1
  61. #define d5 d1
  62. #define e5 e1
  63. #define f5 f1
  64. #define g5 g1
  65. #define h5 h1
  66. #define a6 a2
  67. #define b6 b2
  68. #define c6 c2
  69. #define d6 d2
  70. #define e6 e2
  71. #define f6 f2
  72. #define g6 g2
  73. #define h6 h2
  74. #define a7 a3
  75. #define b7 b3
  76. #define c7 c3
  77. #define d7 d3
  78. #define e7 e3
  79. #define f7 f3
  80. #define g7 g3
  81. #define h7 h3
  82. #define a8 a4
  83. #define b8 b4
  84. #define c8 c4
  85. #define d8 d4
  86. #define e8 e4
  87. #define f8 f4
  88. #define g8 g4
  89. #define h8 h4
  90. #define A1 0
  91. #define B1 1
  92. #define C1 2
  93. #define D1 3
  94. #define E1 4
  95. #define F1 5
  96. #define G1 6
  97. #define H1 7
  98. #define A2 8
  99. #define B2 9
  100. #define C2 10
  101. #define D2 11
  102. #define E2 12
  103. #define F2 13
  104. #define G2 14
  105. #define H2 15
  106. #define A3 16
  107. #define B3 17
  108. #define C3 18
  109. #define D3 19
  110. #define E3 20
  111. #define F3 21
  112. #define G3 22
  113. #define H3 23
  114. #define A4 24
  115. #define B4 25
  116. #define C4 26
  117. #define D4 27
  118. #define E4 28
  119. #define F4 29
  120. #define G4 30
  121. #define H4 31
  122. #define A5 32
  123. #define B5 33
  124. #define C5 34
  125. #define D5 35
  126. #define E5 36
  127. #define F5 37
  128. #define G5 38
  129. #define H5 39
  130. #define A6 40
  131. #define B6 41
  132. #define C6 42
  133. #define D6 43
  134. #define E6 44
  135. #define F6 45
  136. #define G6 46
  137. #define H6 47
  138. #define A7 48
  139. #define B7 49
  140. #define C7 50
  141. #define D7 51
  142. #define E7 52
  143. #define F7 53
  144. #define G7 54
  145. #define H7 55
  146. #define A8 56
  147. #define B8 57
  148. #define C8 58
  149. #define D8 59
  150. #define E8 60
  151. #define F8 61
  152. #define G8 62
  153. #define H8 63