A concise javascript chess engine, first written for the 5k web competition. It plays at the level of a lazy amateur, so is a good match for most opponents.
Notes
Castling is done by moving the king, rook moves automatically.
When swapping sides computer makes its move instantly (since it's its turn) so you may be disoriented at first and not notice it.