Typre

Chess typing practice

A chess board where you never touch the mouse. To move a piece you type a valid command in the programming language you are practising — so a game of chess doubles as a typing drill on the syntax you actually write.

Play chess by typing

How a move is written

Pick a language, then type the move as a command in it. In JavaScript a pawn from e2 to e4 is:

board.move('e2', 'e4');

Castling is written as the king moving two squares — e1 to g1 for kingside — because there is no separate castle command; the engine recognises it and records it as O-O. Promotion takes a third argument naming the piece: q, r, b or n.

board.move('e1', 'g1');
board.move('e7', 'e8', 'q');

The same move in all 14 languages

Pawn e2 to e4, written the way each language would actually write it:

JavaScriptboard.move('e2', 'e4');
TypeScriptboard.move({ from: 'e2', to: 'e4' });
C#board.Move("e2", "e4");
Pythonboard.move("e2", "e4")
Javaboard.makeMove(new Move("e2", "e4"));
Goboard.Move("e2", "e4")
SQLUPDATE board SET pos = 'e4' WHERE piece = 'e2';
Bashchess --from e2 --to e4
C and C++board.move(Square::E2, Square::E4);
Rustboard.move_piece(Square::E2, Square::E4);
HTML<move from="e2" to="e4" />
CSSpiece[from="e2"] { to: e4; }
JSON{"from":"e2","to":"e4"}
special characterse2->e4

Why the syntax is checked strictly

Every language keeps its own rules, so the command is only accepted if it would compile. C# and Java reject 'e2' because single quotes mean a char, not a string. SQL rejects "e2" because double quotes mean an identifier. JSON only allows ". Go also accepts backticks. Semicolons are required where the language requires them and optional where it does not.

Who you play

Play a bot at three strengths, a friend on the same keyboard, or someone online. Online games are rated with standard ELO and need an account; everything else works signed out. Each side gets 15 minutes, or you can turn the clock off.

Practice the same languages without the board