TechSpot

Coder shrinks chess game into a 487 byte program

By Scorpus
Jan 29, 2015
Post New Reply
  1. In a pretty incredible feat of coding, a programmer named Baudsurfer has managed to squeeze an entire, playable game of chess into a single 487 byte program. Unless your computer's storage drive is filled to the brim, you'll definitely be able...

    Read more
     
  2. Littleczr

    Littleczr TS Addict Posts: 439   +84

    On console you can get pretty much get anything to a really low hard drive footprint. I would use C and allot of pointers, but it is not that all impressive graphics are just useless. It would be more impressive if he used a graphic user interface. I bet you can get a chess game in too a 2.5 megabyte size.
     
  3. How big was a sector in dos? 512 bytes I think. He's got extra space for improvements :)
     
  4. cliffordcooley

    cliffordcooley TS Guardian Fighter Posts: 8,550   +2,894

    Graphics aside, the point was to get all functionality in as little space as possible.

    I know this may be irrelevant, but which command interpreter was used and how much space does its programming consume? And was the same command interpreter used back in 1983. If new interpreters was used and allowed for shortcuts that didn't exist in 1983, that wouldn't be a very fair comparison now would it.
     
  5. Minor corrections and answers to comments follow :

    "[...] into a single 487 byte program 487 bytes program." : the new record is "468" bytes after eliminating displaying rows and columns which are FIDE standards (An idea pushed by Oscar Toledo) : http://olivier.poudade.free.fr/src/BootChess.asm

    "the AI is terrible and moves pieces basically at random." : yes the AI is terrible but stating it moves pieces randomly might be exaggerated when reading the paragraph entitled "5.1 -The TaxiMax ai used" in http://lpaste.net/131646

    "Also, some rules of the game are missing: you can't castle or capture pawns en passant, you can move a king into check, and pawns can only be promoted to queens." : yes that is exact but these restrictions also apply equivalently to David Horne's original 1K ZX Chess, which incidently was the point of the exercise

    "Other tiny chess implementations include a 1 kB Javascript..." : the 1k boasted size is very misleading as javascript is not binary but interpreted language and there are software dependencies (extra megabytes of libraries) such as the ones of operating systems and browser libraries, contrary to Bootchess which doesn't require any installed Operating system

    "I know this may be irrelevant, but which command interpreter was used and how much space does its programming consume? And was the same command interpreter used back in 1983. If new interpreters was used and allowed for shortcuts that didn't exist in 1983, that wouldn't be a very fair comparison now would it." : no interpreter was used, it is hardware (PC BIOS) based only.
     

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...