This library was originally created for Kifu for JS which is a viewer of Kifus. This is why there are not exhaustive checks which would be needed for usages like UIs which allows inputs of moves.
Current status
Currently it checks legality in the following points:
[x] Turn is correct
[x] The move according to the type of piece is correct
(2018-02-24) Following checked were added
[x] Nifu (2 FU in the same column)
[x] Piece which can never move (行きどころのない駒)
The needs
It's not difficult to imagine some usages like to provide UI for playing Shogi. For such case we don't want allow users to input illegal moves.
Let's consider adding some more checks which would make sense:
[ ] checkmate by FU drop (打ち歩詰め)
[ ] Sennichite (千日手): same position appeared 4 times
[ ] Check Sennichite (王手千日手): same position appeared 4 times while one continuously check to the other
[ ] not avoiding check (王手無視)
There should be needs to handle illegal moves. Consider an option to accept such moves other than only throwing exceptions.
Background
This library was originally created for Kifu for JS which is a viewer of Kifus. This is why there are not exhaustive checks which would be needed for usages like UIs which allows inputs of moves.
Current status
Currently it checks legality in the following points:
(2018-02-24) Following checked were added
The needs
It's not difficult to imagine some usages like to provide UI for playing Shogi. For such case we don't want allow users to input illegal moves.
Let's consider adding some more checks which would make sense:
There should be needs to handle illegal moves. Consider an option to accept such moves other than only throwing exceptions.