3 ms·
AttoChess, a complete, playable chess program for 16-bit x86 DOS in 278 bytes
- vunderba 4mo agoIt 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 https://leanchess.github.io
- ekelsen 4mo agoYeah, I don't understand why the metric isn't "complete chess engine that achieves X ELO" in yyy bytes or something. Instead it seems to have been "minimal thing that kinda looks like chess in yyy bytes"
- taftster 4mo agoI'd suggest just ensuring that the entire rules of chess are first evaluated or supported in a chess program, before worrying about ELO rating, etc.
- applfanboysbgon 4mo ago> X ELO in yyy bytes Because then you're measuring on two axes. Which is better, 1500 elo in 300 bytes or 1550 elo in 310 bytes? For a byte count comparison to make much sense, the program really ought to have a static target criteria.
- dwheeler 4mo agoImpressive, but no castling or en passent, so it's not really chess.
- duttish 4mo agoYes I was impressed until I saw ",no castling, en passant, or promotion". I'm okay with trusting moves but not implementing all of the rules while still calling it complete feels a bit weird.
- TMWNN 4mo agoHighly relevant: Great Moments in PCMR History: A chess game published in 1982 includes a computer opponent but only uses 672 bytes of RAM. 1K ZX Chess has been described as "wizardry", "history's greatest game programming feat", and "the greatest program ever written". By comparison, this headline uses 298 bytes. <https://np.reddit.com/r/pcmasterrace/comments/3s9riy/great_moments_in_pcmr_history_a_chess_game/ https://np.reddit.com/r/pcmasterrace/comments/3s9riy/great_m...>
- semitones 4mo agoI 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.
- reilly3000 4mo agoI found some correctness issues that leave me a little unimpressed, although it’s a pretty phenomenal piece of code golf in general. For example, on my second move I mistakenly entered f1a1 instead of f1a6. It accepted this and then suddenly I had a bishop where the rook should be and no idea if my rook still exists.
- wat10000 4mo agoIt's intentionally rather limited. There's no validation of the input moves, and it leaves out some important rules. > Moves are trusted and given in plain coordinates: no click-to-move, no castling, en passant, or promotion.
- mmmattt 4mo agoKind of crazy to put “Complete” in the post’s title then.
- jcoder 4mo ago> 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.
- deleted 4mo ago[deleted]
- tzal3x 4mo agoDoesn’t work. Played p2p5 and it just accepted it.
- omoikane 4mo agoRelated, a collection of tiny chess programs by Oscar Toledo: https://nanochess.org/chess.html https://nanochess.org/chess.html
- kyledrake 4mo agopawn e2e8 checkmate Very cool this can be done in such a small amount of memory.
- GeertB 4mo agoThe program terminated just a few moves into the game when there were plenty of legal moves left. Also, it is surprisingly hard to play chess as a human when there is no checkered board.