ajax333221 / isepic-chess

♞ JavaScript chess utility library.
MIT License
16 stars 3 forks source link

isLegalMove mismatch "to-from" in "from-to-from-to... #14

Closed ajax333221 closed 3 years ago

ajax333221 commented 3 years ago

In the FEN "r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq - 0 1", the move "f6-f3" is being validated as legal.

The recent changes to search a move in the pool of legal moves was done with indexOf(), but the pool of legal moves should have some separation between them, otherwise you run into the problem of accidentally matching a to-from in from-to-from-to.