TL;DR
A developer produced a single polyglot file that embeds three implementations of a Snake game and runs natively on Windows, Linux and in web browsers. The file packs WinAPI, ELF and HTML5/JavaScript variants into one concatenated artifact that each platform selects and executes.
What happened
Inspired by a multi-platform C toolchain, the author set out to build a compact demo: a classic Snake game implemented so that one source file can run on Windows, x86_64 Linux and inside modern web browsers. The game preserves the same rules and controls across targets: arrow keys or WASD move the snake, Space starts, P pauses, R resets and ESC can terminate where allowed. Food items increase score (standard fruit +10 points, a 15% chance of yellow fruit worth +20), spawn and then despawn after a timer tied to the snake's speed; reaching ten eaten fruit advances to the next level and randomizes maze walls while ensuring reachable paths. The author compiled/minified separate builds — a WinAPI i686 PE, an x86_64 ELF built with clang/X11, and an HTML5/JavaScript version — then concatenated them in an order where each platform executes its intended segment. The resulting file is reported in the post with two size mentions: a downloadable copy noted as 13,772 bytes, and a final concatenated file stated as exactly 13,312 bytes.
Why it matters
- Demonstrates that a complete graphical game can be packaged to run across multiple OS environments from one file.
- Shows practical techniques for packing different binary formats and script stubs to target each platform without separate installers.
- Highlights compact size constraints and the engineering approaches needed to fit GUI implementations into a few kilobytes.
Key facts
- The project implements a Snake game with identical rules and interface on all targets.
- Controls: arrow keys or WASD to move; Space to start; P to pause; R to reset; ESC to terminate when permitted.
- Scoring: each fruit normally yields 10 points; yellow fruit spawns with 15% probability and gives 20 points.
- Fruit despawn timer scales with the snake's speed at spawn time; snake speed is proportional to its length.
- After ten fruit are eaten the game advances to the next level and randomizes wall layouts while keeping food reachable.
- Three separate implementations: an i686 Windows build using WinAPI, an x86_64 Linux build with clang/X11, and a JavaScript/HTML5 Canvas version for browsers.
- Each platform build is about 3–5 KiB when compiled or minified, according to the post.
- Windows build uses a compressing script with an unusual PE header and a decompressing stub; first-run on Windows can trigger a 0xc0000005 apphelp message that disappears after rerunning.
- Linux build is lzma-packed and uses a shell dropper to extract and execute the ELF64 segment.
- The HTML version relies on browsers ignoring benign leading garbage and uses CSS to keep that data unobtrusive; the three parts are concatenated so each platform picks the correct segment.
What to watch next
- Windows first-run behavior: executing the packaged file may show “The application was unable to start correctly (0xc0000005). Click OK to close the application.” the author says this should disappear when re-running.
- not confirmed in the source
- not confirmed in the source
Quick glossary
- Polyglot (binary): A single file that is valid and executable in multiple runtime environments or formats without modification.
- PE header: The Portable Executable header is metadata at the start of Windows binaries that describes how the OS should load the executable.
- ELF: Executable and Linkable Format, the common binary format used by Unix-like systems such as Linux for executables and shared libraries.
- LZMA: A lossless compression algorithm and format used to reduce file sizes; often used for packing executables or archives.
- HTML5 Canvas: A browser API that provides a drawable region in a web page for rendering graphics via JavaScript.
Reader FAQ
How large is the single-file game?
The post references a downloadable copy at 13,772 bytes and elsewhere states the final concatenated file is exactly 13,312 bytes.
Does the single file actually run on Windows, Linux and in browsers?
According to the post, yes: the file contains three implementations and is arranged so each platform executes its intended segment.
Are the implementations different languages or toolchains?
Yes. The Windows build targets i686 with WinAPI, the Linux build targets x86_64 with clang and X11, and the browser version is JavaScript using HTML5 Canvas.
Is macOS support included?
not confirmed in the source
Is the game's source code or build scripts provided?
not confirmed in the source

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser. 2026-01-11 :: Kamila Szewczyk #programming #polyglot #cross-platform Not that long ago I became…
Sources
- This game is a single 13 KiB file that runs on Windows, Linux and in the Browser
- Classic Snake game now playable in your browser URL …
- Snake game on the terminal
- sssnake – A Super Addictive Snake Game for Linux Terminal
Related posts
- Figma’s Hunt for the Perfect Squircle: From iOS Icons to Parametric Curves
- Engineering Schizophrenia: Applying Systems Debugging to Psychosis
- Interactive California Budget: Year-by-Year Revenue and Expenditure Projections