AttoChess: A Complete Playable Chess Program in Just 278 Bytes for DOS

AttoChess, a complete, playable chess program for 16-bit x86 DOS in 278 bytes

I present AttoChess, a fully functional chess engine for 16-bit x86 DOS that fits into a mere 278 bytes, breaking the previous record. This program draws the board, accepts keyboard moves, and searches four plies deep using optimized assembly techniques. Building on the legacy of LeanChess and BootChess, I achieved this by eliminating render buffers and folding arithmetic constants directly into memory addresses.

AttoChess is not a byte-count stunt that only sets up a board. It boots, draws the position, reads your move from the keyboard, searches with real 4-ply recursion, replies with a legal move, and loops.
  1. vunderba

    It seems like it’s partially based on LeanChess [1], which is 288 bytes long. I’d be curious to know whether this program was AI-assisted or written entirely from scratch, since Lean Chess was written at a time predating the era of LLMs.

    Another thing that amuses me is that these tiny programs often claim to be “complete” chess engines while not actually implementing all the rules. This one doesn’t appear to support en passant, and likely doesn't have pawn promotion either.

    If you’re allowed to arbitrarily redefine the scope of chess, then code size stops being as impressive a metric.

    [1] - https://leanchess.github.io

  2. jcoder

    > Moves are trusted

    Indeed, you can just play e1e8 and capture the opponents king (which doesn’t end the game). It’s a digital chessboard, not a chess engine.

  3. semitones

    I was able to capture the opponent's pawn on H4 by moving my pawn from H2 to H4. Huge and unacceptable bug, this is a joke.

More from this day

2026-07-16