Permalink
Browse files

Initial GIT conversion

  • Loading branch information...
albertoruibal committed Jun 1, 2012
0 parents commit a77b658fad835d9aa60f09845401a43a4a005161
Showing with 127,911 additions and 0 deletions.
  1. +94 −0 README
  2. +176 −0 applet/src/main/java/com/alonsoruibal/chess/applet/BoardJPanel.java
  3. +348 −0 applet/src/main/java/com/alonsoruibal/chess/applet/ChessApplet.java
  4. +49 −0 applet/src/main/java/com/alonsoruibal/chess/applet/PgnDialog.java
  5. +42 −0 applet/src/main/java/com/alonsoruibal/chess/applet/PieceJLabel.java
  6. +73 −0 applet/src/main/java/com/alonsoruibal/chess/applet/SquareJPanel.java
  7. BIN applet/src/main/resources/berlin.png
  8. BIN applet/src/main/resources/blue.png
  9. BIN applet/src/main/resources/brown.png
  10. BIN applet/src/main/resources/gray.png
  11. BIN applet/src/main/resources/jumbo.png
  12. BIN applet/src/main/resources/leipzig.png
  13. BIN applet/src/main/resources/marble.png
  14. BIN applet/src/main/resources/merida.png
  15. BIN applet/src/main/resources/staunton.png
  16. BIN applet/src/main/resources/wood.png
  17. BIN carballo.png
  18. +862 −0 core/src/main/java/com/alonsoruibal/chess/Board.java
  19. +406 −0 core/src/main/java/com/alonsoruibal/chess/Config.java
  20. +398 −0 core/src/main/java/com/alonsoruibal/chess/Move.java
  21. +343 −0 core/src/main/java/com/alonsoruibal/chess/bitboard/BitboardAttacks.java
  22. +271 −0 core/src/main/java/com/alonsoruibal/chess/bitboard/BitboardUtils.java
  23. +15 −0 core/src/main/java/com/alonsoruibal/chess/book/Book.java
  24. +540 −0 core/src/main/java/com/alonsoruibal/chess/evaluation/CompleteEvaluator.java
  25. +25 −0 core/src/main/java/com/alonsoruibal/chess/evaluation/Evaluator.java
  26. +717 −0 core/src/main/java/com/alonsoruibal/chess/evaluation/ExperimentalEvaluator.java
  27. +165 −0 core/src/main/java/com/alonsoruibal/chess/evaluation/SimplifiedEvaluator.java
  28. +77 −0 core/src/main/java/com/alonsoruibal/chess/hash/ZobristKey.java
  29. +274 −0 core/src/main/java/com/alonsoruibal/chess/hash/ZobristKeyFen.java
  30. +39 −0 core/src/main/java/com/alonsoruibal/chess/log/Logger.java
  31. +23 −0 core/src/main/java/com/alonsoruibal/chess/movegen/LegalMoveGenerator.java
  32. +132 −0 core/src/main/java/com/alonsoruibal/chess/movegen/MagicMoveGenerator.java
  33. +15 −0 core/src/main/java/com/alonsoruibal/chess/movegen/MoveGenerator.java
  34. +418 −0 core/src/main/java/com/alonsoruibal/chess/movesort/MoveIterator.java
  35. +64 −0 core/src/main/java/com/alonsoruibal/chess/movesort/SortInfo.java
  36. +992 −0 core/src/main/java/com/alonsoruibal/chess/search/SearchEngine.java
  37. +9 −0 core/src/main/java/com/alonsoruibal/chess/search/SearchObserver.java
  38. +122 −0 core/src/main/java/com/alonsoruibal/chess/search/SearchParameters.java
  39. +244 −0 core/src/main/java/com/alonsoruibal/chess/search/SearchStatusInfo.java
  40. +7 −0 core/src/main/java/com/alonsoruibal/chess/search/TimeExceedException.java
  41. +141 −0 core/src/main/java/com/alonsoruibal/chess/tt/MultiprobeTranspositionTable.java
  42. +145 −0 core/src/main/java/com/alonsoruibal/chess/tt/MultiprobeTranspositionTableNew.java
  43. +47 −0 core/src/main/java/com/alonsoruibal/chess/tt/TranspositionTable.java
  44. +123 −0 core/src/main/java/com/alonsoruibal/chess/tt/TwoTierTranspositionTable.java
  45. +1 −0 csharp/.gitignore
  46. +20 −0 csharp/Carballo.sln
  47. +18 −0 csharp/Carballo.userprefs
  48. +1 −0 csharp/Carballo/.gitignore
  49. +186 −0 csharp/Carballo/Carballo.csproj
  50. +512 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Bitboard/BitboardAttacks.cs
  51. +365 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Bitboard/BitboardUtils.cs
  52. +1,386 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Board.cs
  53. +16 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Book/Book.cs
  54. +549 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Config.cs
  55. +734 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Evaluation/CompleteEvaluator.cs
  56. +33 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Evaluation/Evaluator.cs
  57. +1,113 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Evaluation/ExperimentalEvaluator.cs
  58. +1,105 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Evaluation/ExperimentalEvaluatorNew.cs
  59. +216 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Evaluation/SimplifiedEvaluator.cs
  60. +541 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Hash/ZobristKey.cs
  61. +592 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Hash/ZobristKeyFen.cs
  62. +60 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Log/Logger.cs
  63. +602 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Move.cs
  64. +28 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Movegen/LegalMoveGenerator.cs
  65. +228 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Movegen/MagicMoveGenerator.cs
  66. +15 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Movegen/MoveGenerator.cs
  67. +683 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Movesort/MoveIterator.cs
  68. +76 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Movesort/SortInfo.cs
  69. +1,237 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Search/SearchEngine.cs
  70. +15 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Search/SearchObserver.cs
  71. +195 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Search/SearchParameters.cs
  72. +355 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Search/SearchStatusInfo.cs
  73. +15 −0 csharp/Carballo/Com/Alonsoruibal/Chess/Search/TimeExceedException.cs
  74. +167 −0 csharp/Carballo/Com/Alonsoruibal/Chess/TT/MultiprobeTranspositionTable.cs
  75. +175 −0 csharp/Carballo/Com/Alonsoruibal/Chess/TT/MultiprobeTranspositionTableNew.cs
  76. +66 −0 csharp/Carballo/Com/Alonsoruibal/Chess/TT/TranspositionTable.cs
  77. +140 −0 csharp/Carballo/Com/Alonsoruibal/Chess/TT/TwoTierTranspositionTable.cs
  78. +21 −0 csharp/Carballo/Main.cs
  79. +89 −0 csharp/Carballo/Sharpen/AList.cs
  80. +97 −0 csharp/Carballo/Sharpen/AbstractCollection.cs
  81. +169 −0 csharp/Carballo/Sharpen/AbstractList.cs
  82. +158 −0 csharp/Carballo/Sharpen/AbstractMap.cs
  83. +41 −0 csharp/Carballo/Sharpen/AbstractSet.cs
  84. +12 −0 csharp/Carballo/Sharpen/AccessController.cs
  85. +74 −0 csharp/Carballo/Sharpen/Arrays.cs
  86. +54 −0 csharp/Carballo/Sharpen/AtomicBoolean.cs
  87. +55 −0 csharp/Carballo/Sharpen/AtomicInteger.cs
  88. +44 −0 csharp/Carballo/Sharpen/AtomicLong.cs
  89. +34 −0 csharp/Carballo/Sharpen/AtomicReference.cs
  90. +30 −0 csharp/Carballo/Sharpen/AtomicReferenceArray.cs
  91. +22 −0 csharp/Carballo/Sharpen/Authenticator.cs
  92. +61 −0 csharp/Carballo/Sharpen/BitSet.cs
  93. +20 −0 csharp/Carballo/Sharpen/BufferedInputStream.cs
  94. +18 −0 csharp/Carballo/Sharpen/BufferedOutputStream.cs
  95. +12 −0 csharp/Carballo/Sharpen/BufferedReader.cs
  96. +57 −0 csharp/Carballo/Sharpen/BufferedWriter.cs
  97. +24 −0 csharp/Carballo/Sharpen/ByteArrayInputStream.cs
  98. +38 −0 csharp/Carballo/Sharpen/ByteArrayOutputStream.cs
  99. +221 −0 csharp/Carballo/Sharpen/ByteBuffer.cs
  100. +10 −0 csharp/Carballo/Sharpen/ByteOrder.cs
  101. +72 −0 csharp/Carballo/Sharpen/CRC32.cs
  102. +7 −0 csharp/Carballo/Sharpen/Callable.cs
  103. +38 −0 csharp/Carballo/Sharpen/Channels.cs
  104. +21 −0 csharp/Carballo/Sharpen/CharBuffer.cs
  105. +30 −0 csharp/Carballo/Sharpen/CharSequence.cs
  106. +41 −0 csharp/Carballo/Sharpen/CharsetDecoder.cs
  107. +25 −0 csharp/Carballo/Sharpen/CharsetEncoder.cs
  108. +9 −0 csharp/Carballo/Sharpen/CodingErrorAction.cs
  109. +138 −0 csharp/Carballo/Sharpen/Collections.cs
  110. +124 −0 csharp/Carballo/Sharpen/ConcurrentHashMap.cs
  111. +13 −0 csharp/Carballo/Sharpen/ConcurrentMap.cs
  112. +128 −0 csharp/Carballo/Sharpen/CopyOnWriteArrayList.cs
  113. +36 −0 csharp/Carballo/Sharpen/CountDownLatch.cs
  114. +20 −0 csharp/Carballo/Sharpen/CyclicBarrier.cs
  115. +1,837 −0 csharp/Carballo/Sharpen/DataConverter.cs
  116. +39 −0 csharp/Carballo/Sharpen/DateFormat.cs
  117. +29 −0 csharp/Carballo/Sharpen/DeflaterOutputStream.cs
  118. +53 −0 csharp/Carballo/Sharpen/DigestOutputStream.cs
  119. +84 −0 csharp/Carballo/Sharpen/EnumSet.cs
  120. +20 −0 csharp/Carballo/Sharpen/EnumerableWrapper.cs
  121. +55 −0 csharp/Carballo/Sharpen/EnumeratorWrapper.cs
  122. +186 −0 csharp/Carballo/Sharpen/Exceptions.cs
  123. +9 −0 csharp/Carballo/Sharpen/Executor.cs
  124. +11 −0 csharp/Carballo/Sharpen/ExecutorService.cs
  125. +166 −0 csharp/Carballo/Sharpen/Executors.cs
  126. +794 −0 csharp/Carballo/Sharpen/Extensions.cs
  127. +108 −0 csharp/Carballo/Sharpen/FileChannel.cs
  128. +25 −0 csharp/Carballo/Sharpen/FileInputStream.cs
  129. +20 −0 csharp/Carballo/Sharpen/FileLock.cs
  130. +38 −0 csharp/Carballo/Sharpen/FileOutputStream.cs
  131. +466 −0 csharp/Carballo/Sharpen/FilePath.cs
  132. +11 −0 csharp/Carballo/Sharpen/FileReader.cs
  133. +18 −0 csharp/Carballo/Sharpen/FileWriter.cs
  134. +9 −0 csharp/Carballo/Sharpen/FilenameFilter.cs
  135. +59 −0 csharp/Carballo/Sharpen/FilterInputStream.cs
  136. +39 −0 csharp/Carballo/Sharpen/FilterOutputStream.cs
  137. +10 −0 csharp/Carballo/Sharpen/Future.cs
  138. +15 −0 csharp/Carballo/Sharpen/GZIPInputStream.cs
  139. +13 −0 csharp/Carballo/Sharpen/GZIPOutputStream.cs
  140. +186 −0 csharp/Carballo/Sharpen/HttpURLConnection.cs
  141. +33 −0 csharp/Carballo/Sharpen/InflaterInputStream.cs
  142. +48 −0 csharp/Carballo/Sharpen/InheritableThreadLocal.cs
  143. +157 −0 csharp/Carballo/Sharpen/InputStream.cs
  144. +25 −0 csharp/Carballo/Sharpen/InputStreamReader.cs
  145. +25 −0 csharp/Carballo/Sharpen/Iterable.cs
  146. +57 −0 csharp/Carballo/Sharpen/Iterator.cs
  147. +11 −0 csharp/Carballo/Sharpen/LinkageError.cs
  148. +91 −0 csharp/Carballo/Sharpen/LinkedHashMap.cs
  149. +87 −0 csharp/Carballo/Sharpen/LinkedHashSet.cs
  150. +28 −0 csharp/Carballo/Sharpen/ListIterator.cs
  151. +6 −0 csharp/Carballo/Sharpen/MappedByteBuffer.cs
  152. +83 −0 csharp/Carballo/Sharpen/Matcher.cs
  153. +103 −0 csharp/Carballo/Sharpen/MessageDigest.cs
  154. +73 −0 csharp/Carballo/Sharpen/MessageFormat.cs
  155. +25 −0 csharp/Carballo/Sharpen/ObjectInputStream.cs
  156. +20 −0 csharp/Carballo/Sharpen/ObjectOutputStream.cs
  157. +84 −0 csharp/Carballo/Sharpen/OutputStream.cs
  158. +21 −0 csharp/Carballo/Sharpen/OutputStreamWriter.cs
  159. +22 −0 csharp/Carballo/Sharpen/PasswordAuthentication.cs
  160. +43 −0 csharp/Carballo/Sharpen/Pattern.cs
  161. +173 −0 csharp/Carballo/Sharpen/PipedInputStream.cs
  162. +39 −0 csharp/Carballo/Sharpen/PipedOutputStream.cs
  163. +225 −0 csharp/Carballo/Sharpen/PrintWriter.cs
  164. +7 −0 csharp/Carballo/Sharpen/PrivilegedAction.cs
  165. +63 −0 csharp/Carballo/Sharpen/Process.cs
  166. +36 −0 csharp/Carballo/Sharpen/Proxy.cs
  167. +49 −0 csharp/Carballo/Sharpen/ProxySelector.cs
  168. +90 −0 csharp/Carballo/Sharpen/RandomAccessFile.cs
  169. +23 −0 csharp/Carballo/Sharpen/ReentrantLock.cs
  170. +13 −0 csharp/Carballo/Sharpen/Reference.cs
  171. +38 −0 csharp/Carballo/Sharpen/ReferenceQueue.cs
  172. +68 −0 csharp/Carballo/Sharpen/ResourceBundle.cs
  173. +9 −0 csharp/Carballo/Sharpen/Runnable.cs
  174. +250 −0 csharp/Carballo/Sharpen/Runtime.cs
  175. +50 −0 csharp/Carballo/Sharpen/SSLContext.cs
  176. +219 −0 csharp/Carballo/Sharpen/ScheduledThreadPoolExecutor.cs
  177. +36 −0 csharp/Carballo/Sharpen/SimpleDateFormat.cs
  178. +12 −0 csharp/Carballo/Sharpen/SingletonList.cs
  179. +39 −0 csharp/Carballo/Sharpen/SoftReference.cs
  180. +108 −0 csharp/Carballo/Sharpen/SynchronizedList.cs
  181. +188 −0 csharp/Carballo/Sharpen/Thread.cs
  182. +14 −0 csharp/Carballo/Sharpen/ThreadFactory.cs
  183. +162 −0 csharp/Carballo/Sharpen/ThreadPoolExecutor.cs
  184. +18 −0 csharp/Carballo/Sharpen/TimeUnit.cs
  185. +85 −0 csharp/Carballo/Sharpen/TreeSet.cs
  186. +34 −0 csharp/Carballo/Sharpen/TrustManager.cs
  187. +39 −0 csharp/Carballo/Sharpen/URLEncoder.cs
  188. +17 −0 csharp/Carballo/Sharpen/WeakReference.cs
  189. +133 −0 csharp/Carballo/Sharpen/WrappedSystemStream.cs
  190. +37 −0 csharp/Carballo/Sharpen/X509Certificate.cs
  191. +37 −0 csharp/Carballo/Sharpen/X509TrustManager.cs
  192. +74 −0 csharp/build.xml
  193. +4 −0 csharp/header.txt
  194. +184 −0 csharp/sharpen-all-options
  195. +15 −0 csharp/sharpen.properties
  196. +1 −0 gwt/src/main/.gitignore
  197. +313 −0 gwt/src/main/java/com/alonsoruibal/chess/bitboard/BitboardAttacks.java
  198. +34 −0 gwt/src/main/java/org/vectomatic/libgwtsvgchess.gwt.xml
  199. +482 −0 gwt/src/main/java/org/vectomatic/svg/chess/ChessBoard.java
  200. +69 −0 gwt/src/main/java/org/vectomatic/svg/chess/ChessConstants.java
  201. +58 −0 gwt/src/main/java/org/vectomatic/svg/chess/ChessConstants.properties
  202. +31 −0 gwt/src/main/java/org/vectomatic/svg/chess/ChessCss.java
  203. +41 −0 gwt/src/main/java/org/vectomatic/svg/chess/ChessMode.java
  204. +26,294 −0 gwt/src/main/java/org/vectomatic/svg/chess/JSONBook.java
  205. +473 −0 gwt/src/main/java/org/vectomatic/svg/chess/Main.java
  206. +49 −0 gwt/src/main/java/org/vectomatic/svg/chess/Main.ui.xml
  207. +7 −0 gwt/src/main/java/org/vectomatic/svg/chess/MoveListener.java
  208. +30 −0 gwt/src/main/java/org/vectomatic/svg/chess/Resources.java
  209. +27 −0 gwt/src/main/java/org/vectomatic/svg/chess/chess.css
  210. +395 −0 gwt/src/main/java/org/vectomatic/svg/chess/chess.svg
  211. +6 −0 gwt/src/main/resources/com/alonsoruibal/carballo.gwt.xml
  212. +1 −0 gwt/src/main/webapp/.gitignore
  213. +3 −0 gwt/src/main/webapp/WEB-INF/.gitignore
  214. +10 −0 gwt/src/main/webapp/WEB-INF/web.xml
  215. +9 −0 gwt/src/main/webapp/lib-gwt-svg-chess.css
  216. +12 −0 gwt/src/main/webapp/lib-gwt-svg-chess.html
  217. +340 −0 jse/src/main/java/com/alonsoruibal/chess/Pgn.java
  218. +86 −0 jse/src/main/java/com/alonsoruibal/chess/bitboard/MagicNumbersGenerator.java
  219. +125 −0 jse/src/main/java/com/alonsoruibal/chess/book/FileBook.java
  220. +38 −0 jse/src/main/java/com/alonsoruibal/chess/search/SearchEngineThreaded.java
  221. +276 −0 jse/src/main/java/com/alonsoruibal/chess/uci/Uci.java
  222. BIN jse/src/main/resources/book_small.bin
  223. +14 −0 jse/src/test/java/com/alonsoruibal/chess/ArasanTest.java
  224. +147 −0 jse/src/test/java/com/alonsoruibal/chess/BasicEloTest.java
  225. +78 −0 jse/src/test/java/com/alonsoruibal/chess/BookEvaluatorTest.java
  226. +22 −0 jse/src/test/java/com/alonsoruibal/chess/BookTest.java
  227. +11 −0 jse/src/test/java/com/alonsoruibal/chess/Bs2830Test.java
  228. +11 −0 jse/src/test/java/com/alonsoruibal/chess/Bt2450Test.java
  229. +12 −0 jse/src/test/java/com/alonsoruibal/chess/Bt2630Test.java
  230. +38 −0 jse/src/test/java/com/alonsoruibal/chess/ContemptFactorTest.java
  231. +33 −0 jse/src/test/java/com/alonsoruibal/chess/Correlation.java
  232. +54 −0 jse/src/test/java/com/alonsoruibal/chess/DrawDetectionTest.java
  233. +14 −0 jse/src/test/java/com/alonsoruibal/chess/ECMGCPTest.java
  234. +155 −0 jse/src/test/java/com/alonsoruibal/chess/EpdTest.java
  235. +71 −0 jse/src/test/java/com/alonsoruibal/chess/EvaluatorTest.java
  236. +28 −0 jse/src/test/java/com/alonsoruibal/chess/LCTIITest.java
  237. +126 −0 jse/src/test/java/com/alonsoruibal/chess/MateTest.java
  238. +106 −0 jse/src/test/java/com/alonsoruibal/chess/MoveGenerationTest.java
  239. +136 −0 jse/src/test/java/com/alonsoruibal/chess/MoveIteratorTest.java
  240. +35 −0 jse/src/test/java/com/alonsoruibal/chess/MoveTest.java
  241. +10 −0 jse/src/test/java/com/alonsoruibal/chess/MyEpdTest.java
  242. +206 −0 jse/src/test/java/com/alonsoruibal/chess/PerformanceTest.java
  243. +37 −0 jse/src/test/java/com/alonsoruibal/chess/ProblemsPgnTest.java
  244. +32 −0 jse/src/test/java/com/alonsoruibal/chess/SearchTest.java
  245. +56 −0 jse/src/test/java/com/alonsoruibal/chess/SeeTest.java
  246. +14 −0 jse/src/test/java/com/alonsoruibal/chess/SilentButDeadlyTest.java
  247. +247 −0 jse/src/test/java/com/alonsoruibal/chess/TournamentTest.java
  248. +31 −0 jse/src/test/java/com/alonsoruibal/chess/TranspositionTableTest.java
  249. +19 −0 jse/src/test/java/com/alonsoruibal/chess/WeirdErrorsTest.java
  250. +47 −0 jse/src/test/java/com/alonsoruibal/chess/WinAtChessTest.java
  251. +14 −0 jse/src/test/java/com/alonsoruibal/chess/WinningChessSacrificesAndCombinations.java
  252. +122 −0 jse/src/test/java/com/alonsoruibal/chess/ZobristKeyTest.java
  253. +417 −0 jse/src/test/resources/NoomenTestsuite2008.pgn
  254. +200 −0 jse/src/test/resources/arasan.epd
  255. +27 −0 jse/src/test/resources/bs2830.epd
  256. +30 −0 jse/src/test/resources/bt2450.epd
  257. +30 −0 jse/src/test/resources/bt2630.epd
  258. +83 −0 jse/src/test/resources/draw.pgn
  259. +183 −0 jse/src/test/resources/ecmgcp.epd
  260. +35 −0 jse/src/test/resources/lctii.epd
  261. +24 −0 jse/src/test/resources/mats.epd
  262. +40 −0 jse/src/test/resources/mgv40.epd
  263. +7 −0 jse/src/test/resources/my.epd
  264. +12 −0 jse/src/test/resources/nolot.epd
  265. +5,135 −0 jse/src/test/resources/problems_easy.pgn
  266. +28,531 −0 jse/src/test/resources/problems_hard.pgn
  267. +15,438 −0 jse/src/test/resources/problems_medium.pgn
  268. +134 −0 jse/src/test/resources/silentbutdeadly.epd
  269. +300 −0 jse/src/test/resources/wacnew.epd
  270. +1,001 −0 jse/src/test/resources/wcsac.epd
  271. +674 −0 license.txt
  272. +37 −0 pom.xml
  273. +1,643 −0 testresults/bt2630.txt
  274. +13,960 −0 testresults/winatchess.txt
94 README
@@ -0,0 +1,94 @@

Description
===========

Carballo (the galician word for Oak, well it's all about search trees) is an Open Source Java and C# chess engine hosted at <a href="http://sourceforge.net/projects/carballo/">http://sourceforge.net/projects/carballo/</a>, where you can download a UCI binary to play in interfaces like <a href="http://www.playwitharena.com">Arena</a>. Has the following features:

* Simple and clear code
* Cute drag and drop Java Applet GUI, to fit in web sites
* Includes also a great GWT interface by Lukas Laag
* Maven source code organization
* JUnit used for testing, multiple test suites provided (Perft, BT2630, LCTII, WAC, etc.)
* Based on Bitboards (not so complicated as other people say)
* State-of-the-art magic bitboard move generator (doubles the basic move generator speed!), also code for magic number generation
* PVS searcher
* Iterative deepening
* Aspiration window, moves only one border of the window if falls out
* Transposition Table (TT) with Zobrist Keys (two zobrist keys per board, to avoid collisions) and multiprobe/two tier
* Quiescent search with only good captures (according to SEE) and limited check generation
* Move sorting: two killer move slots, SEE, MVV/LVA and history heuristic
* Also Internal Iterative Deepening to improve sorting
* Fractional Extensions: check, pawn push and passed pawns, mate threat, recapture (2 = 1PLY)
* Reductions: Late Move Reductions (LMR)
* Pruning: Null Move Pruning, Static Null Move Pruning, Futility Pruning and Aggressive Futility Pruning
* Polyglot Opening Book support; in the code I include Fruit's Small Book
* FEN notation import/export support, also EPD support for testing
* Pluggable evaluator function, distinct functions provided: the Simplified Evaluator Function, other Complete and other Experimental
* Parametrizable evaluator (only for the complete &amp; experimental evaluators)
* Contempt factor
* UCI interface with lots of UCI options
* The core of the chess engine was converted to C# using Sharpen

It scores 2415 ELO points at BT2630 tests in my Core2 Duo@2.2GHz. Also solves 280 positions of the 300 WinAtChess test (5 seconds for each). His real strength is about 2100 ELO points.

It is licensed under GPLv3, and you are free to use, distribute or modify the code but I ask for a mention to the original author and/or a link to my blog.

Test Results
============

I made a Java Engines Tournament to compare Carballo against other chess engines at tournament time 5 minutes. Here are the results:

<pre> Engine Score Ol Fr Me Al Ca Cu Br Ar Ch Fr JC S-B
Engine Score Cu Ca Ol Me Ca Fr Br Ar S-B
1: Cuckoo-1.12 34,5/35 ····· 1=111 11111 11111 11111 11111 11111 11111 515,75
2: Carballo-0.7.11 23,5/35 0=000 ····· 110=0 11111 10101 1111= 01101 11111 318,00
3: OliThink-5.3.2 22,5/35 00000 001=1 ····· 00110 11101 11011 11111 11111 274,75
4: Mediocre-0.3.4 17,5/35 00000 00000 11001 ····· 11001 01011 11=11 11101 210,50
5: Carballo-0.5 15,0/35 00000 01010 00010 00110 ····· =1100 010=1 11111 184,50
6: FrankWalter-1.0.8 14,0/35 00000 0000= 00100 10100 =0011 ····· 11011 10111 158,75
7: Bremboce-0.6.2 8,0/35 00000 10010 00000 00=00 101=0 00100 ····· 00011 117,25
8: ArabianKnight-1.0.9 5,0/35 00000 00000 00000 00010 00000 01000 11100 ····· 55,50

140 games played / Tournament is finished
Name of the tournament: JavaEnginesTournament
Site/ Country: JDEDEVELOPER5, España
Level: Tournament Game in 5 Minutes
Hardware: Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz 2200 MHz with 752 MB Memory
Operating system: Microsoft Windows XP Professional Service Pack 2 (Build 2600)
</pre>

History
=======

Version 0.7: A small leap on the engine performance and a big code clean

* Integrated ROOT, PV and NULL nodes search routine
* Activated singular movement extensions and changed default singular extension margin
* Do null move only when the remaining depth is > 3 PLY
* No not overwrite the value in the TT if there is no room
* Converted code to C# using sharpen. At the moment only the core of the engine
* Solved a big bug getting the move from the transposition table
* Also found another bug on the search getting the last captured piece value
* And the complete evaluator had a bug calculating the attacks value

Version 0.6: Source code reorganization, GWT and PGN improvements, no changes on the engine code

* Code splitted in carballo-core, carballo-jse and carballo-applet
* Carballo-core is GWT-friendly
* Integrated SAN notation on Board class
* Improved PGN export with SAN notation
* Added a GWT interface based on the one by Lukas Laag (http://vectomatic.org) code

Version 0.5: Improves about 150 ELO points over Carballo 0.4

* PVS searcher: SearchEngine completely changed
* Futility pruning now works!
* New TT algorithm, now also uses TT to store evaluation values
* Bug with draw detection with 3-fold repetition
* Bug with time management on tournament, was using the opponent's time amount
* Bug with history table overflow

Version 0.4: First version integrated with Mobialia Chess

* Parametrizable evaluator
* Evaluator changes
@@ -0,0 +1,176 @@
package com.alonsoruibal.chess.applet;

import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Point;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.JLayeredPane;
import javax.swing.JPanel;


public class BoardJPanel extends JPanel implements MouseListener, MouseMotionListener
{
private static final long serialVersionUID = 1L;

JLayeredPane layeredPane;
JPanel chessBoard;
PieceJLabel chessPiece;
int xAdjustment;
int yAdjustment;
final int height = 75*8;
final int width = 75*8;
SquareJPanel originComponent;
ChessApplet chess;
String lastFen;
boolean flip;

private boolean acceptInput;

public void setAcceptInput(boolean acceptInput) {
this.acceptInput = acceptInput;
}

public BoardJPanel(ChessApplet chess)
{
Dimension d = new Dimension(width, height);

layeredPane = new JLayeredPane();
add(layeredPane);
layeredPane.setPreferredSize( d );
layeredPane.addMouseListener( this );
layeredPane.addMouseMotionListener( this );

chessBoard = new JPanel();
layeredPane.add(chessBoard, JLayeredPane.DEFAULT_LAYER);
chessBoard.setLayout( new GridLayout(8, 8) );
chessBoard.setPreferredSize(d);

for (int i = 0; i < 64; i++) chessBoard.add(new SquareJPanel(i));

chessBoard.setBounds(0, 0, width, height);
layeredPane.setBounds(0, 0, width, height);
setBounds(0, 0, width, height);

acceptInput = true;
this.chess = chess;
}

/**
* Add the selected chess piece to the drag and drop layer
*/
public void mousePressed(MouseEvent e)
{
if (!acceptInput) return;
chessPiece = null;
Component c = chessBoard.findComponentAt(e.getX(), e.getY());

if (c instanceof SquareJPanel) return;
originComponent = (SquareJPanel) c.getParent();

// TODO set legal moves

Point parentLocation = c.getParent().getLocation();
xAdjustment = parentLocation.x - e.getX();
yAdjustment = parentLocation.y - e.getY();
chessPiece = (PieceJLabel) c;
chessPiece.setLocation(e.getX() + xAdjustment, e.getY() + yAdjustment);
chessPiece.setSize(chessPiece.getWidth(), chessPiece.getHeight());
layeredPane.add(chessPiece, JLayeredPane.DRAG_LAYER);
}

/**
* Move the piece
*/
public void mouseDragged(MouseEvent me)
{
if (!acceptInput) return;
if (chessPiece == null) return;
chessPiece.setLocation(me.getX() + xAdjustment, me.getY() + yAdjustment);
}

/*
** Drop the piece back
*/
public void mouseReleased(MouseEvent e)
{
if (!acceptInput) return;
// Only if inside board
if (chessPiece == null) return;

chessPiece.setVisible(false);
Component c = chessBoard.findComponentAt(e.getX(), e.getY());
if (c == null) c = originComponent;

SquareJPanel parent;
if (c instanceof PieceJLabel) {
parent = (SquareJPanel) c.getParent();
parent.remove(0);
parent.add( chessPiece );
} else {
parent = (SquareJPanel) c;
parent.add( chessPiece );
}
chessPiece.setVisible(true);

// notifies move
chess.userMove(flip ? originComponent.getIndex() : 63-originComponent.getIndex(), flip ? parent.getIndex() : 63-parent.getIndex());
}

public void mouseClicked(MouseEvent e) {}
public void mouseMoved(MouseEvent e) {}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}

public void setFen(String fen, boolean flip, boolean redraw) {
if (fen == null) return;
this.flip = flip;
lastFen = fen;
int i = 0;
int j = 0;
while (i < fen.length()) {
char p = fen.charAt(i++);
if (p != '/') {
int number = 0;
try {
number = Integer.parseInt(String.valueOf(p));
} catch (Exception e) {}

for (int k = 0; k < (number == 0 ? 1 : number); k++) {
SquareJPanel panel = (SquareJPanel) chessBoard.getComponent(flip ? 63 - j++ : j++);
try {
PieceJLabel label = (PieceJLabel) panel.getComponent(0);
if (label.getPiece() != p || redraw) {
label.setVisible(false);
panel.remove(0);
throw new Exception();
}
} catch (Exception e) {
if (number == 0) panel.add(new PieceJLabel(p));
}
if (j>=64) {
return; // security
}
}
}
}
}

public void unhighlight() {
for (int i = 0; i< 64; i++) ((SquareJPanel) chessBoard.getComponent(i)).setHighlighted(false);
}

public void highlight(int from, int to) {
SquareJPanel squareFrom = (SquareJPanel) chessBoard.getComponent(flip ? from : 63 - from);
SquareJPanel squareTo = (SquareJPanel) chessBoard.getComponent(flip ? to : 63 - to);
squareFrom.setHighlighted(true);
squareTo.setHighlighted(true);
}

public String getLastFen() {
return lastFen;
}
}
Oops, something went wrong.

0 comments on commit a77b658

Please sign in to comment.