DEV Community

Charles
Charles

Posted on

Donkey.bas Is 45 Years Old — The 131 Lines of Code That Launched PC Gaming

On August 14, 2026, a project hit 250 points on Hacker News that sent a wave of nostalgia through the developer community: Donkey.bas, the game that shipped with the original IBM PC in 1981, turned 45 years old. A new browser port at donkeybas.com lets you play the original game in its full CGA-era glory — and it's a fascinating look at how far we've come.

The Game That Started It All

Donkey.bas was written in 1981 by Bill Gates (yes, that Bill Gates) and Neil Konzen. It shipped with early IBM PC DOS as a demonstration of what the new BASICA interpreter could do with color graphics and sound. Version 1.10 followed in 1982.

The gameplay is almost absurdly simple by today's standards: you control a car that switches between two lanes, and you have to avoid hitting a donkey on the road. That's it. Space or tap to switch lanes. Hit the donkey and you get a "BOOM" — game over.

But in 1981, this was revolutionary. The IBM PC had just launched, and most people had never seen a computer generate real-time color graphics. Donkey.bas was proof that this new machine could be a gaming platform, not just a business tool.

131 Lines of Glory

The remarkable thing about Donkey.bas isn't just its historical significance — it's its size. The entire game, including graphics rendering, collision detection, sound effects, and game loop, fits in 131 lines of BASIC code.

Let that sink in for a moment. A complete, playable game in 131 lines. Modern game engines like Unity or Unreal produce gigabytes of project files for a basic 2D game. Even a minimal HTML5 Canvas game typically runs to several hundred lines of JavaScript with dependencies.

The original source code is available on GitHub, and it's worth reading for any developer who wants to understand how things used to be done — and how much we've abstracted away.

What Donkey.bas Taught a Generation

For many developers of a certain age, Donkey.bas (or games like it) was their first exposure to programming. The game shipped with the computer, the source code was right there in BASIC, and you could:

  1. Read the entire program in a single sitting
  2. Modify it to change the donkey to a different character
  3. Add features like multiple donkeys or speed changes
  4. Understand every line because BASIC was designed to be readable

This was programming at its most accessible. No build systems. No package managers. No framework dependencies. Just a text file and an interpreter.

The Browser Port: Preservation Through Play

The donkeybas.com port is a loving recreation that runs the original gameplay in JavaScript. It includes:

  • CRT mode — simulates the scanline effect of a 1981 monitor
  • Sound toggle — for the original beeper sound effects
  • Cheat mode — because some things never change
  • Fullscreen — for the authentic experience

The port takes "some liberties" according to the site, but it faithfully recreates the CGA graphics and gameplay feel. The fact that a 131-line BASIC program from 1981 can be recreated in a browser tab in 2026 is a testament to how fundamental the concepts are.

The Evolution of Game Development

Looking at Donkey.bas in 2026, the contrast with modern game development is stark:

Aspect Donkey.bas (1981) Modern Indie Game (2026)
Code size 131 lines 10,000+ lines minimum
Language BASIC C++, C#, Rust, or JS
Graphics CGA (4 colors) 4K HDR
Sound PC speaker beeps Full audio engines
Distribution Floppy disk with PC Steam, itch.io, app stores
Development time Days Months to years
Team size 2 people 1-50+ people

And yet... the fundamental game loop is the same. Read input, update state, check collisions, render. Donkey.bas does exactly what a modern game engine does, just at a different scale.

What We Lost

There's something bittersweet about looking at Donkey.bas from 2026. We gained incredible tools, stunning graphics, and complex gameplay mechanics. But we lost something too:

  • Accessibility — you can't read and understand a modern game's source code in an afternoon
  • Simplicity — there's no modern equivalent of "131 lines and you have a game"
  • Transparency — every part of Donkey.bas is visible and modifiable; modern games are black boxes
  • Connection — the person who wrote the code and the person who played the game were in the same room, often the same person

Why This Matters in 2026

In an era of AI-generated code, 10,000-line React components, and dependency trees that look like the Mandelbrot set, Donkey.bas is a reminder that the most important code is code you can understand. Bill Gates and Neil Konzen didn't need a framework. They didn't need a build system. They had an idea, 131 lines of BASIC, and a machine that could display four colors.

The Hacker News thread is full of developers sharing their own stories of typing in game listings from magazines, modifying Donkey.bas to change the donkey into other characters, and learning to program by reading the only source code they had access to. It's a shared cultural experience that modern developers will never have — not because the tools are worse, but because the barrier to understanding has gotten so much higher.

Happy 45th birthday, Donkey.bas. You may be 131 lines of ancient BASIC, but you started something that's still going strong.


Play the original Donkey.bas at donkeybas.com. Original source code available on GitHub.

Top comments (0)