Prompt / exact input

temp 0.7max 32768 tokensfirst response only
Build a playable chess board as one complete HTML file with inline CSS and vanilla JavaScript. No libraries, CDNs, external resources, network requests, storage, or embedded frames. It must work inside an iframe sandboxed with allow-scripts only. Return only the HTML file.

Structure requirements, followed exactly so the board can be inspected programmatically:
- Render 64 squares. Each square element must carry data-square with algebraic coordinates in lowercase, for example data-square="e4".
- Each square must also carry data-piece holding standard FEN letters for the piece currently on it: uppercase for White (K Q R B N P), lowercase for Black (k q r b n p), and an empty string for an empty square. Update this attribute whenever the position changes.
- Show whose turn it is in an element with id="turn", containing exactly the text White or Black.
- Moves are made by clicking the origin square then the destination square. Clicking an origin square with no legal moves, or making an illegal move, must leave the position and the side to move unchanged.
- Provide three buttons that load exact test positions: id="load-castling" loads r3k2r/pppppppp/8/8/8/8/PPPPPPPP/R3K2R w KQkq - 0 1, id="load-enpassant" loads 4k3/8/8/8/4Pp2/8/8/4K3 b - e3 0 1, and id="load-promotion" loads 4k3/P7/8/8/8/8/8/4K3 w - - 0 1. Loading a position must fully reset game state including move history and castling rights.

Rules that must actually work:
- Correct movement for every piece type, including blocked sliding pieces and knights jumping.
- A move that leaves your own king in check is illegal, including pinned pieces.
- Kingside and queenside castling for both colours, only when king and rook have not moved, squares between them are empty, and the king is not in check and does not pass through or land on an attacked square. Castling must move the rook too.
- En passant capture, only on the move immediately after the enemy pawn's two-square advance, removing the captured pawn from its own square.
- Pawn promotion, offering a choice of queen, rook, bishop or knight, defaulting to queen if the visitor dismisses the choice. The promotion control must be keyboard accessible.
- Detect and announce check, checkmate and stalemate in an element with id="status".

Keep the board compact enough to be visible near the top of the page without scrolling, with a legible coordinate labelling and sufficient contrast. Prioritize rule correctness over visual polish.

Pick your favorite

Model names stay hidden until you pick. Choose the output you like best, then see which model made it.

Model

Hidden

Model

Hidden

Model

Hidden

Model

Hidden

Model

Hidden

Model

Hidden