Hello, I recently implemented Chess in Haskell. The implementation is not very efficient, but pretty straightforward from a purely functional point of view. Simple mate problems can be solved. Have a look at http://www.steffen-mazanek.de/blog/2007/02/haskell-chess.html I used this implementation for Haskell exercises and the students liked it - probably because of the fact, that it is possible to write a real Chess program in about 200 lines of code. I guess implementing such a game is a good thing in Haskell didactics, in particular the game can easily be divided in several completely independent modules (board data structure and stuff, move generator, gametree and minmax algorithm), there are quick results and the students can experiment a lot. A nice thing to tell them is the fact, that many of the implemented functions are not Chess-specific at all, in particular the generation of the gametree and the application of the minimax algorithm can be easily generalized. If somebody is interested I gladly provide the used project definition and the particular work orders (in German only). Best regards, Steffen Mazanek -- Dipl.-Inform. Steffen Mazanek Institut für Softwaretechnologie Fakultät Informatik Universität der Bundeswehr München 85577 Neubiberg Tel: +49 (0)89 6004-2505 Fax: +49 (0)89 6004-4447 E-Mail: steffen.mazanek (at) unibw.de
Hello again, I got a lot of interesting and useful comments on my posting about Haskell Chess. Somebody suggested using the program for benchmarks. Several people asked me to open the program for contributions. And others were just interested in the exercises. It is probably the best to branch the development, so that we have a teachers' and a hackers' version (ease of understanding and learning paradigms vs. efficiency and implementation of full ruleset). I will do the necessary steps next week (svn, etc). Somebody already offered help for cabalizing hsChess. Several people asked me for the exercises so I started the wiki page http://haskell.org/haskellwiki/Learning_Haskell_With_Chess on this topic. I will add more content when I am back to office. Every contribution and discussion is welcome. Best regards, Steffen Steffen Mazanek schrieb:
Hello,
I recently implemented Chess in Haskell. The implementation is not very efficient, but pretty straightforward from a purely functional point of view. Simple mate problems can be solved. Have a look at
http://www.steffen-mazanek.de/blog/2007/02/haskell-chess.html
I used this implementation for Haskell exercises and the students liked it - probably because of the fact, that it is possible to write a real Chess program in about 200 lines of code. I guess implementing such a game is a good thing in Haskell didactics, in particular the game can easily be divided in several completely independent modules (board data structure and stuff, move generator, gametree and minmax algorithm), there are quick results and the students can experiment a lot. A nice thing to tell them is the fact, that many of the implemented functions are not Chess-specific at all, in particular the generation of the gametree and the application of the minimax algorithm can be easily generalized.
If somebody is interested I gladly provide the used project definition and the particular work orders (in German only).
Best regards,
Steffen Mazanek
Didactic it may be but brute force on search trees means in Haskell problem with garbage collection. So students may build a punch but loose a street fight. Instead of using Haskell as a hammer I would rather explore what monadic programming can offer in terms of encapsulating constraints, heuristics, modal logic or agents. Chess is a human game so why not use computing along this line and employ Haskell on humane terms? The force is with us! Cheers, -Andrzej
Andrzej, I'd love to hear some of your thoughts on these things. I agree with you about brute-force not being the best approach in haskell (or maybe at all). I think we should switch to haskell-cafe, since that's where much of this discussion has gone, and that's more for extended discussions anyway. On 3/18/07, Andrzej Jaworski <himself@poczta.nom.pl> wrote:
Didactic it may be but brute force on search trees means in Haskell problem with garbage collection. So students may build a punch but loose a street fight.
Instead of using Haskell as a hammer I would rather explore what monadic programming can offer in terms of encapsulating constraints, heuristics, modal logic or agents. Chess is a human game so why not use computing along this line and employ Haskell on humane terms? The force is with us!
Cheers, -Andrzej
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
participants (3)
-
Andrew Wagner -
Andrzej Jaworski -
Steffen Mazanek