Sunday, March 08, 2009

Java checkers' first sensible game

After improving the evaluation function a bit and after adding some standard search improvements, my Java checkers engine now appears to be playing a good game. It searches 3 million positions per second on my 2GHz Core Duo laptop, and typically gets around 17 ply search depth within a few seconds (that is faster than simple checkers, and a few ply deeper than simple checkers). It can't use endgame databases (yet?!) and has no opening book, but apart from that it is "Cake light" - a simplified version of Cake, using parts of the evaluation and parts of the search strategies that Cake does - but all on a much less complex level. The code is a joy to read compared to the Cake source code :-) (and much shorter). I will still have to improve the "Javaness" of the code - coming from a procedural language, I am writing C-style code in Java...

Here is the first sensible game of the engine playing against itself - red got a winning position but then blew it. But at least this already looks like checkers to me.


[Event "test game"]
[Date "2009-03-08"]
[Black "Java Engine"]
[White "Java Engine"]
[Result "1/2-1/2"]
1. 11-15 22-18 2. 15x22 25x18 3. 8-11 29-25 4. 4-8 25-22 5. 11-16 23-19 6. 16x23 26x19 7. 9-14 18x9 8. 5x14 27-23 9. 8-11 22-18 10. 14-17 21x14 11. 10x17 24-20 12. 17-22 32-27 13. 1-5 30-26 14. 6-10 26x17 15. 10-15 19x10 16. 7x21 23-19 17. 2-7 27-24 18. 21-25 19-16 19. 12x19 24x8 20. 3x12 18-14 21. 25-30 28-24 22. 30-25 31-26 23. 25-21 26-22 24. 21-25 22-18 25. 25-22 18-15 26. 22-26 15-10 27. 5-9 10x3 28. 9x18 24-19 29. 18-22 3-7