chess 0.0.1.dummy → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1234) hide show
  1. data/.gitignore +6 -0
  2. data/LICENSE +165 -0
  3. data/README.rdoc +40 -0
  4. data/Rakefile +17 -1
  5. data/chess.gemspec +12 -13
  6. data/ext/MakefileC +22 -0
  7. data/ext/bitboard.c +376 -0
  8. data/ext/bitboard.h +64 -0
  9. data/ext/board.c +586 -0
  10. data/ext/board.h +62 -0
  11. data/ext/chess.c +481 -0
  12. data/ext/chess.h +43 -0
  13. data/ext/common.c +101 -0
  14. data/ext/common.h +110 -0
  15. data/ext/extconf.rb +29 -0
  16. data/ext/game.c +385 -0
  17. data/ext/game.h +42 -0
  18. data/ext/special.c +191 -0
  19. data/ext/special.h +23 -0
  20. data/lib/chess.rb +5 -7
  21. data/lib/chess/exceptions.rb +31 -0
  22. data/lib/chess/game.rb +142 -0
  23. data/lib/chess/gnuchess.rb +93 -0
  24. data/lib/chess/pgn.rb +66 -0
  25. data/lib/chess/version.rb +4 -2
  26. data/test/pgn_collection/checkmate/black_wins/0001.pgn +17 -0
  27. data/test/pgn_collection/checkmate/black_wins/0002.pgn +13 -0
  28. data/test/pgn_collection/checkmate/black_wins/0003.pgn +13 -0
  29. data/test/pgn_collection/checkmate/black_wins/0004.pgn +20 -0
  30. data/test/pgn_collection/checkmate/black_wins/0005.pgn +19 -0
  31. data/test/pgn_collection/checkmate/black_wins/0006.pgn +15 -0
  32. data/test/pgn_collection/checkmate/black_wins/0007.pgn +16 -0
  33. data/test/pgn_collection/checkmate/black_wins/0008.pgn +16 -0
  34. data/test/pgn_collection/checkmate/black_wins/0009.pgn +21 -0
  35. data/test/pgn_collection/checkmate/black_wins/0010.pgn +15 -0
  36. data/test/pgn_collection/checkmate/black_wins/0011.pgn +15 -0
  37. data/test/pgn_collection/checkmate/black_wins/0012.pgn +14 -0
  38. data/test/pgn_collection/checkmate/black_wins/0013.pgn +17 -0
  39. data/test/pgn_collection/checkmate/black_wins/0014.pgn +17 -0
  40. data/test/pgn_collection/checkmate/black_wins/0015.pgn +15 -0
  41. data/test/pgn_collection/checkmate/black_wins/0016.pgn +20 -0
  42. data/test/pgn_collection/checkmate/black_wins/0017.pgn +14 -0
  43. data/test/pgn_collection/checkmate/black_wins/0018.pgn +19 -0
  44. data/test/pgn_collection/checkmate/black_wins/0019.pgn +16 -0
  45. data/test/pgn_collection/checkmate/black_wins/0020.pgn +14 -0
  46. data/test/pgn_collection/checkmate/black_wins/0021.pgn +20 -0
  47. data/test/pgn_collection/checkmate/black_wins/0022.pgn +16 -0
  48. data/test/pgn_collection/checkmate/black_wins/0023.pgn +17 -0
  49. data/test/pgn_collection/checkmate/black_wins/0024.pgn +20 -0
  50. data/test/pgn_collection/checkmate/black_wins/0025.pgn +20 -0
  51. data/test/pgn_collection/checkmate/black_wins/0026.pgn +19 -0
  52. data/test/pgn_collection/checkmate/black_wins/0027.pgn +14 -0
  53. data/test/pgn_collection/checkmate/black_wins/0028.pgn +15 -0
  54. data/test/pgn_collection/checkmate/black_wins/0029.pgn +18 -0
  55. data/test/pgn_collection/checkmate/black_wins/0030.pgn +16 -0
  56. data/test/pgn_collection/checkmate/black_wins/0031.pgn +17 -0
  57. data/test/pgn_collection/checkmate/black_wins/0032.pgn +17 -0
  58. data/test/pgn_collection/checkmate/black_wins/0033.pgn +15 -0
  59. data/test/pgn_collection/checkmate/black_wins/0034.pgn +13 -0
  60. data/test/pgn_collection/checkmate/black_wins/0035.pgn +16 -0
  61. data/test/pgn_collection/checkmate/black_wins/0036.pgn +20 -0
  62. data/test/pgn_collection/checkmate/black_wins/0037.pgn +20 -0
  63. data/test/pgn_collection/checkmate/black_wins/0038.pgn +14 -0
  64. data/test/pgn_collection/checkmate/black_wins/0039.pgn +19 -0
  65. data/test/pgn_collection/checkmate/black_wins/0040.pgn +13 -0
  66. data/test/pgn_collection/checkmate/black_wins/0041.pgn +20 -0
  67. data/test/pgn_collection/checkmate/black_wins/0042.pgn +12 -0
  68. data/test/pgn_collection/checkmate/black_wins/0043.pgn +20 -0
  69. data/test/pgn_collection/checkmate/black_wins/0044.pgn +19 -0
  70. data/test/pgn_collection/checkmate/black_wins/0045.pgn +16 -0
  71. data/test/pgn_collection/checkmate/black_wins/0046.pgn +15 -0
  72. data/test/pgn_collection/checkmate/black_wins/0047.pgn +14 -0
  73. data/test/pgn_collection/checkmate/black_wins/0048.pgn +16 -0
  74. data/test/pgn_collection/checkmate/black_wins/0049.pgn +15 -0
  75. data/test/pgn_collection/checkmate/black_wins/0050.pgn +17 -0
  76. data/test/pgn_collection/checkmate/black_wins/0051.pgn +13 -0
  77. data/test/pgn_collection/checkmate/black_wins/0052.pgn +12 -0
  78. data/test/pgn_collection/checkmate/black_wins/0053.pgn +20 -0
  79. data/test/pgn_collection/checkmate/black_wins/0054.pgn +15 -0
  80. data/test/pgn_collection/checkmate/black_wins/0055.pgn +19 -0
  81. data/test/pgn_collection/checkmate/black_wins/0056.pgn +14 -0
  82. data/test/pgn_collection/checkmate/black_wins/0057.pgn +15 -0
  83. data/test/pgn_collection/checkmate/black_wins/0058.pgn +21 -0
  84. data/test/pgn_collection/checkmate/black_wins/0059.pgn +16 -0
  85. data/test/pgn_collection/checkmate/black_wins/0060.pgn +23 -0
  86. data/test/pgn_collection/checkmate/black_wins/0061.pgn +17 -0
  87. data/test/pgn_collection/checkmate/black_wins/0062.pgn +25 -0
  88. data/test/pgn_collection/checkmate/black_wins/0063.pgn +18 -0
  89. data/test/pgn_collection/checkmate/black_wins/0064.pgn +12 -0
  90. data/test/pgn_collection/checkmate/black_wins/0065.pgn +19 -0
  91. data/test/pgn_collection/checkmate/black_wins/0066.pgn +20 -0
  92. data/test/pgn_collection/checkmate/black_wins/0067.pgn +14 -0
  93. data/test/pgn_collection/checkmate/black_wins/0068.pgn +18 -0
  94. data/test/pgn_collection/checkmate/black_wins/0069.pgn +16 -0
  95. data/test/pgn_collection/checkmate/black_wins/0070.pgn +14 -0
  96. data/test/pgn_collection/checkmate/black_wins/0071.pgn +21 -0
  97. data/test/pgn_collection/checkmate/black_wins/0072.pgn +13 -0
  98. data/test/pgn_collection/checkmate/black_wins/0073.pgn +15 -0
  99. data/test/pgn_collection/checkmate/black_wins/0074.pgn +25 -0
  100. data/test/pgn_collection/checkmate/black_wins/0075.pgn +16 -0
  101. data/test/pgn_collection/checkmate/black_wins/0076.pgn +11 -0
  102. data/test/pgn_collection/checkmate/black_wins/0077.pgn +23 -0
  103. data/test/pgn_collection/checkmate/black_wins/0078.pgn +18 -0
  104. data/test/pgn_collection/checkmate/white_wins/0001.pgn +14 -0
  105. data/test/pgn_collection/checkmate/white_wins/0002.pgn +19 -0
  106. data/test/pgn_collection/checkmate/white_wins/0003.pgn +19 -0
  107. data/test/pgn_collection/checkmate/white_wins/0004.pgn +12 -0
  108. data/test/pgn_collection/checkmate/white_wins/0005.pgn +27 -0
  109. data/test/pgn_collection/checkmate/white_wins/0006.pgn +19 -0
  110. data/test/pgn_collection/checkmate/white_wins/0007.pgn +13 -0
  111. data/test/pgn_collection/checkmate/white_wins/0008.pgn +14 -0
  112. data/test/pgn_collection/checkmate/white_wins/0009.pgn +17 -0
  113. data/test/pgn_collection/checkmate/white_wins/0010.pgn +19 -0
  114. data/test/pgn_collection/checkmate/white_wins/0011.pgn +19 -0
  115. data/test/pgn_collection/checkmate/white_wins/0012.pgn +19 -0
  116. data/test/pgn_collection/checkmate/white_wins/0013.pgn +15 -0
  117. data/test/pgn_collection/checkmate/white_wins/0014.pgn +12 -0
  118. data/test/pgn_collection/checkmate/white_wins/0015.pgn +20 -0
  119. data/test/pgn_collection/checkmate/white_wins/0016.pgn +12 -0
  120. data/test/pgn_collection/checkmate/white_wins/0017.pgn +12 -0
  121. data/test/pgn_collection/checkmate/white_wins/0018.pgn +21 -0
  122. data/test/pgn_collection/checkmate/white_wins/0019.pgn +21 -0
  123. data/test/pgn_collection/checkmate/white_wins/0020.pgn +15 -0
  124. data/test/pgn_collection/checkmate/white_wins/0021.pgn +18 -0
  125. data/test/pgn_collection/checkmate/white_wins/0022.pgn +14 -0
  126. data/test/pgn_collection/checkmate/white_wins/0023.pgn +27 -0
  127. data/test/pgn_collection/checkmate/white_wins/0024.pgn +19 -0
  128. data/test/pgn_collection/checkmate/white_wins/0025.pgn +19 -0
  129. data/test/pgn_collection/checkmate/white_wins/0026.pgn +19 -0
  130. data/test/pgn_collection/checkmate/white_wins/0027.pgn +27 -0
  131. data/test/pgn_collection/checkmate/white_wins/0028.pgn +17 -0
  132. data/test/pgn_collection/checkmate/white_wins/0029.pgn +19 -0
  133. data/test/pgn_collection/checkmate/white_wins/0030.pgn +19 -0
  134. data/test/pgn_collection/checkmate/white_wins/0031.pgn +19 -0
  135. data/test/pgn_collection/checkmate/white_wins/0032.pgn +19 -0
  136. data/test/pgn_collection/checkmate/white_wins/0033.pgn +28 -0
  137. data/test/pgn_collection/checkmate/white_wins/0034.pgn +12 -0
  138. data/test/pgn_collection/checkmate/white_wins/0035.pgn +12 -0
  139. data/test/pgn_collection/checkmate/white_wins/0036.pgn +16 -0
  140. data/test/pgn_collection/checkmate/white_wins/0037.pgn +19 -0
  141. data/test/pgn_collection/checkmate/white_wins/0038.pgn +19 -0
  142. data/test/pgn_collection/checkmate/white_wins/0039.pgn +28 -0
  143. data/test/pgn_collection/checkmate/white_wins/0040.pgn +19 -0
  144. data/test/pgn_collection/checkmate/white_wins/0041.pgn +18 -0
  145. data/test/pgn_collection/checkmate/white_wins/0042.pgn +18 -0
  146. data/test/pgn_collection/checkmate/white_wins/0043.pgn +14 -0
  147. data/test/pgn_collection/checkmate/white_wins/0044.pgn +15 -0
  148. data/test/pgn_collection/checkmate/white_wins/0045.pgn +14 -0
  149. data/test/pgn_collection/checkmate/white_wins/0046.pgn +15 -0
  150. data/test/pgn_collection/checkmate/white_wins/0047.pgn +14 -0
  151. data/test/pgn_collection/checkmate/white_wins/0048.pgn +19 -0
  152. data/test/pgn_collection/checkmate/white_wins/0049.pgn +19 -0
  153. data/test/pgn_collection/checkmate/white_wins/0050.pgn +15 -0
  154. data/test/pgn_collection/checkmate/white_wins/0051.pgn +16 -0
  155. data/test/pgn_collection/checkmate/white_wins/0052.pgn +18 -0
  156. data/test/pgn_collection/checkmate/white_wins/0053.pgn +14 -0
  157. data/test/pgn_collection/checkmate/white_wins/0054.pgn +15 -0
  158. data/test/pgn_collection/checkmate/white_wins/0055.pgn +16 -0
  159. data/test/pgn_collection/checkmate/white_wins/0056.pgn +15 -0
  160. data/test/pgn_collection/checkmate/white_wins/0057.pgn +20 -0
  161. data/test/pgn_collection/checkmate/white_wins/0058.pgn +17 -0
  162. data/test/pgn_collection/checkmate/white_wins/0059.pgn +13 -0
  163. data/test/pgn_collection/checkmate/white_wins/0060.pgn +18 -0
  164. data/test/pgn_collection/checkmate/white_wins/0061.pgn +19 -0
  165. data/test/pgn_collection/checkmate/white_wins/0062.pgn +21 -0
  166. data/test/pgn_collection/checkmate/white_wins/0063.pgn +17 -0
  167. data/test/pgn_collection/checkmate/white_wins/0064.pgn +14 -0
  168. data/test/pgn_collection/checkmate/white_wins/0065.pgn +17 -0
  169. data/test/pgn_collection/checkmate/white_wins/0066.pgn +19 -0
  170. data/test/pgn_collection/checkmate/white_wins/0067.pgn +12 -0
  171. data/test/pgn_collection/checkmate/white_wins/0068.pgn +15 -0
  172. data/test/pgn_collection/checkmate/white_wins/0069.pgn +12 -0
  173. data/test/pgn_collection/checkmate/white_wins/0070.pgn +15 -0
  174. data/test/pgn_collection/checkmate/white_wins/0071.pgn +14 -0
  175. data/test/pgn_collection/checkmate/white_wins/0072.pgn +17 -0
  176. data/test/pgn_collection/checkmate/white_wins/0073.pgn +19 -0
  177. data/test/pgn_collection/checkmate/white_wins/0074.pgn +25 -0
  178. data/test/pgn_collection/fifty_move_rule/0001.pgn +27 -0
  179. data/test/pgn_collection/fifty_move_rule/0002.pgn +29 -0
  180. data/test/pgn_collection/fifty_move_rule/0003.pgn +24 -0
  181. data/test/pgn_collection/fifty_move_rule/0004.pgn +24 -0
  182. data/test/pgn_collection/fifty_move_rule/0005.pgn +29 -0
  183. data/test/pgn_collection/fifty_move_rule/0006.pgn +24 -0
  184. data/test/pgn_collection/fifty_move_rule/0007.pgn +24 -0
  185. data/test/pgn_collection/fifty_move_rule/0008.pgn +27 -0
  186. data/test/pgn_collection/fifty_move_rule/0009.pgn +24 -0
  187. data/test/pgn_collection/fifty_move_rule/0010.pgn +24 -0
  188. data/test/pgn_collection/fifty_move_rule/0011.pgn +24 -0
  189. data/test/pgn_collection/fifty_move_rule/0012.pgn +24 -0
  190. data/test/pgn_collection/insufficient_material/0001.pgn +29 -0
  191. data/test/pgn_collection/stalemate/0001.pgn +17 -0
  192. data/test/pgn_collection/stalemate/0002.pgn +17 -0
  193. data/test/pgn_collection/stalemate/0003.pgn +17 -0
  194. data/test/pgn_collection/stalemate/0004.pgn +17 -0
  195. data/test/pgn_collection/stalemate/0005.pgn +19 -0
  196. data/test/pgn_collection/stalemate/0006.pgn +17 -0
  197. data/test/pgn_collection/stalemate/0007.pgn +17 -0
  198. data/test/pgn_collection/stalemate/0008.pgn +17 -0
  199. data/test/pgn_collection/threefold_repetition/0001.pgn +15 -0
  200. data/test/pgn_collection/threefold_repetition/0002.pgn +22 -0
  201. data/test/pgn_collection/threefold_repetition/0003.pgn +11 -0
  202. data/test/pgn_collection/threefold_repetition/0004.pgn +16 -0
  203. data/test/pgn_collection/threefold_repetition/0005.pgn +11 -0
  204. data/test/pgn_collection/threefold_repetition/0006.pgn +23 -0
  205. data/test/pgn_collection/threefold_repetition/0007.pgn +15 -0
  206. data/test/pgn_collection/threefold_repetition/0008.pgn +22 -0
  207. data/test/pgn_collection/threefold_repetition/0009.pgn +26 -0
  208. data/test/pgn_collection/threefold_repetition/0010.pgn +11 -0
  209. data/test/pgn_collection/threefold_repetition/0011.pgn +22 -0
  210. data/test/pgn_collection/threefold_repetition/0012.pgn +23 -0
  211. data/test/pgn_collection/threefold_repetition/0013.pgn +27 -0
  212. data/test/pgn_collection/threefold_repetition/0014.pgn +15 -0
  213. data/test/pgn_collection/threefold_repetition/0015.pgn +15 -0
  214. data/test/pgn_collection/threefold_repetition/0016.pgn +17 -0
  215. data/test/pgn_collection/threefold_repetition/0017.pgn +20 -0
  216. data/test/pgn_collection/threefold_repetition/0018.pgn +11 -0
  217. data/test/pgn_collection/threefold_repetition/0019.pgn +17 -0
  218. data/test/pgn_collection/threefold_repetition/0020.pgn +22 -0
  219. data/test/pgn_collection/threefold_repetition/0021.pgn +17 -0
  220. data/test/pgn_collection/threefold_repetition/0022.pgn +15 -0
  221. data/test/pgn_collection/threefold_repetition/0023.pgn +23 -0
  222. data/test/pgn_collection/threefold_repetition/0024.pgn +23 -0
  223. data/test/pgn_collection/valid/0001.pgn +19 -0
  224. data/test/pgn_collection/valid/0002.pgn +18 -0
  225. data/test/pgn_collection/valid/0003.pgn +19 -0
  226. data/test/pgn_collection/valid/0004.pgn +18 -0
  227. data/test/pgn_collection/valid/0005.pgn +17 -0
  228. data/test/pgn_collection/valid/0006.pgn +13 -0
  229. data/test/pgn_collection/valid/0007.pgn +18 -0
  230. data/test/pgn_collection/valid/0008.pgn +14 -0
  231. data/test/pgn_collection/valid/0009.pgn +25 -0
  232. data/test/pgn_collection/valid/0010.pgn +22 -0
  233. data/test/pgn_collection/valid/0011.pgn +19 -0
  234. data/test/pgn_collection/valid/0012.pgn +15 -0
  235. data/test/pgn_collection/valid/0013.pgn +23 -0
  236. data/test/pgn_collection/valid/0014.pgn +17 -0
  237. data/test/pgn_collection/valid/0015.pgn +21 -0
  238. data/test/pgn_collection/valid/0016.pgn +18 -0
  239. data/test/pgn_collection/valid/0017.pgn +20 -0
  240. data/test/pgn_collection/valid/0018.pgn +23 -0
  241. data/test/pgn_collection/valid/0019.pgn +18 -0
  242. data/test/pgn_collection/valid/0020.pgn +16 -0
  243. data/test/pgn_collection/valid/0021.pgn +26 -0
  244. data/test/pgn_collection/valid/0022.pgn +19 -0
  245. data/test/pgn_collection/valid/0023.pgn +17 -0
  246. data/test/pgn_collection/valid/0024.pgn +23 -0
  247. data/test/pgn_collection/valid/0025.pgn +16 -0
  248. data/test/pgn_collection/valid/0026.pgn +22 -0
  249. data/test/pgn_collection/valid/0027.pgn +24 -0
  250. data/test/pgn_collection/valid/0028.pgn +16 -0
  251. data/test/pgn_collection/valid/0029.pgn +20 -0
  252. data/test/pgn_collection/valid/0030.pgn +17 -0
  253. data/test/pgn_collection/valid/0031.pgn +18 -0
  254. data/test/pgn_collection/valid/0032.pgn +20 -0
  255. data/test/pgn_collection/valid/0033.pgn +19 -0
  256. data/test/pgn_collection/valid/0034.pgn +19 -0
  257. data/test/pgn_collection/valid/0035.pgn +16 -0
  258. data/test/pgn_collection/valid/0036.pgn +19 -0
  259. data/test/pgn_collection/valid/0037.pgn +20 -0
  260. data/test/pgn_collection/valid/0038.pgn +23 -0
  261. data/test/pgn_collection/valid/0039.pgn +25 -0
  262. data/test/pgn_collection/valid/0040.pgn +17 -0
  263. data/test/pgn_collection/valid/0041.pgn +19 -0
  264. data/test/pgn_collection/valid/0042.pgn +17 -0
  265. data/test/pgn_collection/valid/0043.pgn +20 -0
  266. data/test/pgn_collection/valid/0044.pgn +22 -0
  267. data/test/pgn_collection/valid/0045.pgn +18 -0
  268. data/test/pgn_collection/valid/0046.pgn +20 -0
  269. data/test/pgn_collection/valid/0047.pgn +15 -0
  270. data/test/pgn_collection/valid/0048.pgn +15 -0
  271. data/test/pgn_collection/valid/0049.pgn +18 -0
  272. data/test/pgn_collection/valid/0050.pgn +23 -0
  273. data/test/pgn_collection/valid/0051.pgn +18 -0
  274. data/test/pgn_collection/valid/0052.pgn +26 -0
  275. data/test/pgn_collection/valid/0053.pgn +17 -0
  276. data/test/pgn_collection/valid/0054.pgn +18 -0
  277. data/test/pgn_collection/valid/0055.pgn +20 -0
  278. data/test/pgn_collection/valid/0056.pgn +17 -0
  279. data/test/pgn_collection/valid/0057.pgn +16 -0
  280. data/test/pgn_collection/valid/0058.pgn +12 -0
  281. data/test/pgn_collection/valid/0059.pgn +15 -0
  282. data/test/pgn_collection/valid/0060.pgn +23 -0
  283. data/test/pgn_collection/valid/0061.pgn +18 -0
  284. data/test/pgn_collection/valid/0062.pgn +20 -0
  285. data/test/pgn_collection/valid/0063.pgn +16 -0
  286. data/test/pgn_collection/valid/0064.pgn +17 -0
  287. data/test/pgn_collection/valid/0065.pgn +16 -0
  288. data/test/pgn_collection/valid/0066.pgn +14 -0
  289. data/test/pgn_collection/valid/0067.pgn +15 -0
  290. data/test/pgn_collection/valid/0068.pgn +18 -0
  291. data/test/pgn_collection/valid/0069.pgn +19 -0
  292. data/test/pgn_collection/valid/0070.pgn +17 -0
  293. data/test/pgn_collection/valid/0071.pgn +15 -0
  294. data/test/pgn_collection/valid/0072.pgn +18 -0
  295. data/test/pgn_collection/valid/0073.pgn +21 -0
  296. data/test/pgn_collection/valid/0074.pgn +20 -0
  297. data/test/pgn_collection/valid/0075.pgn +14 -0
  298. data/test/pgn_collection/valid/0076.pgn +20 -0
  299. data/test/pgn_collection/valid/0077.pgn +14 -0
  300. data/test/pgn_collection/valid/0078.pgn +22 -0
  301. data/test/pgn_collection/valid/0079.pgn +16 -0
  302. data/test/pgn_collection/valid/0080.pgn +17 -0
  303. data/test/pgn_collection/valid/0081.pgn +17 -0
  304. data/test/pgn_collection/valid/0082.pgn +27 -0
  305. data/test/pgn_collection/valid/0083.pgn +23 -0
  306. data/test/pgn_collection/valid/0084.pgn +22 -0
  307. data/test/pgn_collection/valid/0085.pgn +21 -0
  308. data/test/pgn_collection/valid/0086.pgn +22 -0
  309. data/test/pgn_collection/valid/0087.pgn +21 -0
  310. data/test/pgn_collection/valid/0088.pgn +19 -0
  311. data/test/pgn_collection/valid/0089.pgn +18 -0
  312. data/test/pgn_collection/valid/0090.pgn +14 -0
  313. data/test/pgn_collection/valid/0091.pgn +14 -0
  314. data/test/pgn_collection/valid/0092.pgn +22 -0
  315. data/test/pgn_collection/valid/0093.pgn +19 -0
  316. data/test/pgn_collection/valid/0094.pgn +22 -0
  317. data/test/pgn_collection/valid/0095.pgn +22 -0
  318. data/test/pgn_collection/valid/0096.pgn +19 -0
  319. data/test/pgn_collection/valid/0097.pgn +22 -0
  320. data/test/pgn_collection/valid/0098.pgn +20 -0
  321. data/test/pgn_collection/valid/0099.pgn +17 -0
  322. data/test/pgn_collection/valid/0100.pgn +21 -0
  323. data/test/pgn_collection/valid/0101.pgn +18 -0
  324. data/test/pgn_collection/valid/0102.pgn +19 -0
  325. data/test/pgn_collection/valid/0103.pgn +27 -0
  326. data/test/pgn_collection/valid/0104.pgn +21 -0
  327. data/test/pgn_collection/valid/0105.pgn +14 -0
  328. data/test/pgn_collection/valid/0106.pgn +18 -0
  329. data/test/pgn_collection/valid/0107.pgn +18 -0
  330. data/test/pgn_collection/valid/0108.pgn +19 -0
  331. data/test/pgn_collection/valid/0109.pgn +17 -0
  332. data/test/pgn_collection/valid/0110.pgn +18 -0
  333. data/test/pgn_collection/valid/0111.pgn +16 -0
  334. data/test/pgn_collection/valid/0112.pgn +18 -0
  335. data/test/pgn_collection/valid/0113.pgn +20 -0
  336. data/test/pgn_collection/valid/0114.pgn +31 -0
  337. data/test/pgn_collection/valid/0115.pgn +23 -0
  338. data/test/pgn_collection/valid/0116.pgn +17 -0
  339. data/test/pgn_collection/valid/0117.pgn +19 -0
  340. data/test/pgn_collection/valid/0118.pgn +20 -0
  341. data/test/pgn_collection/valid/0119.pgn +25 -0
  342. data/test/pgn_collection/valid/0120.pgn +15 -0
  343. data/test/pgn_collection/valid/0121.pgn +19 -0
  344. data/test/pgn_collection/valid/0122.pgn +23 -0
  345. data/test/pgn_collection/valid/0123.pgn +21 -0
  346. data/test/pgn_collection/valid/0124.pgn +20 -0
  347. data/test/pgn_collection/valid/0125.pgn +19 -0
  348. data/test/pgn_collection/valid/0126.pgn +11 -0
  349. data/test/pgn_collection/valid/0127.pgn +19 -0
  350. data/test/pgn_collection/valid/0128.pgn +21 -0
  351. data/test/pgn_collection/valid/0129.pgn +25 -0
  352. data/test/pgn_collection/valid/0130.pgn +16 -0
  353. data/test/pgn_collection/valid/0131.pgn +20 -0
  354. data/test/pgn_collection/valid/0132.pgn +17 -0
  355. data/test/pgn_collection/valid/0133.pgn +17 -0
  356. data/test/pgn_collection/valid/0134.pgn +17 -0
  357. data/test/pgn_collection/valid/0135.pgn +19 -0
  358. data/test/pgn_collection/valid/0136.pgn +14 -0
  359. data/test/pgn_collection/valid/0137.pgn +20 -0
  360. data/test/pgn_collection/valid/0138.pgn +23 -0
  361. data/test/pgn_collection/valid/0139.pgn +21 -0
  362. data/test/pgn_collection/valid/0140.pgn +27 -0
  363. data/test/pgn_collection/valid/0141.pgn +15 -0
  364. data/test/pgn_collection/valid/0142.pgn +21 -0
  365. data/test/pgn_collection/valid/0143.pgn +23 -0
  366. data/test/pgn_collection/valid/0144.pgn +23 -0
  367. data/test/pgn_collection/valid/0145.pgn +22 -0
  368. data/test/pgn_collection/valid/0146.pgn +14 -0
  369. data/test/pgn_collection/valid/0147.pgn +23 -0
  370. data/test/pgn_collection/valid/0148.pgn +20 -0
  371. data/test/pgn_collection/valid/0149.pgn +16 -0
  372. data/test/pgn_collection/valid/0150.pgn +17 -0
  373. data/test/pgn_collection/valid/0151.pgn +19 -0
  374. data/test/pgn_collection/valid/0152.pgn +19 -0
  375. data/test/pgn_collection/valid/0153.pgn +22 -0
  376. data/test/pgn_collection/valid/0154.pgn +15 -0
  377. data/test/pgn_collection/valid/0155.pgn +20 -0
  378. data/test/pgn_collection/valid/0156.pgn +19 -0
  379. data/test/pgn_collection/valid/0157.pgn +15 -0
  380. data/test/pgn_collection/valid/0158.pgn +15 -0
  381. data/test/pgn_collection/valid/0159.pgn +18 -0
  382. data/test/pgn_collection/valid/0160.pgn +21 -0
  383. data/test/pgn_collection/valid/0161.pgn +22 -0
  384. data/test/pgn_collection/valid/0162.pgn +22 -0
  385. data/test/pgn_collection/valid/0163.pgn +15 -0
  386. data/test/pgn_collection/valid/0164.pgn +17 -0
  387. data/test/pgn_collection/valid/0165.pgn +19 -0
  388. data/test/pgn_collection/valid/0166.pgn +18 -0
  389. data/test/pgn_collection/valid/0167.pgn +23 -0
  390. data/test/pgn_collection/valid/0168.pgn +15 -0
  391. data/test/pgn_collection/valid/0169.pgn +21 -0
  392. data/test/pgn_collection/valid/0170.pgn +22 -0
  393. data/test/pgn_collection/valid/0171.pgn +15 -0
  394. data/test/pgn_collection/valid/0172.pgn +21 -0
  395. data/test/pgn_collection/valid/0173.pgn +13 -0
  396. data/test/pgn_collection/valid/0174.pgn +24 -0
  397. data/test/pgn_collection/valid/0175.pgn +21 -0
  398. data/test/pgn_collection/valid/0176.pgn +23 -0
  399. data/test/pgn_collection/valid/0177.pgn +19 -0
  400. data/test/pgn_collection/valid/0178.pgn +21 -0
  401. data/test/pgn_collection/valid/0179.pgn +22 -0
  402. data/test/pgn_collection/valid/0180.pgn +19 -0
  403. data/test/pgn_collection/valid/0181.pgn +24 -0
  404. data/test/pgn_collection/valid/0182.pgn +14 -0
  405. data/test/pgn_collection/valid/0183.pgn +15 -0
  406. data/test/pgn_collection/valid/0184.pgn +24 -0
  407. data/test/pgn_collection/valid/0185.pgn +14 -0
  408. data/test/pgn_collection/valid/0186.pgn +15 -0
  409. data/test/pgn_collection/valid/0187.pgn +19 -0
  410. data/test/pgn_collection/valid/0188.pgn +17 -0
  411. data/test/pgn_collection/valid/0189.pgn +20 -0
  412. data/test/pgn_collection/valid/0190.pgn +19 -0
  413. data/test/pgn_collection/valid/0191.pgn +26 -0
  414. data/test/pgn_collection/valid/0192.pgn +16 -0
  415. data/test/pgn_collection/valid/0193.pgn +18 -0
  416. data/test/pgn_collection/valid/0194.pgn +24 -0
  417. data/test/pgn_collection/valid/0195.pgn +16 -0
  418. data/test/pgn_collection/valid/0196.pgn +21 -0
  419. data/test/pgn_collection/valid/0197.pgn +21 -0
  420. data/test/pgn_collection/valid/0198.pgn +20 -0
  421. data/test/pgn_collection/valid/0199.pgn +13 -0
  422. data/test/pgn_collection/valid/0200.pgn +22 -0
  423. data/test/pgn_collection/valid/0201.pgn +19 -0
  424. data/test/pgn_collection/valid/0202.pgn +12 -0
  425. data/test/pgn_collection/valid/0203.pgn +13 -0
  426. data/test/pgn_collection/valid/0204.pgn +14 -0
  427. data/test/pgn_collection/valid/0205.pgn +13 -0
  428. data/test/pgn_collection/valid/0206.pgn +18 -0
  429. data/test/pgn_collection/valid/0207.pgn +17 -0
  430. data/test/pgn_collection/valid/0208.pgn +17 -0
  431. data/test/pgn_collection/valid/0209.pgn +20 -0
  432. data/test/pgn_collection/valid/0210.pgn +15 -0
  433. data/test/pgn_collection/valid/0211.pgn +21 -0
  434. data/test/pgn_collection/valid/0212.pgn +22 -0
  435. data/test/pgn_collection/valid/0213.pgn +15 -0
  436. data/test/pgn_collection/valid/0214.pgn +21 -0
  437. data/test/pgn_collection/valid/0215.pgn +15 -0
  438. data/test/pgn_collection/valid/0216.pgn +17 -0
  439. data/test/pgn_collection/valid/0217.pgn +21 -0
  440. data/test/pgn_collection/valid/0218.pgn +20 -0
  441. data/test/pgn_collection/valid/0219.pgn +15 -0
  442. data/test/pgn_collection/valid/0220.pgn +23 -0
  443. data/test/pgn_collection/valid/0221.pgn +26 -0
  444. data/test/pgn_collection/valid/0222.pgn +21 -0
  445. data/test/pgn_collection/valid/0223.pgn +16 -0
  446. data/test/pgn_collection/valid/0224.pgn +24 -0
  447. data/test/pgn_collection/valid/0225.pgn +19 -0
  448. data/test/pgn_collection/valid/0226.pgn +19 -0
  449. data/test/pgn_collection/valid/0227.pgn +20 -0
  450. data/test/pgn_collection/valid/0228.pgn +21 -0
  451. data/test/pgn_collection/valid/0229.pgn +16 -0
  452. data/test/pgn_collection/valid/0230.pgn +21 -0
  453. data/test/pgn_collection/valid/0231.pgn +22 -0
  454. data/test/pgn_collection/valid/0232.pgn +18 -0
  455. data/test/pgn_collection/valid/0233.pgn +17 -0
  456. data/test/pgn_collection/valid/0234.pgn +21 -0
  457. data/test/pgn_collection/valid/0235.pgn +23 -0
  458. data/test/pgn_collection/valid/0236.pgn +14 -0
  459. data/test/pgn_collection/valid/0237.pgn +21 -0
  460. data/test/pgn_collection/valid/0238.pgn +16 -0
  461. data/test/pgn_collection/valid/0239.pgn +21 -0
  462. data/test/pgn_collection/valid/0240.pgn +15 -0
  463. data/test/pgn_collection/valid/0241.pgn +21 -0
  464. data/test/pgn_collection/valid/0242.pgn +26 -0
  465. data/test/pgn_collection/valid/0243.pgn +13 -0
  466. data/test/pgn_collection/valid/0244.pgn +23 -0
  467. data/test/pgn_collection/valid/0245.pgn +19 -0
  468. data/test/pgn_collection/valid/0246.pgn +15 -0
  469. data/test/pgn_collection/valid/0247.pgn +21 -0
  470. data/test/pgn_collection/valid/0248.pgn +21 -0
  471. data/test/pgn_collection/valid/0249.pgn +15 -0
  472. data/test/pgn_collection/valid/0250.pgn +19 -0
  473. data/test/pgn_collection/valid/0251.pgn +22 -0
  474. data/test/pgn_collection/valid/0252.pgn +25 -0
  475. data/test/pgn_collection/valid/0253.pgn +29 -0
  476. data/test/pgn_collection/valid/0254.pgn +19 -0
  477. data/test/pgn_collection/valid/0255.pgn +20 -0
  478. data/test/pgn_collection/valid/0256.pgn +18 -0
  479. data/test/pgn_collection/valid/0257.pgn +22 -0
  480. data/test/pgn_collection/valid/0258.pgn +16 -0
  481. data/test/pgn_collection/valid/0259.pgn +19 -0
  482. data/test/pgn_collection/valid/0260.pgn +23 -0
  483. data/test/pgn_collection/valid/0261.pgn +16 -0
  484. data/test/pgn_collection/valid/0262.pgn +18 -0
  485. data/test/pgn_collection/valid/0263.pgn +12 -0
  486. data/test/pgn_collection/valid/0264.pgn +23 -0
  487. data/test/pgn_collection/valid/0265.pgn +19 -0
  488. data/test/pgn_collection/valid/0266.pgn +13 -0
  489. data/test/pgn_collection/valid/0267.pgn +14 -0
  490. data/test/pgn_collection/valid/0268.pgn +16 -0
  491. data/test/pgn_collection/valid/0269.pgn +23 -0
  492. data/test/pgn_collection/valid/0270.pgn +45 -0
  493. data/test/pgn_collection/valid/0271.pgn +22 -0
  494. data/test/pgn_collection/valid/0272.pgn +21 -0
  495. data/test/pgn_collection/valid/0273.pgn +15 -0
  496. data/test/pgn_collection/valid/0274.pgn +17 -0
  497. data/test/pgn_collection/valid/0275.pgn +21 -0
  498. data/test/pgn_collection/valid/0276.pgn +24 -0
  499. data/test/pgn_collection/valid/0277.pgn +15 -0
  500. data/test/pgn_collection/valid/0278.pgn +17 -0
  501. data/test/pgn_collection/valid/0279.pgn +19 -0
  502. data/test/pgn_collection/valid/0280.pgn +21 -0
  503. data/test/pgn_collection/valid/0281.pgn +23 -0
  504. data/test/pgn_collection/valid/0282.pgn +22 -0
  505. data/test/pgn_collection/valid/0283.pgn +20 -0
  506. data/test/pgn_collection/valid/0284.pgn +11 -0
  507. data/test/pgn_collection/valid/0285.pgn +16 -0
  508. data/test/pgn_collection/valid/0286.pgn +23 -0
  509. data/test/pgn_collection/valid/0287.pgn +19 -0
  510. data/test/pgn_collection/valid/0288.pgn +13 -0
  511. data/test/pgn_collection/valid/0289.pgn +23 -0
  512. data/test/pgn_collection/valid/0290.pgn +24 -0
  513. data/test/pgn_collection/valid/0291.pgn +20 -0
  514. data/test/pgn_collection/valid/0292.pgn +15 -0
  515. data/test/pgn_collection/valid/0293.pgn +20 -0
  516. data/test/pgn_collection/valid/0294.pgn +21 -0
  517. data/test/pgn_collection/valid/0295.pgn +15 -0
  518. data/test/pgn_collection/valid/0296.pgn +21 -0
  519. data/test/pgn_collection/valid/0297.pgn +19 -0
  520. data/test/pgn_collection/valid/0298.pgn +25 -0
  521. data/test/pgn_collection/valid/0299.pgn +23 -0
  522. data/test/pgn_collection/valid/0300.pgn +15 -0
  523. data/test/pgn_collection/valid/0301.pgn +18 -0
  524. data/test/pgn_collection/valid/0302.pgn +26 -0
  525. data/test/pgn_collection/valid/0303.pgn +20 -0
  526. data/test/pgn_collection/valid/0304.pgn +18 -0
  527. data/test/pgn_collection/valid/0305.pgn +16 -0
  528. data/test/pgn_collection/valid/0306.pgn +20 -0
  529. data/test/pgn_collection/valid/0307.pgn +25 -0
  530. data/test/pgn_collection/valid/0308.pgn +20 -0
  531. data/test/pgn_collection/valid/0309.pgn +19 -0
  532. data/test/pgn_collection/valid/0310.pgn +24 -0
  533. data/test/pgn_collection/valid/0311.pgn +13 -0
  534. data/test/pgn_collection/valid/0312.pgn +18 -0
  535. data/test/pgn_collection/valid/0313.pgn +15 -0
  536. data/test/pgn_collection/valid/0314.pgn +21 -0
  537. data/test/pgn_collection/valid/0315.pgn +14 -0
  538. data/test/pgn_collection/valid/0316.pgn +19 -0
  539. data/test/pgn_collection/valid/0317.pgn +23 -0
  540. data/test/pgn_collection/valid/0318.pgn +12 -0
  541. data/test/pgn_collection/valid/0319.pgn +17 -0
  542. data/test/pgn_collection/valid/0320.pgn +18 -0
  543. data/test/pgn_collection/valid/0321.pgn +22 -0
  544. data/test/pgn_collection/valid/0322.pgn +17 -0
  545. data/test/pgn_collection/valid/0323.pgn +24 -0
  546. data/test/pgn_collection/valid/0324.pgn +21 -0
  547. data/test/pgn_collection/valid/0325.pgn +21 -0
  548. data/test/pgn_collection/valid/0326.pgn +21 -0
  549. data/test/pgn_collection/valid/0327.pgn +20 -0
  550. data/test/pgn_collection/valid/0328.pgn +15 -0
  551. data/test/pgn_collection/valid/0329.pgn +19 -0
  552. data/test/pgn_collection/valid/0330.pgn +17 -0
  553. data/test/pgn_collection/valid/0331.pgn +19 -0
  554. data/test/pgn_collection/valid/0332.pgn +18 -0
  555. data/test/pgn_collection/valid/0333.pgn +16 -0
  556. data/test/pgn_collection/valid/0334.pgn +18 -0
  557. data/test/pgn_collection/valid/0335.pgn +12 -0
  558. data/test/pgn_collection/valid/0336.pgn +16 -0
  559. data/test/pgn_collection/valid/0337.pgn +20 -0
  560. data/test/pgn_collection/valid/0338.pgn +24 -0
  561. data/test/pgn_collection/valid/0339.pgn +22 -0
  562. data/test/pgn_collection/valid/0340.pgn +12 -0
  563. data/test/pgn_collection/valid/0341.pgn +22 -0
  564. data/test/pgn_collection/valid/0342.pgn +19 -0
  565. data/test/pgn_collection/valid/0343.pgn +14 -0
  566. data/test/pgn_collection/valid/0344.pgn +16 -0
  567. data/test/pgn_collection/valid/0345.pgn +23 -0
  568. data/test/pgn_collection/valid/0346.pgn +19 -0
  569. data/test/pgn_collection/valid/0347.pgn +20 -0
  570. data/test/pgn_collection/valid/0348.pgn +24 -0
  571. data/test/pgn_collection/valid/0349.pgn +30 -0
  572. data/test/pgn_collection/valid/0350.pgn +20 -0
  573. data/test/pgn_collection/valid/0351.pgn +16 -0
  574. data/test/pgn_collection/valid/0352.pgn +16 -0
  575. data/test/pgn_collection/valid/0353.pgn +23 -0
  576. data/test/pgn_collection/valid/0354.pgn +24 -0
  577. data/test/pgn_collection/valid/0355.pgn +26 -0
  578. data/test/pgn_collection/valid/0356.pgn +17 -0
  579. data/test/pgn_collection/valid/0357.pgn +22 -0
  580. data/test/pgn_collection/valid/0358.pgn +21 -0
  581. data/test/pgn_collection/valid/0359.pgn +17 -0
  582. data/test/pgn_collection/valid/0360.pgn +13 -0
  583. data/test/pgn_collection/valid/0361.pgn +21 -0
  584. data/test/pgn_collection/valid/0362.pgn +17 -0
  585. data/test/pgn_collection/valid/0363.pgn +20 -0
  586. data/test/pgn_collection/valid/0364.pgn +16 -0
  587. data/test/pgn_collection/valid/0365.pgn +23 -0
  588. data/test/pgn_collection/valid/0366.pgn +17 -0
  589. data/test/pgn_collection/valid/0367.pgn +19 -0
  590. data/test/pgn_collection/valid/0368.pgn +23 -0
  591. data/test/pgn_collection/valid/0369.pgn +25 -0
  592. data/test/pgn_collection/valid/0370.pgn +20 -0
  593. data/test/pgn_collection/valid/0371.pgn +15 -0
  594. data/test/pgn_collection/valid/0372.pgn +17 -0
  595. data/test/pgn_collection/valid/0373.pgn +19 -0
  596. data/test/pgn_collection/valid/0374.pgn +16 -0
  597. data/test/pgn_collection/valid/0375.pgn +23 -0
  598. data/test/pgn_collection/valid/0376.pgn +16 -0
  599. data/test/pgn_collection/valid/0377.pgn +24 -0
  600. data/test/pgn_collection/valid/0378.pgn +19 -0
  601. data/test/pgn_collection/valid/0379.pgn +21 -0
  602. data/test/pgn_collection/valid/0380.pgn +22 -0
  603. data/test/pgn_collection/valid/0381.pgn +17 -0
  604. data/test/pgn_collection/valid/0382.pgn +24 -0
  605. data/test/pgn_collection/valid/0383.pgn +21 -0
  606. data/test/pgn_collection/valid/0384.pgn +16 -0
  607. data/test/pgn_collection/valid/0385.pgn +27 -0
  608. data/test/pgn_collection/valid/0386.pgn +21 -0
  609. data/test/pgn_collection/valid/0387.pgn +17 -0
  610. data/test/pgn_collection/valid/0388.pgn +20 -0
  611. data/test/pgn_collection/valid/0389.pgn +20 -0
  612. data/test/pgn_collection/valid/0390.pgn +17 -0
  613. data/test/pgn_collection/valid/0391.pgn +15 -0
  614. data/test/pgn_collection/valid/0392.pgn +23 -0
  615. data/test/pgn_collection/valid/0393.pgn +18 -0
  616. data/test/pgn_collection/valid/0394.pgn +25 -0
  617. data/test/pgn_collection/valid/0395.pgn +13 -0
  618. data/test/pgn_collection/valid/0396.pgn +17 -0
  619. data/test/pgn_collection/valid/0397.pgn +21 -0
  620. data/test/pgn_collection/valid/0398.pgn +16 -0
  621. data/test/pgn_collection/valid/0399.pgn +24 -0
  622. data/test/pgn_collection/valid/0400.pgn +17 -0
  623. data/test/pgn_collection/valid/0401.pgn +22 -0
  624. data/test/pgn_collection/valid/0402.pgn +22 -0
  625. data/test/pgn_collection/valid/0403.pgn +17 -0
  626. data/test/pgn_collection/valid/0404.pgn +21 -0
  627. data/test/pgn_collection/valid/0405.pgn +22 -0
  628. data/test/pgn_collection/valid/0406.pgn +27 -0
  629. data/test/pgn_collection/valid/0407.pgn +19 -0
  630. data/test/pgn_collection/valid/0408.pgn +23 -0
  631. data/test/pgn_collection/valid/0409.pgn +23 -0
  632. data/test/pgn_collection/valid/0410.pgn +20 -0
  633. data/test/pgn_collection/valid/0411.pgn +17 -0
  634. data/test/pgn_collection/valid/0412.pgn +17 -0
  635. data/test/pgn_collection/valid/0413.pgn +17 -0
  636. data/test/pgn_collection/valid/0414.pgn +21 -0
  637. data/test/pgn_collection/valid/0415.pgn +25 -0
  638. data/test/pgn_collection/valid/0416.pgn +24 -0
  639. data/test/pgn_collection/valid/0417.pgn +21 -0
  640. data/test/pgn_collection/valid/0418.pgn +18 -0
  641. data/test/pgn_collection/valid/0419.pgn +19 -0
  642. data/test/pgn_collection/valid/0420.pgn +21 -0
  643. data/test/pgn_collection/valid/0421.pgn +24 -0
  644. data/test/pgn_collection/valid/0422.pgn +22 -0
  645. data/test/pgn_collection/valid/0423.pgn +23 -0
  646. data/test/pgn_collection/valid/0424.pgn +23 -0
  647. data/test/pgn_collection/valid/0425.pgn +18 -0
  648. data/test/pgn_collection/valid/0426.pgn +16 -0
  649. data/test/pgn_collection/valid/0427.pgn +14 -0
  650. data/test/pgn_collection/valid/0428.pgn +21 -0
  651. data/test/pgn_collection/valid/0429.pgn +16 -0
  652. data/test/pgn_collection/valid/0430.pgn +21 -0
  653. data/test/pgn_collection/valid/0431.pgn +17 -0
  654. data/test/pgn_collection/valid/0432.pgn +19 -0
  655. data/test/pgn_collection/valid/0433.pgn +17 -0
  656. data/test/pgn_collection/valid/0434.pgn +20 -0
  657. data/test/pgn_collection/valid/0435.pgn +15 -0
  658. data/test/pgn_collection/valid/0436.pgn +24 -0
  659. data/test/pgn_collection/valid/0437.pgn +22 -0
  660. data/test/pgn_collection/valid/0438.pgn +16 -0
  661. data/test/pgn_collection/valid/0439.pgn +26 -0
  662. data/test/pgn_collection/valid/0440.pgn +24 -0
  663. data/test/pgn_collection/valid/0441.pgn +14 -0
  664. data/test/pgn_collection/valid/0442.pgn +21 -0
  665. data/test/pgn_collection/valid/0443.pgn +20 -0
  666. data/test/pgn_collection/valid/0444.pgn +18 -0
  667. data/test/pgn_collection/valid/0445.pgn +22 -0
  668. data/test/pgn_collection/valid/0446.pgn +20 -0
  669. data/test/pgn_collection/valid/0447.pgn +25 -0
  670. data/test/pgn_collection/valid/0448.pgn +18 -0
  671. data/test/pgn_collection/valid/0449.pgn +17 -0
  672. data/test/pgn_collection/valid/0450.pgn +16 -0
  673. data/test/pgn_collection/valid/0451.pgn +14 -0
  674. data/test/pgn_collection/valid/0452.pgn +21 -0
  675. data/test/pgn_collection/valid/0453.pgn +15 -0
  676. data/test/pgn_collection/valid/0454.pgn +17 -0
  677. data/test/pgn_collection/valid/0455.pgn +22 -0
  678. data/test/pgn_collection/valid/0456.pgn +15 -0
  679. data/test/pgn_collection/valid/0457.pgn +23 -0
  680. data/test/pgn_collection/valid/0458.pgn +21 -0
  681. data/test/pgn_collection/valid/0459.pgn +20 -0
  682. data/test/pgn_collection/valid/0460.pgn +16 -0
  683. data/test/pgn_collection/valid/0461.pgn +16 -0
  684. data/test/pgn_collection/valid/0462.pgn +25 -0
  685. data/test/pgn_collection/valid/0463.pgn +14 -0
  686. data/test/pgn_collection/valid/0464.pgn +12 -0
  687. data/test/pgn_collection/valid/0465.pgn +20 -0
  688. data/test/pgn_collection/valid/0466.pgn +17 -0
  689. data/test/pgn_collection/valid/0467.pgn +23 -0
  690. data/test/pgn_collection/valid/0468.pgn +17 -0
  691. data/test/pgn_collection/valid/0469.pgn +18 -0
  692. data/test/pgn_collection/valid/0470.pgn +15 -0
  693. data/test/pgn_collection/valid/0471.pgn +15 -0
  694. data/test/pgn_collection/valid/0472.pgn +29 -0
  695. data/test/pgn_collection/valid/0473.pgn +19 -0
  696. data/test/pgn_collection/valid/0474.pgn +20 -0
  697. data/test/pgn_collection/valid/0475.pgn +17 -0
  698. data/test/pgn_collection/valid/0476.pgn +18 -0
  699. data/test/pgn_collection/valid/0477.pgn +30 -0
  700. data/test/pgn_collection/valid/0478.pgn +18 -0
  701. data/test/pgn_collection/valid/0479.pgn +20 -0
  702. data/test/pgn_collection/valid/0480.pgn +18 -0
  703. data/test/pgn_collection/valid/0481.pgn +23 -0
  704. data/test/pgn_collection/valid/0482.pgn +17 -0
  705. data/test/pgn_collection/valid/0483.pgn +15 -0
  706. data/test/pgn_collection/valid/0484.pgn +18 -0
  707. data/test/pgn_collection/valid/0485.pgn +19 -0
  708. data/test/pgn_collection/valid/0486.pgn +18 -0
  709. data/test/pgn_collection/valid/0487.pgn +19 -0
  710. data/test/pgn_collection/valid/0488.pgn +18 -0
  711. data/test/pgn_collection/valid/0489.pgn +15 -0
  712. data/test/pgn_collection/valid/0490.pgn +21 -0
  713. data/test/pgn_collection/valid/0491.pgn +15 -0
  714. data/test/pgn_collection/valid/0492.pgn +18 -0
  715. data/test/pgn_collection/valid/0493.pgn +19 -0
  716. data/test/pgn_collection/valid/0494.pgn +16 -0
  717. data/test/pgn_collection/valid/0495.pgn +18 -0
  718. data/test/pgn_collection/valid/0496.pgn +28 -0
  719. data/test/pgn_collection/valid/0497.pgn +24 -0
  720. data/test/pgn_collection/valid/0498.pgn +23 -0
  721. data/test/pgn_collection/valid/0499.pgn +14 -0
  722. data/test/pgn_collection/valid/0500.pgn +16 -0
  723. data/test/pgn_collection/valid/0501.pgn +21 -0
  724. data/test/pgn_collection/valid/0502.pgn +19 -0
  725. data/test/pgn_collection/valid/0503.pgn +23 -0
  726. data/test/pgn_collection/valid/0504.pgn +14 -0
  727. data/test/pgn_collection/valid/0505.pgn +16 -0
  728. data/test/pgn_collection/valid/0506.pgn +19 -0
  729. data/test/pgn_collection/valid/0507.pgn +18 -0
  730. data/test/pgn_collection/valid/0508.pgn +13 -0
  731. data/test/pgn_collection/valid/0509.pgn +22 -0
  732. data/test/pgn_collection/valid/0510.pgn +25 -0
  733. data/test/pgn_collection/valid/0511.pgn +15 -0
  734. data/test/pgn_collection/valid/0512.pgn +25 -0
  735. data/test/pgn_collection/valid/0513.pgn +24 -0
  736. data/test/pgn_collection/valid/0514.pgn +17 -0
  737. data/test/pgn_collection/valid/0515.pgn +12 -0
  738. data/test/pgn_collection/valid/0516.pgn +22 -0
  739. data/test/pgn_collection/valid/0517.pgn +13 -0
  740. data/test/pgn_collection/valid/0518.pgn +23 -0
  741. data/test/pgn_collection/valid/0519.pgn +25 -0
  742. data/test/pgn_collection/valid/0520.pgn +15 -0
  743. data/test/pgn_collection/valid/0521.pgn +15 -0
  744. data/test/pgn_collection/valid/0522.pgn +16 -0
  745. data/test/pgn_collection/valid/0523.pgn +16 -0
  746. data/test/pgn_collection/valid/0524.pgn +28 -0
  747. data/test/pgn_collection/valid/0525.pgn +25 -0
  748. data/test/pgn_collection/valid/0526.pgn +21 -0
  749. data/test/pgn_collection/valid/0527.pgn +18 -0
  750. data/test/pgn_collection/valid/0528.pgn +20 -0
  751. data/test/pgn_collection/valid/0529.pgn +19 -0
  752. data/test/pgn_collection/valid/0530.pgn +19 -0
  753. data/test/pgn_collection/valid/0531.pgn +18 -0
  754. data/test/pgn_collection/valid/0532.pgn +25 -0
  755. data/test/pgn_collection/valid/0533.pgn +19 -0
  756. data/test/pgn_collection/valid/0534.pgn +25 -0
  757. data/test/pgn_collection/valid/0535.pgn +17 -0
  758. data/test/pgn_collection/valid/0536.pgn +21 -0
  759. data/test/pgn_collection/valid/0537.pgn +17 -0
  760. data/test/pgn_collection/valid/0538.pgn +19 -0
  761. data/test/pgn_collection/valid/0539.pgn +31 -0
  762. data/test/pgn_collection/valid/0540.pgn +19 -0
  763. data/test/pgn_collection/valid/0541.pgn +17 -0
  764. data/test/pgn_collection/valid/0542.pgn +17 -0
  765. data/test/pgn_collection/valid/0543.pgn +21 -0
  766. data/test/pgn_collection/valid/0544.pgn +23 -0
  767. data/test/pgn_collection/valid/0545.pgn +19 -0
  768. data/test/pgn_collection/valid/0546.pgn +21 -0
  769. data/test/pgn_collection/valid/0547.pgn +17 -0
  770. data/test/pgn_collection/valid/0548.pgn +17 -0
  771. data/test/pgn_collection/valid/0549.pgn +17 -0
  772. data/test/pgn_collection/valid/0550.pgn +20 -0
  773. data/test/pgn_collection/valid/0551.pgn +22 -0
  774. data/test/pgn_collection/valid/0552.pgn +22 -0
  775. data/test/pgn_collection/valid/0553.pgn +14 -0
  776. data/test/pgn_collection/valid/0554.pgn +20 -0
  777. data/test/pgn_collection/valid/0555.pgn +23 -0
  778. data/test/pgn_collection/valid/0556.pgn +22 -0
  779. data/test/pgn_collection/valid/0557.pgn +14 -0
  780. data/test/pgn_collection/valid/0558.pgn +21 -0
  781. data/test/pgn_collection/valid/0559.pgn +15 -0
  782. data/test/pgn_collection/valid/0560.pgn +19 -0
  783. data/test/pgn_collection/valid/0561.pgn +15 -0
  784. data/test/pgn_collection/valid/0562.pgn +17 -0
  785. data/test/pgn_collection/valid/0563.pgn +15 -0
  786. data/test/pgn_collection/valid/0564.pgn +15 -0
  787. data/test/pgn_collection/valid/0565.pgn +23 -0
  788. data/test/pgn_collection/valid/0566.pgn +14 -0
  789. data/test/pgn_collection/valid/0567.pgn +14 -0
  790. data/test/pgn_collection/valid/0568.pgn +20 -0
  791. data/test/pgn_collection/valid/0569.pgn +20 -0
  792. data/test/pgn_collection/valid/0570.pgn +25 -0
  793. data/test/pgn_collection/valid/0571.pgn +19 -0
  794. data/test/pgn_collection/valid/0572.pgn +17 -0
  795. data/test/pgn_collection/valid/0573.pgn +17 -0
  796. data/test/pgn_collection/valid/0574.pgn +23 -0
  797. data/test/pgn_collection/valid/0575.pgn +22 -0
  798. data/test/pgn_collection/valid/0576.pgn +21 -0
  799. data/test/pgn_collection/valid/0577.pgn +19 -0
  800. data/test/pgn_collection/valid/0578.pgn +20 -0
  801. data/test/pgn_collection/valid/0579.pgn +25 -0
  802. data/test/pgn_collection/valid/0580.pgn +19 -0
  803. data/test/pgn_collection/valid/0581.pgn +13 -0
  804. data/test/pgn_collection/valid/0582.pgn +21 -0
  805. data/test/pgn_collection/valid/0583.pgn +25 -0
  806. data/test/pgn_collection/valid/0584.pgn +18 -0
  807. data/test/pgn_collection/valid/0585.pgn +20 -0
  808. data/test/pgn_collection/valid/0586.pgn +20 -0
  809. data/test/pgn_collection/valid/0587.pgn +16 -0
  810. data/test/pgn_collection/valid/0588.pgn +21 -0
  811. data/test/pgn_collection/valid/0589.pgn +15 -0
  812. data/test/pgn_collection/valid/0590.pgn +23 -0
  813. data/test/pgn_collection/valid/0591.pgn +19 -0
  814. data/test/pgn_collection/valid/0592.pgn +21 -0
  815. data/test/pgn_collection/valid/0593.pgn +15 -0
  816. data/test/pgn_collection/valid/0594.pgn +18 -0
  817. data/test/pgn_collection/valid/0595.pgn +16 -0
  818. data/test/pgn_collection/valid/0596.pgn +21 -0
  819. data/test/pgn_collection/valid/0597.pgn +20 -0
  820. data/test/pgn_collection/valid/0598.pgn +18 -0
  821. data/test/pgn_collection/valid/0599.pgn +16 -0
  822. data/test/pgn_collection/valid/0600.pgn +22 -0
  823. data/test/pgn_collection/valid/0601.pgn +17 -0
  824. data/test/pgn_collection/valid/0602.pgn +21 -0
  825. data/test/pgn_collection/valid/0603.pgn +21 -0
  826. data/test/pgn_collection/valid/0604.pgn +14 -0
  827. data/test/pgn_collection/valid/0605.pgn +20 -0
  828. data/test/pgn_collection/valid/0606.pgn +23 -0
  829. data/test/pgn_collection/valid/0607.pgn +16 -0
  830. data/test/pgn_collection/valid/0608.pgn +22 -0
  831. data/test/pgn_collection/valid/0609.pgn +15 -0
  832. data/test/pgn_collection/valid/0610.pgn +16 -0
  833. data/test/pgn_collection/valid/0611.pgn +21 -0
  834. data/test/pgn_collection/valid/0612.pgn +18 -0
  835. data/test/pgn_collection/valid/0613.pgn +12 -0
  836. data/test/pgn_collection/valid/0614.pgn +15 -0
  837. data/test/pgn_collection/valid/0615.pgn +18 -0
  838. data/test/pgn_collection/valid/0616.pgn +16 -0
  839. data/test/pgn_collection/valid/0617.pgn +26 -0
  840. data/test/pgn_collection/valid/0618.pgn +19 -0
  841. data/test/pgn_collection/valid/0619.pgn +18 -0
  842. data/test/pgn_collection/valid/0620.pgn +22 -0
  843. data/test/pgn_collection/valid/0621.pgn +18 -0
  844. data/test/pgn_collection/valid/0622.pgn +20 -0
  845. data/test/pgn_collection/valid/0623.pgn +23 -0
  846. data/test/pgn_collection/valid/0624.pgn +19 -0
  847. data/test/pgn_collection/valid/0625.pgn +19 -0
  848. data/test/pgn_collection/valid/0626.pgn +22 -0
  849. data/test/pgn_collection/valid/0627.pgn +23 -0
  850. data/test/pgn_collection/valid/0628.pgn +23 -0
  851. data/test/pgn_collection/valid/0629.pgn +16 -0
  852. data/test/pgn_collection/valid/0630.pgn +15 -0
  853. data/test/pgn_collection/valid/0631.pgn +21 -0
  854. data/test/pgn_collection/valid/0632.pgn +22 -0
  855. data/test/pgn_collection/valid/0633.pgn +22 -0
  856. data/test/pgn_collection/valid/0634.pgn +16 -0
  857. data/test/pgn_collection/valid/0635.pgn +20 -0
  858. data/test/pgn_collection/valid/0636.pgn +12 -0
  859. data/test/pgn_collection/valid/0637.pgn +19 -0
  860. data/test/pgn_collection/valid/0638.pgn +27 -0
  861. data/test/pgn_collection/valid/0639.pgn +19 -0
  862. data/test/pgn_collection/valid/0640.pgn +22 -0
  863. data/test/pgn_collection/valid/0641.pgn +14 -0
  864. data/test/pgn_collection/valid/0642.pgn +16 -0
  865. data/test/pgn_collection/valid/0643.pgn +19 -0
  866. data/test/pgn_collection/valid/0644.pgn +19 -0
  867. data/test/pgn_collection/valid/0645.pgn +16 -0
  868. data/test/pgn_collection/valid/0646.pgn +18 -0
  869. data/test/pgn_collection/valid/0647.pgn +21 -0
  870. data/test/pgn_collection/valid/0648.pgn +28 -0
  871. data/test/pgn_collection/valid/0649.pgn +18 -0
  872. data/test/pgn_collection/valid/0650.pgn +16 -0
  873. data/test/pgn_collection/valid/0651.pgn +20 -0
  874. data/test/pgn_collection/valid/0652.pgn +19 -0
  875. data/test/pgn_collection/valid/0653.pgn +23 -0
  876. data/test/pgn_collection/valid/0654.pgn +21 -0
  877. data/test/pgn_collection/valid/0655.pgn +20 -0
  878. data/test/pgn_collection/valid/0656.pgn +22 -0
  879. data/test/pgn_collection/valid/0657.pgn +14 -0
  880. data/test/pgn_collection/valid/0658.pgn +26 -0
  881. data/test/pgn_collection/valid/0659.pgn +22 -0
  882. data/test/pgn_collection/valid/0660.pgn +27 -0
  883. data/test/pgn_collection/valid/0661.pgn +25 -0
  884. data/test/pgn_collection/valid/0662.pgn +15 -0
  885. data/test/pgn_collection/valid/0663.pgn +17 -0
  886. data/test/pgn_collection/valid/0664.pgn +19 -0
  887. data/test/pgn_collection/valid/0665.pgn +13 -0
  888. data/test/pgn_collection/valid/0666.pgn +19 -0
  889. data/test/pgn_collection/valid/0667.pgn +20 -0
  890. data/test/pgn_collection/valid/0668.pgn +22 -0
  891. data/test/pgn_collection/valid/0669.pgn +22 -0
  892. data/test/pgn_collection/valid/0670.pgn +16 -0
  893. data/test/pgn_collection/valid/0671.pgn +19 -0
  894. data/test/pgn_collection/valid/0672.pgn +15 -0
  895. data/test/pgn_collection/valid/0673.pgn +19 -0
  896. data/test/pgn_collection/valid/0674.pgn +15 -0
  897. data/test/pgn_collection/valid/0675.pgn +22 -0
  898. data/test/pgn_collection/valid/0676.pgn +21 -0
  899. data/test/pgn_collection/valid/0677.pgn +18 -0
  900. data/test/pgn_collection/valid/0678.pgn +17 -0
  901. data/test/pgn_collection/valid/0679.pgn +16 -0
  902. data/test/pgn_collection/valid/0680.pgn +21 -0
  903. data/test/pgn_collection/valid/0681.pgn +19 -0
  904. data/test/pgn_collection/valid/0682.pgn +19 -0
  905. data/test/pgn_collection/valid/0683.pgn +15 -0
  906. data/test/pgn_collection/valid/0684.pgn +19 -0
  907. data/test/pgn_collection/valid/0685.pgn +14 -0
  908. data/test/pgn_collection/valid/0686.pgn +16 -0
  909. data/test/pgn_collection/valid/0687.pgn +15 -0
  910. data/test/pgn_collection/valid/0688.pgn +15 -0
  911. data/test/pgn_collection/valid/0689.pgn +24 -0
  912. data/test/pgn_collection/valid/0690.pgn +24 -0
  913. data/test/pgn_collection/valid/0691.pgn +16 -0
  914. data/test/pgn_collection/valid/0692.pgn +26 -0
  915. data/test/pgn_collection/valid/0693.pgn +19 -0
  916. data/test/pgn_collection/valid/0694.pgn +21 -0
  917. data/test/pgn_collection/valid/0695.pgn +21 -0
  918. data/test/pgn_collection/valid/0696.pgn +26 -0
  919. data/test/pgn_collection/valid/0697.pgn +14 -0
  920. data/test/pgn_collection/valid/0698.pgn +24 -0
  921. data/test/pgn_collection/valid/0699.pgn +18 -0
  922. data/test/pgn_collection/valid/0700.pgn +15 -0
  923. data/test/pgn_collection/valid/0701.pgn +13 -0
  924. data/test/pgn_collection/valid/0702.pgn +18 -0
  925. data/test/pgn_collection/valid/0703.pgn +18 -0
  926. data/test/pgn_collection/valid/0704.pgn +17 -0
  927. data/test/pgn_collection/valid/0705.pgn +19 -0
  928. data/test/pgn_collection/valid/0706.pgn +16 -0
  929. data/test/pgn_collection/valid/0707.pgn +19 -0
  930. data/test/pgn_collection/valid/0708.pgn +24 -0
  931. data/test/pgn_collection/valid/0709.pgn +13 -0
  932. data/test/pgn_collection/valid/0710.pgn +29 -0
  933. data/test/pgn_collection/valid/0711.pgn +18 -0
  934. data/test/pgn_collection/valid/0712.pgn +12 -0
  935. data/test/pgn_collection/valid/0713.pgn +19 -0
  936. data/test/pgn_collection/valid/0714.pgn +21 -0
  937. data/test/pgn_collection/valid/0715.pgn +17 -0
  938. data/test/pgn_collection/valid/0716.pgn +17 -0
  939. data/test/pgn_collection/valid/0717.pgn +23 -0
  940. data/test/pgn_collection/valid/0718.pgn +16 -0
  941. data/test/pgn_collection/valid/0719.pgn +19 -0
  942. data/test/pgn_collection/valid/0720.pgn +21 -0
  943. data/test/pgn_collection/valid/0721.pgn +19 -0
  944. data/test/pgn_collection/valid/0722.pgn +32 -0
  945. data/test/pgn_collection/valid/0723.pgn +22 -0
  946. data/test/pgn_collection/valid/0724.pgn +17 -0
  947. data/test/pgn_collection/valid/0725.pgn +16 -0
  948. data/test/pgn_collection/valid/0726.pgn +20 -0
  949. data/test/pgn_collection/valid/0727.pgn +17 -0
  950. data/test/pgn_collection/valid/0728.pgn +16 -0
  951. data/test/pgn_collection/valid/0729.pgn +18 -0
  952. data/test/pgn_collection/valid/0730.pgn +17 -0
  953. data/test/pgn_collection/valid/0731.pgn +37 -0
  954. data/test/pgn_collection/valid/0732.pgn +21 -0
  955. data/test/pgn_collection/valid/0733.pgn +25 -0
  956. data/test/pgn_collection/valid/0734.pgn +20 -0
  957. data/test/pgn_collection/valid/0735.pgn +17 -0
  958. data/test/pgn_collection/valid/0736.pgn +17 -0
  959. data/test/pgn_collection/valid/0737.pgn +14 -0
  960. data/test/pgn_collection/valid/0738.pgn +21 -0
  961. data/test/pgn_collection/valid/0739.pgn +20 -0
  962. data/test/pgn_collection/valid/0740.pgn +15 -0
  963. data/test/pgn_collection/valid/0741.pgn +24 -0
  964. data/test/pgn_collection/valid/0742.pgn +18 -0
  965. data/test/pgn_collection/valid/0743.pgn +18 -0
  966. data/test/pgn_collection/valid/0744.pgn +23 -0
  967. data/test/pgn_collection/valid/0745.pgn +23 -0
  968. data/test/pgn_collection/valid/0746.pgn +15 -0
  969. data/test/pgn_collection/valid/0747.pgn +23 -0
  970. data/test/pgn_collection/valid/0748.pgn +16 -0
  971. data/test/pgn_collection/valid/0749.pgn +18 -0
  972. data/test/pgn_collection/valid/0750.pgn +18 -0
  973. data/test/pgn_collection/valid/0751.pgn +21 -0
  974. data/test/pgn_collection/valid/0752.pgn +18 -0
  975. data/test/pgn_collection/valid/0753.pgn +17 -0
  976. data/test/pgn_collection/valid/0754.pgn +24 -0
  977. data/test/pgn_collection/valid/0755.pgn +25 -0
  978. data/test/pgn_collection/valid/0756.pgn +20 -0
  979. data/test/pgn_collection/valid/0757.pgn +19 -0
  980. data/test/pgn_collection/valid/0758.pgn +14 -0
  981. data/test/pgn_collection/valid/0759.pgn +19 -0
  982. data/test/pgn_collection/valid/0760.pgn +21 -0
  983. data/test/pgn_collection/valid/0761.pgn +17 -0
  984. data/test/pgn_collection/valid/0762.pgn +16 -0
  985. data/test/pgn_collection/valid/0763.pgn +21 -0
  986. data/test/pgn_collection/valid/0764.pgn +21 -0
  987. data/test/pgn_collection/valid/0765.pgn +21 -0
  988. data/test/pgn_collection/valid/0766.pgn +15 -0
  989. data/test/pgn_collection/valid/0767.pgn +25 -0
  990. data/test/pgn_collection/valid/0768.pgn +15 -0
  991. data/test/pgn_collection/valid/0769.pgn +20 -0
  992. data/test/pgn_collection/valid/0770.pgn +21 -0
  993. data/test/pgn_collection/valid/0771.pgn +22 -0
  994. data/test/pgn_collection/valid/0772.pgn +16 -0
  995. data/test/pgn_collection/valid/0773.pgn +24 -0
  996. data/test/pgn_collection/valid/0774.pgn +27 -0
  997. data/test/pgn_collection/valid/0775.pgn +14 -0
  998. data/test/pgn_collection/valid/0776.pgn +25 -0
  999. data/test/pgn_collection/valid/0777.pgn +20 -0
  1000. data/test/pgn_collection/valid/0778.pgn +13 -0
  1001. data/test/pgn_collection/valid/0779.pgn +20 -0
  1002. data/test/pgn_collection/valid/0780.pgn +26 -0
  1003. data/test/pgn_collection/valid/0781.pgn +22 -0
  1004. data/test/pgn_collection/valid/0782.pgn +20 -0
  1005. data/test/pgn_collection/valid/0783.pgn +21 -0
  1006. data/test/pgn_collection/valid/0784.pgn +21 -0
  1007. data/test/pgn_collection/valid/0785.pgn +19 -0
  1008. data/test/pgn_collection/valid/0786.pgn +20 -0
  1009. data/test/pgn_collection/valid/0787.pgn +21 -0
  1010. data/test/pgn_collection/valid/0788.pgn +22 -0
  1011. data/test/pgn_collection/valid/0789.pgn +21 -0
  1012. data/test/pgn_collection/valid/0790.pgn +16 -0
  1013. data/test/pgn_collection/valid/0791.pgn +13 -0
  1014. data/test/pgn_collection/valid/0792.pgn +14 -0
  1015. data/test/pgn_collection/valid/0793.pgn +18 -0
  1016. data/test/pgn_collection/valid/0794.pgn +14 -0
  1017. data/test/pgn_collection/valid/0795.pgn +23 -0
  1018. data/test/pgn_collection/valid/0796.pgn +17 -0
  1019. data/test/pgn_collection/valid/0797.pgn +24 -0
  1020. data/test/pgn_collection/valid/0798.pgn +19 -0
  1021. data/test/pgn_collection/valid/0799.pgn +20 -0
  1022. data/test/pgn_collection/valid/0800.pgn +12 -0
  1023. data/test/pgn_collection/valid/0801.pgn +18 -0
  1024. data/test/pgn_collection/valid/0802.pgn +24 -0
  1025. data/test/pgn_collection/valid/0803.pgn +16 -0
  1026. data/test/pgn_collection/valid/0804.pgn +22 -0
  1027. data/test/pgn_collection/valid/0805.pgn +15 -0
  1028. data/test/pgn_collection/valid/0806.pgn +21 -0
  1029. data/test/pgn_collection/valid/0807.pgn +16 -0
  1030. data/test/pgn_collection/valid/0808.pgn +21 -0
  1031. data/test/pgn_collection/valid/0809.pgn +16 -0
  1032. data/test/pgn_collection/valid/0810.pgn +16 -0
  1033. data/test/pgn_collection/valid/0811.pgn +14 -0
  1034. data/test/pgn_collection/valid/0812.pgn +16 -0
  1035. data/test/pgn_collection/valid/0813.pgn +21 -0
  1036. data/test/pgn_collection/valid/0814.pgn +21 -0
  1037. data/test/pgn_collection/valid/0815.pgn +20 -0
  1038. data/test/pgn_collection/valid/0816.pgn +13 -0
  1039. data/test/pgn_collection/valid/0817.pgn +19 -0
  1040. data/test/pgn_collection/valid/0818.pgn +12 -0
  1041. data/test/pgn_collection/valid/0819.pgn +15 -0
  1042. data/test/pgn_collection/valid/0820.pgn +27 -0
  1043. data/test/pgn_collection/valid/0821.pgn +20 -0
  1044. data/test/pgn_collection/valid/0822.pgn +25 -0
  1045. data/test/pgn_collection/valid/0823.pgn +22 -0
  1046. data/test/pgn_collection/valid/0824.pgn +16 -0
  1047. data/test/pgn_collection/valid/0825.pgn +19 -0
  1048. data/test/pgn_collection/valid/0826.pgn +18 -0
  1049. data/test/pgn_collection/valid/0827.pgn +19 -0
  1050. data/test/pgn_collection/valid/0828.pgn +12 -0
  1051. data/test/pgn_collection/valid/0829.pgn +15 -0
  1052. data/test/pgn_collection/valid/0830.pgn +16 -0
  1053. data/test/pgn_collection/valid/0831.pgn +19 -0
  1054. data/test/pgn_collection/valid/0832.pgn +23 -0
  1055. data/test/pgn_collection/valid/0833.pgn +23 -0
  1056. data/test/pgn_collection/valid/0834.pgn +19 -0
  1057. data/test/pgn_collection/valid/0835.pgn +18 -0
  1058. data/test/pgn_collection/valid/0836.pgn +16 -0
  1059. data/test/pgn_collection/valid/0837.pgn +15 -0
  1060. data/test/pgn_collection/valid/0838.pgn +21 -0
  1061. data/test/pgn_collection/valid/0839.pgn +17 -0
  1062. data/test/pgn_collection/valid/0840.pgn +17 -0
  1063. data/test/pgn_collection/valid/0841.pgn +20 -0
  1064. data/test/pgn_collection/valid/0842.pgn +29 -0
  1065. data/test/pgn_collection/valid/0843.pgn +18 -0
  1066. data/test/pgn_collection/valid/0844.pgn +20 -0
  1067. data/test/pgn_collection/valid/0845.pgn +23 -0
  1068. data/test/pgn_collection/valid/0846.pgn +23 -0
  1069. data/test/pgn_collection/valid/0847.pgn +17 -0
  1070. data/test/pgn_collection/valid/0848.pgn +16 -0
  1071. data/test/pgn_collection/valid/0849.pgn +18 -0
  1072. data/test/pgn_collection/valid/0850.pgn +16 -0
  1073. data/test/pgn_collection/valid/0851.pgn +23 -0
  1074. data/test/pgn_collection/valid/0852.pgn +18 -0
  1075. data/test/pgn_collection/valid/0853.pgn +15 -0
  1076. data/test/pgn_collection/valid/0854.pgn +21 -0
  1077. data/test/pgn_collection/valid/0855.pgn +15 -0
  1078. data/test/pgn_collection/valid/0856.pgn +23 -0
  1079. data/test/pgn_collection/valid/0857.pgn +21 -0
  1080. data/test/pgn_collection/valid/0858.pgn +14 -0
  1081. data/test/pgn_collection/valid/0859.pgn +26 -0
  1082. data/test/pgn_collection/valid/0860.pgn +22 -0
  1083. data/test/pgn_collection/valid/0861.pgn +14 -0
  1084. data/test/pgn_collection/valid/0862.pgn +21 -0
  1085. data/test/pgn_collection/valid/0863.pgn +20 -0
  1086. data/test/pgn_collection/valid/0864.pgn +25 -0
  1087. data/test/pgn_collection/valid/0865.pgn +22 -0
  1088. data/test/pgn_collection/valid/0866.pgn +24 -0
  1089. data/test/pgn_collection/valid/0867.pgn +17 -0
  1090. data/test/pgn_collection/valid/0868.pgn +25 -0
  1091. data/test/pgn_collection/valid/0869.pgn +19 -0
  1092. data/test/pgn_collection/valid/0870.pgn +17 -0
  1093. data/test/pgn_collection/valid/0871.pgn +23 -0
  1094. data/test/pgn_collection/valid/0872.pgn +14 -0
  1095. data/test/pgn_collection/valid/0873.pgn +18 -0
  1096. data/test/pgn_collection/valid/0874.pgn +20 -0
  1097. data/test/pgn_collection/valid/0875.pgn +13 -0
  1098. data/test/pgn_collection/valid/0876.pgn +23 -0
  1099. data/test/pgn_collection/valid/0877.pgn +17 -0
  1100. data/test/pgn_collection/valid/0878.pgn +16 -0
  1101. data/test/pgn_collection/valid/0879.pgn +25 -0
  1102. data/test/pgn_collection/valid/0880.pgn +15 -0
  1103. data/test/pgn_collection/valid/0881.pgn +21 -0
  1104. data/test/pgn_collection/valid/0882.pgn +17 -0
  1105. data/test/pgn_collection/valid/0883.pgn +14 -0
  1106. data/test/pgn_collection/valid/0884.pgn +17 -0
  1107. data/test/pgn_collection/valid/0885.pgn +22 -0
  1108. data/test/pgn_collection/valid/0886.pgn +18 -0
  1109. data/test/pgn_collection/valid/0887.pgn +16 -0
  1110. data/test/pgn_collection/valid/0888.pgn +27 -0
  1111. data/test/pgn_collection/valid/0889.pgn +39 -0
  1112. data/test/pgn_collection/valid/0890.pgn +18 -0
  1113. data/test/pgn_collection/valid/0891.pgn +17 -0
  1114. data/test/pgn_collection/valid/0892.pgn +18 -0
  1115. data/test/pgn_collection/valid/0893.pgn +18 -0
  1116. data/test/pgn_collection/valid/0894.pgn +20 -0
  1117. data/test/pgn_collection/valid/0895.pgn +17 -0
  1118. data/test/pgn_collection/valid/0896.pgn +23 -0
  1119. data/test/pgn_collection/valid/0897.pgn +21 -0
  1120. data/test/pgn_collection/valid/0898.pgn +17 -0
  1121. data/test/pgn_collection/valid/0899.pgn +27 -0
  1122. data/test/pgn_collection/valid/0900.pgn +20 -0
  1123. data/test/pgn_collection/valid/0901.pgn +16 -0
  1124. data/test/pgn_collection/valid/0902.pgn +19 -0
  1125. data/test/pgn_collection/valid/0903.pgn +22 -0
  1126. data/test/pgn_collection/valid/0904.pgn +23 -0
  1127. data/test/pgn_collection/valid/0905.pgn +18 -0
  1128. data/test/pgn_collection/valid/0906.pgn +12 -0
  1129. data/test/pgn_collection/valid/0907.pgn +21 -0
  1130. data/test/pgn_collection/valid/0908.pgn +12 -0
  1131. data/test/pgn_collection/valid/0909.pgn +16 -0
  1132. data/test/pgn_collection/valid/0910.pgn +19 -0
  1133. data/test/pgn_collection/valid/0911.pgn +22 -0
  1134. data/test/pgn_collection/valid/0912.pgn +20 -0
  1135. data/test/pgn_collection/valid/0913.pgn +25 -0
  1136. data/test/pgn_collection/valid/0914.pgn +21 -0
  1137. data/test/pgn_collection/valid/0915.pgn +21 -0
  1138. data/test/pgn_collection/valid/0916.pgn +21 -0
  1139. data/test/pgn_collection/valid/0917.pgn +21 -0
  1140. data/test/pgn_collection/valid/0918.pgn +14 -0
  1141. data/test/pgn_collection/valid/0919.pgn +17 -0
  1142. data/test/pgn_collection/valid/0920.pgn +23 -0
  1143. data/test/pgn_collection/valid/0921.pgn +15 -0
  1144. data/test/pgn_collection/valid/0922.pgn +25 -0
  1145. data/test/pgn_collection/valid/0923.pgn +22 -0
  1146. data/test/pgn_collection/valid/0924.pgn +16 -0
  1147. data/test/pgn_collection/valid/0925.pgn +26 -0
  1148. data/test/pgn_collection/valid/0926.pgn +17 -0
  1149. data/test/pgn_collection/valid/0927.pgn +18 -0
  1150. data/test/pgn_collection/valid/0928.pgn +14 -0
  1151. data/test/pgn_collection/valid/0929.pgn +20 -0
  1152. data/test/pgn_collection/valid/0930.pgn +20 -0
  1153. data/test/pgn_collection/valid/0931.pgn +18 -0
  1154. data/test/pgn_collection/valid/0932.pgn +23 -0
  1155. data/test/pgn_collection/valid/0933.pgn +19 -0
  1156. data/test/pgn_collection/valid/0934.pgn +19 -0
  1157. data/test/pgn_collection/valid/0935.pgn +27 -0
  1158. data/test/pgn_collection/valid/0936.pgn +15 -0
  1159. data/test/pgn_collection/valid/0937.pgn +17 -0
  1160. data/test/pgn_collection/valid/0938.pgn +14 -0
  1161. data/test/pgn_collection/valid/0939.pgn +51 -0
  1162. data/test/pgn_collection/valid/0940.pgn +15 -0
  1163. data/test/pgn_collection/valid/0941.pgn +19 -0
  1164. data/test/pgn_collection/valid/0942.pgn +25 -0
  1165. data/test/pgn_collection/valid/0943.pgn +21 -0
  1166. data/test/pgn_collection/valid/0944.pgn +22 -0
  1167. data/test/pgn_collection/valid/0945.pgn +20 -0
  1168. data/test/pgn_collection/valid/0946.pgn +18 -0
  1169. data/test/pgn_collection/valid/0947.pgn +18 -0
  1170. data/test/pgn_collection/valid/0948.pgn +13 -0
  1171. data/test/pgn_collection/valid/0949.pgn +23 -0
  1172. data/test/pgn_collection/valid/0950.pgn +26 -0
  1173. data/test/pgn_collection/valid/0951.pgn +21 -0
  1174. data/test/pgn_collection/valid/0952.pgn +27 -0
  1175. data/test/pgn_collection/valid/0953.pgn +30 -0
  1176. data/test/pgn_collection/valid/0954.pgn +16 -0
  1177. data/test/pgn_collection/valid/0955.pgn +19 -0
  1178. data/test/pgn_collection/valid/0956.pgn +21 -0
  1179. data/test/pgn_collection/valid/0957.pgn +19 -0
  1180. data/test/pgn_collection/valid/0958.pgn +15 -0
  1181. data/test/pgn_collection/valid/0959.pgn +23 -0
  1182. data/test/pgn_collection/valid/0960.pgn +23 -0
  1183. data/test/pgn_collection/valid/0961.pgn +18 -0
  1184. data/test/pgn_collection/valid/0962.pgn +15 -0
  1185. data/test/pgn_collection/valid/0963.pgn +18 -0
  1186. data/test/pgn_collection/valid/0964.pgn +18 -0
  1187. data/test/pgn_collection/valid/0965.pgn +21 -0
  1188. data/test/pgn_collection/valid/0966.pgn +16 -0
  1189. data/test/pgn_collection/valid/0967.pgn +26 -0
  1190. data/test/pgn_collection/valid/0968.pgn +19 -0
  1191. data/test/pgn_collection/valid/0969.pgn +23 -0
  1192. data/test/pgn_collection/valid/0970.pgn +18 -0
  1193. data/test/pgn_collection/valid/0971.pgn +14 -0
  1194. data/test/pgn_collection/valid/0972.pgn +17 -0
  1195. data/test/pgn_collection/valid/0973.pgn +20 -0
  1196. data/test/pgn_collection/valid/0974.pgn +24 -0
  1197. data/test/pgn_collection/valid/0975.pgn +14 -0
  1198. data/test/pgn_collection/valid/0976.pgn +17 -0
  1199. data/test/pgn_collection/valid/0977.pgn +14 -0
  1200. data/test/pgn_collection/valid/0978.pgn +18 -0
  1201. data/test/pgn_collection/valid/0979.pgn +19 -0
  1202. data/test/pgn_collection/valid/0980.pgn +21 -0
  1203. data/test/pgn_collection/valid/0981.pgn +21 -0
  1204. data/test/pgn_collection/valid/0982.pgn +18 -0
  1205. data/test/pgn_collection/valid/0983.pgn +22 -0
  1206. data/test/pgn_collection/valid/0984.pgn +27 -0
  1207. data/test/pgn_collection/valid/0985.pgn +19 -0
  1208. data/test/pgn_collection/valid/0986.pgn +20 -0
  1209. data/test/pgn_collection/valid/0987.pgn +15 -0
  1210. data/test/pgn_collection/valid/0988.pgn +20 -0
  1211. data/test/pgn_collection/valid/0989.pgn +19 -0
  1212. data/test/pgn_collection/valid/0990.pgn +15 -0
  1213. data/test/pgn_collection/valid/0991.pgn +25 -0
  1214. data/test/pgn_collection/valid/0992.pgn +19 -0
  1215. data/test/pgn_collection/valid/0993.pgn +15 -0
  1216. data/test/pgn_collection/valid/0994.pgn +17 -0
  1217. data/test/pgn_collection/valid/0995.pgn +26 -0
  1218. data/test/pgn_collection/valid/0996.pgn +16 -0
  1219. data/test/pgn_collection/valid/0997.pgn +24 -0
  1220. data/test/pgn_collection/valid/0998.pgn +20 -0
  1221. data/test/pgn_collection/valid/0999.pgn +21 -0
  1222. data/test/pgn_collection/valid/1000.pgn +19 -0
  1223. data/test/pgn_collection/valid/checkmate/0925.pgn +26 -0
  1224. data/test/pgn_collection/valid/checkmate/checkmate.pgn +11 -0
  1225. data/test/pgn_collection/valid/checkmate/ciccio.pgn +11 -0
  1226. data/test/test_big_pgn_collection.rb +14 -0
  1227. data/test/test_checkmate.rb +22 -0
  1228. data/test/test_fifty_rule_move.rb +16 -0
  1229. data/test/test_helper.rb +13 -0
  1230. data/test/test_insufficient_material.rb +30 -0
  1231. data/test/test_pgn_collection.rb +22 -0
  1232. data/test/test_stalemate.rb +16 -0
  1233. data/test/test_threefold_repetition.rb +16 -0
  1234. metadata +2450 -12
@@ -0,0 +1,64 @@
1
+ /*
2
+ * chess - a fast library to play chess in Ruby
3
+ *
4
+ * Copyright (c) 2011-2012, Enrico Pilotto <enrico@megiston.it>
5
+ * This code is under LICENSE LGPLv3
6
+ */
7
+
8
+ #ifndef BITBOARD_H
9
+ #define BITBOARD_H
10
+
11
+ #include <stdio.h>
12
+ #include <stdint.h>
13
+
14
+ // Types
15
+ typedef uint64_t bboard;
16
+
17
+ // Useful bitboards definitions
18
+ #define EMPTY_BOARD 0x0000000000000000
19
+ #define FULL_BOARD 0xffffffffffffffff
20
+ #define NOT_FILE_A 0xfefefefefefefefe
21
+ #define NOT_FILE_AB 0xfcfcfcfcfcfcfcfc
22
+ #define NOT_FILE_H 0x7f7f7f7f7f7f7f7f
23
+ #define NOT_FILE_GH 0x3f3f3f3f3f3f3f3f
24
+ #define WHITE_SQUARES 0x55aa55aa55aa55aa
25
+ #define BLACK_SQUARES 0xaa55aa55aa55aa55
26
+
27
+ // Bitboard getters
28
+ int square (int file, int rank);
29
+ int square2 (bboard b);
30
+ void squares (bboard b, int *array, int *n);
31
+ int file (int square);
32
+ int rank (int square);
33
+ bboard get (bboard b, int square);
34
+ bboard get2 (bboard b, int file, int rank);
35
+ void print_bitboard (bboard b);
36
+ // Bitboard manipulations
37
+ bboard has_only_one_one (bboard b);
38
+ bboard only_white_squares (bboard b);
39
+ bboard only_black_squares (bboard b);
40
+ bboard mirror_horizontal (bboard b);
41
+ bboard mirror_vertical (bboard b);
42
+ bboard rotate_left (bboard b, int s);
43
+ bboard rotate_right (bboard b, int s);
44
+ bboard occluded_fill (bboard gen, bboard pro, int dir);
45
+ bboard shift_one (bboard b, int dir);
46
+ bboard sliding_attacks (bboard slider, bboard propagator, int dir);
47
+ // Pre-calculators
48
+ void precalculate_xray_attack_white_pawn (bboard xray[64]);
49
+ void precalculate_xray_attack_black_pawn (bboard xray[64]);
50
+ void precalculate_xray_knight (bboard xray[64]);
51
+ void precalculate_xray_king (bboard xray[64]);
52
+ void precalculate_all_xray ();
53
+ // XRay generators
54
+ bboard xray_white_pawn (bboard occupied_square, int square);
55
+ bboard xray_black_pawn (bboard occupied_square, int square);
56
+ bboard xray_attack_white_pawn (int square);
57
+ bboard xray_attack_black_pawn (int square);
58
+ bboard xray_rook (bboard occupied_square, int square);
59
+ bboard xray_knight (int square);
60
+ bboard xray_bishop (bboard occupied_square, int square);
61
+ bboard xray_queen (bboard occupied_square, int square);
62
+ bboard xray_king (int square);
63
+
64
+ #endif
@@ -0,0 +1,586 @@
1
+ /*
2
+ * chess - a fast library to play chess in Ruby
3
+ *
4
+ * Copyright (c) 2011-2012, Enrico Pilotto <enrico@megiston.it>
5
+ * This code is under LICENSE LGPLv3
6
+ */
7
+
8
+ #include "board.h"
9
+
10
+ void
11
+ init_board (Board *board)
12
+ {
13
+ memcpy (board->placement, "RNBQKBNRPPPPPPPP\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0pppppppprnbqkbnr", 64);
14
+ board->active_color = WHITE;
15
+ board->castling = 0x1111;
16
+ board->en_passant = -1;
17
+ board->halfmove_clock = 0;
18
+ board->fullmove_number = 1;
19
+ // initialize bitboards
20
+ board->pawns[WHITE] = 0x000000000000ff00;
21
+ board->pawns[BLACK] = 0x00ff000000000000;
22
+ board->rooks[WHITE] = 0x0000000000000081;
23
+ board->rooks[BLACK] = 0x8100000000000000;
24
+ board->knights[WHITE] = 0x0000000000000042;
25
+ board->knights[BLACK] = 0x4200000000000000;
26
+ board->bishops[WHITE] = 0x0000000000000024;
27
+ board->bishops[BLACK] = 0x2400000000000000;
28
+ board->queens[WHITE] = 0x0000000000000008;
29
+ board->queens[BLACK] = 0x0800000000000000;
30
+ board->king[WHITE] = 0x0000000000000010;
31
+ board->king[BLACK] = 0x1000000000000000;
32
+ set_occupied (board);
33
+ }
34
+
35
+ void
36
+ set_occupied (Board *board)
37
+ {
38
+ board->pieces[WHITE] = board->pawns[WHITE]
39
+ | board->rooks[WHITE]
40
+ | board->knights[WHITE]
41
+ | board->bishops[WHITE]
42
+ | board->queens[WHITE]
43
+ | board->king[WHITE];
44
+ board->pieces[BLACK] = board->pawns[BLACK]
45
+ | board->rooks[BLACK]
46
+ | board->knights[BLACK]
47
+ | board->bishops[BLACK]
48
+ | board->queens[BLACK]
49
+ | board->king[BLACK];
50
+ board->occupied = board->pieces[WHITE] | board->pieces[BLACK];
51
+ }
52
+
53
+ char*
54
+ print_board (Board *board)
55
+ {
56
+ char *s = (char *) malloc (250);
57
+ int si = 0;
58
+ int i, j;
59
+ for (i = 7; i >= 0; i--) // rank => top to bottom
60
+ {
61
+ sprintf (&s[si], "\e[37m%d\e[0m ", i + 1);
62
+ si += 11;
63
+ for (j = 0; j < 8; j++) // file => left to right
64
+ {
65
+ char piece = board->placement[8 * i + j];
66
+ sprintf (&s[si], "%c ", piece == 0 ? '.' : piece);
67
+ si += 2;
68
+ }
69
+ sprintf (&s[si], "\n");
70
+ si++;
71
+ }
72
+ sprintf (&s[si], "\e[37m a b c d e f g h\e[0m");
73
+ return s;
74
+ }
75
+
76
+ int
77
+ get_color (Board *board, int square)
78
+ {
79
+ int piece = board->placement[square];
80
+ if (piece)
81
+ if (piece < 97)
82
+ return WHITE;
83
+ else
84
+ return BLACK;
85
+ else
86
+ return -1;
87
+ }
88
+
89
+ bboard*
90
+ get_piece_bitboard (Board *board, char piece)
91
+ {
92
+ // TODO: we can avoid this swith using an array of boards, the index is the piece type
93
+ switch (piece)
94
+ {
95
+ case 'P': return &board->pawns[WHITE];
96
+ case 'p': return &board->pawns[BLACK];
97
+ case 'R': return &board->rooks[WHITE];
98
+ case 'r': return &board->rooks[BLACK];
99
+ case 'N': return &board->knights[WHITE];
100
+ case 'n': return &board->knights[BLACK];
101
+ case 'B': return &board->bishops[WHITE];
102
+ case 'b': return &board->bishops[BLACK];
103
+ case 'Q': return &board->queens[WHITE];
104
+ case 'q': return &board->queens[BLACK];
105
+ case 'K': return &board->king[WHITE];
106
+ case 'k': return &board->king[BLACK];
107
+ default: return 0;
108
+ }
109
+ }
110
+
111
+ bboard*
112
+ get_bitboard (Board *board, int square)
113
+ {
114
+ return get_piece_bitboard (board, board->placement[square]);
115
+ }
116
+
117
+ bboard
118
+ xray (Board *board, int from, bool only_attack)
119
+ {
120
+ switch (board->placement[from])
121
+ {
122
+ case 'P':
123
+ if (only_attack)
124
+ return xray_attack_white_pawn (from);
125
+ return xray_white_pawn (board->occupied, from);
126
+ case 'p':
127
+ if (only_attack)
128
+ return xray_attack_black_pawn (from);
129
+ return xray_black_pawn (board->occupied, from);
130
+ case 'R': return xray_rook (board->occupied, from);
131
+ case 'r': return xray_rook (board->occupied, from);
132
+ case 'N': return xray_knight (from);
133
+ case 'n': return xray_knight (from);
134
+ case 'B': return xray_bishop (board->occupied, from);
135
+ case 'b': return xray_bishop (board->occupied, from);
136
+ case 'Q': return xray_queen (board->occupied, from);
137
+ case 'q': return xray_queen (board->occupied, from);
138
+ case 'K': return xray_king (from);
139
+ case 'k': return xray_king (from);
140
+ default: return 0;
141
+ }
142
+ }
143
+
144
+ // All xray of color pieces
145
+ bboard
146
+ all_xray (Board *board, int color, bool only_attack)
147
+ {
148
+ int i, piece_color;
149
+ bboard x = EMPTY_BOARD; // xray for all pieces
150
+ for (i = 0; i < 64; i++)
151
+ {
152
+ piece_color = get_color (board, i);
153
+ // Calculate xray for pieces of color [c]
154
+ if (piece_color == color)
155
+ x |= xray (board, i, only_attack);
156
+ }
157
+ return x;
158
+ }
159
+
160
+ // All xray of color pieces with friends square removed
161
+ bboard
162
+ all_xray_friend (Board *board, int color, bool only_attack)
163
+ {
164
+ return all_xray (board, color, only_attack) & ~board->pieces[color];
165
+ }
166
+
167
+ void
168
+ remove_piece (Board *board, int square, Board *new_board)
169
+ {
170
+ memcpy (new_board, board, sizeof (Board));
171
+ if (board->placement[square])
172
+ {
173
+ *(get_bitboard (new_board, square)) = EMPTY_BOARD;
174
+ new_board->placement[square] = 0;
175
+ set_occupied (new_board);
176
+ }
177
+ }
178
+
179
+ // return the squares of pieces as piece that can capture in to
180
+ int
181
+ same_pieces_that_can_capture_a_square (Board *board, int color, int square, int *pieces, char piece_filter)
182
+ {
183
+ int i, index = 0;
184
+ char p;
185
+ Board new_board;
186
+ for (i = 0; i < 64; i++)
187
+ if (get_color (board, i) == color)
188
+ {
189
+ p = board->placement[i];
190
+ if ((!piece_filter || p == piece_filter) && (xray (board, i, FALSE) & (1ULL << square)))
191
+ if (try_move (board, i, square, 'Q', &new_board, 0, 0))
192
+ {
193
+ pieces[index] = i;
194
+ index++;
195
+ }
196
+ }
197
+ return index;
198
+ }
199
+
200
+ bool
201
+ capture (Board *board, int color, int square)
202
+ {
203
+ return all_xray_friend (board, color, FALSE) & (1ULL << square) ? TRUE : FALSE;
204
+ }
205
+
206
+ // If there is a piece that can capture the to square without put its king in check return true
207
+ bool
208
+ pieces_can_safe_capture (Board *board, int color, int square)
209
+ {
210
+ int pieces[16];
211
+ return same_pieces_that_can_capture_a_square (board, color, square, pieces, 0) > 0;
212
+ }
213
+
214
+ bool
215
+ king_in_check (Board *board, int color)
216
+ {
217
+ return all_xray_friend (board, !color, TRUE) & board->king[color] ? TRUE : FALSE;
218
+ }
219
+
220
+ // Assumes that king is in check
221
+ bool
222
+ king_in_checkmate (Board *board, int color)
223
+ {
224
+ int king_square = square2 (board->king[color]);
225
+ bboard king = xray_king (king_square) & ~board->pieces[color];
226
+ Board board_without_king;
227
+ remove_piece (board, king_square, &board_without_king); // King cant be auto-shielded xray
228
+ bboard attackers = all_xray (&board_without_king, !color, TRUE);
229
+ // If king can move return false
230
+ if (king & ~attackers)
231
+ return FALSE;
232
+ int pieces[16];
233
+ int n = same_pieces_that_can_capture_a_square (board, !color, king_square, pieces, 0);
234
+ if (n == 0) return FALSE;
235
+ // If king has more than 1 attacker return true
236
+ if (n > 1) return TRUE;
237
+ int attacker = pieces[0];
238
+ // Test if there is a piece that can capture the attacker without put its king in check return false
239
+ if (pieces_can_safe_capture (board, color, attacker))
240
+ return FALSE;
241
+ // Test if there is an en passant capture
242
+ if (have_en_passant2 (board, attacker))
243
+ return FALSE;
244
+ // Test if attack can be shielded
245
+ bboard slide = EMPTY_BOARD;
246
+ int i;
247
+ for (i = 0; i < 8; i++)
248
+ {
249
+ slide = sliding_attacks (1ULL << attacker, FULL_BOARD, i);
250
+ if (slide & 1ULL << king_square)
251
+ break;
252
+ }
253
+ bboard attack = xray (board, attacker, TRUE) & slide;
254
+ bboard defend = all_xray_friend (board, color, FALSE);
255
+ bboard shield = attack & defend;
256
+ if (shield)
257
+ {
258
+ int s[64];
259
+ int n;
260
+ squares (shield, s, &n);
261
+ for (i = 0; i < n; i++)
262
+ if (pieces_can_safe_capture (board, color, s[i]))
263
+ return FALSE;
264
+ }
265
+ return TRUE;
266
+ }
267
+
268
+ bool
269
+ stalemate (Board *board, int color)
270
+ {
271
+ int i, j;
272
+ int s[64];
273
+ int n;
274
+ Board new_board;
275
+ for (i = 0; i < 64; i++)
276
+ if (get_color (board, i) == color)
277
+ {
278
+ bboard b = xray (board, i, FALSE) & ~board->pieces[color];
279
+ // if piece in i can move try move it
280
+ if (b)
281
+ {
282
+ squares (b, s, &n);
283
+ for (j = 0; j < n; j++)
284
+ if (try_move (board, i, s[j], 'Q', &new_board, 0, 0))
285
+ return FALSE;
286
+ }
287
+ }
288
+ return TRUE;
289
+ }
290
+
291
+ bool
292
+ insufficient_material (Board *board)
293
+ {
294
+ if (board->queens[WHITE] || board->queens[BLACK]
295
+ || board->rooks[WHITE] || board->rooks[BLACK]
296
+ || board->pawns[WHITE] || board->pawns[BLACK])
297
+ return FALSE;
298
+ // King vs king
299
+ if (!board->bishops[WHITE] && !board->bishops[BLACK]
300
+ && !board->knights[WHITE] && !board->knights[BLACK])
301
+ return TRUE;
302
+ // King knight vs king
303
+ if (!board->bishops[WHITE] && !board->bishops[BLACK])
304
+ {
305
+ if ((has_only_one_one(board->knights[WHITE]) && !board->knights[BLACK])
306
+ || (has_only_one_one(board->knights[BLACK]) && !board->knights[WHITE]))
307
+ return TRUE;
308
+ }
309
+ // King bishops vs king bishops
310
+ if (!board->knights[WHITE] && !board->knights[BLACK])
311
+ {
312
+ if ((only_white_squares(board->bishops[WHITE]) && only_white_squares(board->bishops[BLACK]))
313
+ || (only_black_squares(board->bishops[WHITE]) && only_black_squares(board->bishops[BLACK])))
314
+ return TRUE;
315
+ }
316
+ return FALSE;
317
+ }
318
+
319
+ bool
320
+ fifty_move_rule (Board *board)
321
+ {
322
+ return board->halfmove_clock >= 50;
323
+ }
324
+
325
+ bool
326
+ pseudo_legal_move (Board *board, int from, int to)
327
+ {
328
+ // Piece in from square is the right color
329
+ if (get_color (board, from) != board->active_color)
330
+ return FALSE;
331
+ // The move is a castling
332
+ if (castling_type (board, from, to))
333
+ return TRUE;
334
+ // The move is en passant
335
+ if (have_en_passant (board, from, to))
336
+ return TRUE;
337
+ // The move is legal?
338
+ bboard x = xray (board, from, FALSE) & ~board->pieces[board->active_color];
339
+ return x & (1ULL << to) ? TRUE : FALSE;
340
+ }
341
+
342
+ void
343
+ get_coord (Board *board, char piece, const char *disambiguating, const char *to_coord, char promote_in, int *from, int *to)
344
+ {
345
+ int i, c, count = 0;
346
+ char file, rank;
347
+ bboard x;
348
+ *to = coord_to_square (to_coord);
349
+ if (!piece)
350
+ piece = 'P';
351
+ for (i = 0; i < 64; i++)
352
+ {
353
+ c = get_color (board, i);
354
+ if (c == board->active_color && piece == toupper (board->placement[i]))
355
+ {
356
+ x = xray (board, i, FALSE) & ~board->pieces[c];
357
+ if (x & 1ULL << *to || have_en_passant (board, i, *to))
358
+ {
359
+ file = square_to_file (i);
360
+ rank = square_to_rank (i);
361
+ if (!strcmp (disambiguating, "")
362
+ || disambiguating[0] == file
363
+ || disambiguating[0] == rank
364
+ || (disambiguating[0] == file && disambiguating[1] == rank))
365
+ {
366
+ Board new_board;
367
+ if (try_move (board, i, *to, promote_in, &new_board, 0, 0))
368
+ {
369
+ *from = i;
370
+ count++;
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ if (count != 1)
377
+ *from = *to = 0;
378
+ // For compatibility: if pawn capture a file disambiguating is required
379
+ else if (piece == 'P' && !strcmp (disambiguating, ""))
380
+ if (square_to_file (*from) != square_to_file (*to))
381
+ *from = *to = 0;
382
+ }
383
+
384
+ // This function do not consider castling, this is handled separately.
385
+ bool
386
+ try_move (Board *board, int from, int to, char promote_in, Board *new_board, char **move_done, char *capture)
387
+ {
388
+ memcpy (new_board, board, sizeof (Board));
389
+ *(get_bitboard (new_board, from)) ^= 1ULL << from;
390
+ *(get_bitboard (new_board, from)) ^= 1ULL << to;
391
+ if (capture)
392
+ *capture = new_board->placement[to];
393
+ int ep = have_en_passant (new_board, from, to);
394
+ if (new_board->placement[to])
395
+ *(get_bitboard (new_board, to)) ^= 1ULL << to;
396
+ // En passant check
397
+ else if (ep)
398
+ {
399
+ if (capture)
400
+ *capture = new_board->placement[ep];
401
+ *(get_bitboard (new_board, ep)) ^= 1ULL << ep;
402
+ new_board->placement[ep] = 0;
403
+ }
404
+ // Change placement
405
+ new_board->placement[to] = new_board->placement[from];
406
+ new_board->placement[from] = 0;
407
+ // Promotion check
408
+ if (require_a_promotion (new_board))
409
+ {
410
+ if (!promote (new_board, to, promote_in))
411
+ {
412
+ free (new_board);
413
+ return 0;
414
+ }
415
+ }
416
+ else
417
+ promote_in = 0;
418
+ // Set occupied pieces in new board
419
+ set_occupied (new_board);
420
+ // If king is in check can't move!
421
+ if (king_in_check (new_board, get_color (board, from)))
422
+ return FALSE;
423
+ // Get short algebraic chess notation of the move
424
+ if (move_done && capture)
425
+ *move_done = get_notation (board, from, to, *capture, ep, promote_in, 0, 0);
426
+ return TRUE;
427
+ }
428
+
429
+ char*
430
+ get_notation (Board *board, int from, int to, int capture, int ep, char promotion, int check, int checkmate)
431
+ {
432
+ // Get short algebraic chess notation
433
+ int i = 0;
434
+ char *notation = (char *) malloc (9);
435
+ char piece = toupper (board->placement[from]);
436
+ if (piece != 'P')
437
+ {
438
+ notation[i] = piece;
439
+ i++;
440
+ }
441
+ else if (capture || ep)
442
+ {
443
+ notation[i] = square_to_file (from);
444
+ i++;
445
+ }
446
+ // Disambiguating
447
+ if (piece != 'P')
448
+ {
449
+ int pieces[9];
450
+ int n = same_pieces_that_can_capture_a_square (board, board->active_color, to, pieces, board->placement[from]);
451
+ if (n > 1)
452
+ {
453
+ char from_file = square_to_file (from);
454
+ char from_rank = square_to_rank (from);
455
+ char disc_file, disc_rank;
456
+ int disc_file_added = 0;
457
+ int disc_rank_added = 0;
458
+ int j = 0;
459
+ for (j = 0; j < n; j++)
460
+ {
461
+ disc_file = square_to_file (pieces[j]);
462
+ disc_rank = square_to_rank (pieces[j]);
463
+ if (from_file != disc_file || from_rank != disc_rank)
464
+ {
465
+ if (from_file != disc_file && !disc_file_added)
466
+ {
467
+ notation[i] = from_file;
468
+ i++;
469
+ disc_file_added = 1;
470
+ }
471
+ if (from_file == disc_file && from_rank != disc_rank && !disc_rank_added)
472
+ {
473
+ notation[i] = from_rank;
474
+ i++;
475
+ disc_rank_added = 1;
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ if (capture || ep)
482
+ {
483
+ notation[i] = 'x';
484
+ i++;
485
+ }
486
+ notation[i] = square_to_file (to);
487
+ notation[i+1] = square_to_rank (to);
488
+ i += 2;
489
+ if (ep)
490
+ {
491
+ notation[i] = 'e';
492
+ notation[i+1] = 'p';
493
+ i += 2;
494
+ }
495
+ if (promotion)
496
+ {
497
+ notation[i] = '=';
498
+ notation[i+1] = promotion;
499
+ i += 2;
500
+ }
501
+ if (checkmate)
502
+ {
503
+ notation[i] = '#';
504
+ i++;
505
+ }
506
+ else if (check)
507
+ {
508
+ notation[i] = '+';
509
+ i++;
510
+ }
511
+ notation[i] = '\0';
512
+ return notation;
513
+ }
514
+
515
+ char*
516
+ to_fen (Board *board)
517
+ {
518
+ // 1. Placement
519
+ char placement[65];
520
+ int i, j, cur = 0;
521
+ char p, pp = '-';
522
+ for (i = 7; i >= 0; i--)
523
+ {
524
+ for (j = 0; j < 8; j++)
525
+ {
526
+ p = board->placement[j+i*8];
527
+ if (p == '\0' && p == pp)
528
+ {
529
+ placement[cur-1] += 1;
530
+ }
531
+ else if (p == '\0')
532
+ {
533
+ placement[cur] = '1';
534
+ cur++;
535
+ }
536
+ else
537
+ {
538
+ placement[cur] = p;
539
+ cur++;
540
+ }
541
+ pp = p;
542
+ }
543
+ if (p == '\0') pp = '-';
544
+ if (i > 0)
545
+ {
546
+ placement[cur] = '/';
547
+ cur++;
548
+ }
549
+ }
550
+ placement[cur] = '\0';
551
+
552
+ // 2. Active color
553
+ char active_color;
554
+ if (board->active_color)
555
+ active_color = 'b';
556
+ else
557
+ active_color = 'w';
558
+
559
+ // 3. Castling availability
560
+ char *castling = castling_to_s (board->castling);
561
+
562
+ // 4. En passant target square
563
+ char *ep;
564
+ if (board->en_passant >= 0)
565
+ ep = square_to_coord (board->en_passant);
566
+ else
567
+ {
568
+ ep = (char *) malloc (2);
569
+ strcpy (ep, "-");
570
+ }
571
+
572
+ // 5. Halfmove clock
573
+ // > board->halfmove_clock
574
+
575
+ // 6. Fullmove number
576
+ // > board->fullmove_number
577
+
578
+ // join all in fen string
579
+ char *fen = (char *) malloc (80);
580
+ sprintf (fen, "%s %c %s %s %d %d", placement, active_color, castling, ep, board->halfmove_clock, board->fullmove_number);
581
+
582
+ free (castling);
583
+ free (ep);
584
+
585
+ return fen;
586
+ }