shubhendusaurabh / draughts.js

A Javascript draughts/checkers library for move generation/validation, piece placement/movement, and draw detection
Mozilla Public License 2.0
27 stars 11 forks source link

king can move to its own position #4

Closed petitlapin closed 7 years ago

petitlapin commented 7 years ago

For example, with B:WK1,K2,14,16,31,37,42:BK49 fen, state.moves() will return [{"jumps":[],"takes":[],"from":49,"to":49},{"jumps":[],"takes":[],"from":49,"to":44},{"jumps":[],"takes":[],"from":49,"to":49},{"jumps":[],"takes":[],"from":49,"to":43}] You can see twice the king can move to its own position. I don't think the rules allow it and I didn't found in the code where the list is generated, maybe you know how to remove them?

Thanks,

Johnny