G
Guest
Guest
Archived from groups: rec.games.chess.computer (More info?)
Hi all,
In my spare time I am picking away at the code to do a correspondence
chess website, and have been writing the move generator functions.
It would be *nice* to have javascript in the client to tell the user
*in real time* if the move they are making is allowed - but of course
this requires that I work out all the *legal* moves for all the pieces
in advance (working out the legal moves is far more expensive than just
"the moves", because you need to look for the king being checked -
which means testing each candidate position for threatened squares).
I guess what I'm saying is, if I pre-compute all the legal moves, its
going to be quite expensive - because I have to do the "check" test for
every possible move in order to whittle the moves down; whereas if the
"check" test happens after the fact, you only need to check the move
they are trying to make.
I've been talking to a colleague who's working on a chinese chess
interface, and he has similar issues but is looking at caching the
threatened square patterns in a database to ease the expense of working
them out - all in the pursuit of having real time move validation...
Has anybody else got any views on this?
Hi all,
In my spare time I am picking away at the code to do a correspondence
chess website, and have been writing the move generator functions.
It would be *nice* to have javascript in the client to tell the user
*in real time* if the move they are making is allowed - but of course
this requires that I work out all the *legal* moves for all the pieces
in advance (working out the legal moves is far more expensive than just
"the moves", because you need to look for the king being checked -
which means testing each candidate position for threatened squares).
I guess what I'm saying is, if I pre-compute all the legal moves, its
going to be quite expensive - because I have to do the "check" test for
every possible move in order to whittle the moves down; whereas if the
"check" test happens after the fact, you only need to check the move
they are trying to make.
I've been talking to a colleague who's working on a chinese chess
interface, and he has similar issues but is looking at caching the
threatened square patterns in a database to ease the expense of working
them out - all in the pursuit of having real time move validation...
Has anybody else got any views on this?