[Haskell-cafe] Is this related to continuations somehow?
wagner.andrew at gmail.com
Thu Feb 12 21:34:34 EST 2009
So, I was reading a bit about continuations the other day, and, since I've
been thinking about good ways of expressing chess strategies in Haskell, I
thought that I'd play around a bit with something like continuations for
game-playing strategies. The idea is that you have combinators that allow
you full access to the strategies which remain to be applied. In this way,
strategies can "activate" and "de-activate" other strategies. Here's a
simple little toy app for Tic-Tac-Toe (Naughts and Crosses):
You can run main on 'example', and see that it searches every line and
fails. And, as you can see, it aborts after finding a win in example2. This
would be easily extensible to say things like "if you've seen a blocking
move, and you don't have a win, then play the blocking move", and of course
the other deep intricacies of the game.
My question is, is this, in fact, related to continuations somehow? Could
continuations simplify it? Or am I doing something completely different?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe