Try Bouncing Beholder, a complete platform game in just 1,024 bytes of code

A bouncing eyeball collects coins while dodging purple grass and carnivorous plants in "Bouncing Beholder" — a complete platform game with smooth animation, physics, and randomly generated terrain. The surprising part? The entire game fits in just 1,024 bytes of JavaScript code, less than the size of this post.

Developer Marijn Haverbeke used creative coding tricks to reduce the size to a single kilobyte. Rather than storing game data in variables, he used mathematical formulas — coins appear only on blocks whose height divides evenly by six, and collecting them slightly adjusts that height value. He created a system to automatically abbreviate lengthy canvas commands into single letters, squeezing every possible byte from the code.

His hand-optimized code proved so efficient that modern compression tools actually made it larger, not smaller.

"In terms of productivity, this is an awful way of coding," Haverbeke wrote. "But it certainly is fun. Not to mention that it gives me an excuse to use every kind of weird hack I can think of."

Previously:
Speech synthesizer in 1K of Javascript
1981's 1K Sinclair Chess vs a modern PC running StockFish