Next page | Contents page |

Detecting impossibility

Microsoft's version of Spider sometimes detects, after all cards have been dealt, that no further moves are possible. But only sometimes. The game can often end with a stalemate, by which I mean that you can move cards and move them back again but no further progress can be made.

Checking whether there is definitely no further move is quite straightforward using the code that we now have. I will leave it as an exercise to think of the algorithm and possibly to code it.

Checking for a stalemate would be much more difficult and I think it is not worth the bother, especially as it would have to be done after every move (when all cards have been dealt).

Next page | Contents page |