explaingit

nicholas-afk/attochess

Analysis updated 2026-05-18

13AssemblyAudience · researcherComplexity · 5/5LicenseSetup · hard

TLDR

An extremely small, fully working chess program that fits in 276 bytes, currently the record holder in a decades-long contest to build the tiniest chess engine.

Mindmap

mindmap
  root((AttoChess))
    What it does
      Tiny chess program
      276 bytes total
      Fully playable
    Tech stack
      Assembly
      x86 DOS
    Use cases
      Study code golf
      Learn record history
      Reproduce build
    Audience
      Retro computing fans
      Assembly researchers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Study extreme code size optimization techniques used in low level assembly programming.

USE CASE 2

Learn about the history and lineage of the smallest-chess-program competition.

USE CASE 3

Reproduce and verify the claimed 276 byte program size by building it from source.

What is it built with?

Assemblyx86 DOS

How does it compare?

nicholas-afk/attochesskirindenis/wire-city-2mytechnotalent/stm32f401_eeprom_driver
Stars131210
LanguageAssemblyAssemblyAssembly
Last pushed2025-11-26
MaintenanceQuiet
Setup difficultyhardmoderatehard
Complexity5/55/55/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires an x86 assembler (TASM) and a DOS environment or emulator to build and run.

Based on LeanChess and keeps its MIT license and original author's copyright intact.

In plain English

AttoChess is a complete, playable chess program written to be as small as possible. The whole program, including the logic to draw the board, read your move, and calculate a reply, fits into 276 bytes. To put that in perspective, that is smaller than this paragraph of text stored on a computer. It runs on old 16 bit DOS computers, the kind that predate modern Windows. This project is part of a long running competition among programmers to build the smallest working chess program. The README includes a table showing the history of this record, starting with a 672 byte chess game from 1982 and moving down through several increasingly tiny versions built by different people over the decades. AttoChess currently holds the record at 276 bytes, beating the previous record holder called LeanChess by 12 bytes. The author is clear that this is not just a program that draws a chessboard and stops there. It actually works: it sets up the starting position, displays it, waits for you to type a move, thinks about its own move by searching several moves ahead, plays a legal reply, and repeats this cycle. AttoChess builds directly on the ideas from LeanChess, an earlier tiny chess program by a different author, and keeps that author's original license and credit intact. The README walks through, in detail, exactly which small changes were made to shave off those 12 bytes, such as changing how the board is displayed on screen and how typed moves are converted into board positions internally. To verify the program actually is as small as claimed, the README includes the exact commands used to build it from source code and check the resulting file size, so anyone can reproduce the result themselves rather than just take the claim on faith. This project would mainly interest people curious about extreme low level programming, retro computing, or the history of tiny computer programs, rather than anyone looking for a chess program to actually play with day to day.

Copy-paste prompts

Prompt 1
Explain how AttoChess draws the chess board to the screen using so few bytes.
Prompt 2
Walk me through the history of the smallest chess program competition described in this README.
Prompt 3
Show me the build commands used to assemble AttoChess and verify its file size.
Prompt 4
Explain what makes assembly language programming for old DOS systems so size constrained.

Frequently asked questions

What is attochess?

An extremely small, fully working chess program that fits in 276 bytes, currently the record holder in a decades-long contest to build the tiniest chess engine.

What language is attochess written in?

Mainly Assembly. The stack also includes Assembly, x86 DOS.

What license does attochess use?

Based on LeanChess and keeps its MIT license and original author's copyright intact.

How hard is attochess to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is attochess for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.