Knights, kings and sliders (Chess)
After the FEN, MOVES <square lists where the piece can go (ignoring checks for now): knights jump, kings step one square, rooks slide straight, bishops diagonally, queens both, stopping at the first piece (capturing it if it is an enemy). Print <square: <targets sorted by file then rank, or (none); an empty square prints no piece on <square, a pawn <square: pawns come in stage 3, a bad square bad square.
Input: A FEN line, then MOVES lines.
Output: One line per query.
Difficulty: Medium. Write your answer in the browser editor, run the examples, then submit it against hidden tests. Python and JavaScript are free; other languages are part of licode Club.
Hint
- Sliding pieces: walk each direction until the edge or a piece.