My contribution to the programming contest held by the German „FreiesMagazin“ got a third place out of 13 submissions. This is quite good, considering that I only wrote a small wrapper around the generic game-tree Haskell library by Colin Adams, and hardly gave any serious thought into the problem.

All entires are available for download. I have annotated the table containing the results with the line count as given by ohcount:

W D L Points Language Code lines 1. Kroschinsky 904 242 54 2954 Python 589 2. Schulz 858 263 79 2837 Python 544 3. Breitner 837 281 82 2792 Haskell 264 4. Jackermeier 754 306 140 2568 Perl 183 5. Roth 574 338 288 2060 C++ 1731 6. Eitel 567 355 278 2056 Ruby 352 7. Reichel 342 328 530 1354 Python 266 8. Zimmermann 303 400 497 1309 Java 1070 9. Apensiv 190 353 657 923 Perl 410 10. Maraun 150 300 750 750 C++ 690 11. Golemo 131 319 750 712 Python 104 12. Ziegelwanger 120 337 743 697 C++ 868 13. Fuest 32 254 914 350 Python 645

Note that the line count for my haskell program includes the game-tree library, which I bundled in my submission. Without it, it’s 156 lines of code I had to write, which is second best in the code golf category.

If you look at the timing statistics, you will see that my program took the longest. When the contest was started, the timelimit was one minute per round – which I of course tried to use as much as possibly, by increasing the search tree depth. Later into the contest, the rules were changed to limit it to one minute for a whole game, and that long-running programs will get points deducted. I did some minor changes based on a profiling run, but did otherwise not care too much about performance. I would have tried to improve the runtime by using Haskell’s good ability for parallelization. But when I asked on what kind of machine the code will be run, but they would not tell me. They said that this is a hobby programmer’s contest where allowing for parallelization were not fair, so I did not work in that direction.

All in all it was a positive experience, showing of Haskell’s qualities as a language that you can quickly get good results with.