♞ Chess.js Integration Demo

Robust move validation with chess.js.

🆚 Engine comparison

Before: LightRules (basic validation)

Now: Chess.js (complete validation)

✅ Checkmate detection

✅ Stalemate detection

✅ Special rules (castling, en passant)

✅ Move history tracking

✅ Full PGN import/export

Move # 1
Side to move: White

Game status:

Status: ⚡ In progress
Check: No
Legal moves: 20
Half-moves: 0
50-move rule: 100 half-moves remaining

🎯 Chess.js capabilities

  • Full validation for legal moves
  • Automatic detection for check, checkmate, and stalemate
  • Advanced rule support for castling and en passant
  • Move history kept in sync
  • FEN positions verified on load
  • 50-move counter updated live

Quick actions:

PGN export:

Move history:

Initial position