Support Chess960 (Fischer Random)
masterChesslib provides full support for Chess960, including move generation, validation, and FEN round-trips.
Detection and Loading
Chess960 is automatically detected when loading FENs with non-standard king positions. You can also force it explicitly:
board.loadFromFen("bnqbrnkr/pppppppp/8/8/8/8/PPPPPPPP/BNQBRNKR w KQkq - 0 1", true);UCI Notation for Chess960
Because Chess960 castling uses king-to-rook encoding, use the specialized UCI methods:
board.toUci(Move move): Converts a move to UCI string.board.fromUci(String uciString): Parses a UCI string into aMove.
Board board = new Board();
board.loadFromFen("bnqbrnkr/pppppppp/8/8/8/8/PPPPPPPP/BNQBRNKR w KQkq - 0 1");
Move oo = board.getContext().getoo(Side.WHITE);
board.toUci(oo); // "g1h1" (king→rook)
Move parsed = board.fromUci("g1h1"); // returns the O-O castle move