Yes, You Can Write an Awesome Game in Just 10 Lines of Basic

An annual contest challenges programmers to create 8-bit games of intrigue and adventure

3 min read

Image of a clone of a popular 1980s arcade game.
Image: Víctor Parada

Image of a clone of a popular 1980s arcade game.Ready Player Two: This is a clone of a popular 1980s arcade game written for the Atari 800 in just 10 lines of BASIC code. Two people can play at once.Image: Víctor Parada

There’s life in the old dog yet. The original computer language designed to help students learn programming was Beginners All Purpose Symbolic Instruction Code, or BASIC. Although invented in 1964 at Dartmouth College in New Hampshire, BASIC had its heyday in the 1980s, when it was hardwired into the microcomputers finding their way into people’s homes by the million. Then it became unfashionable, derided for its limitations—and now languages like MIT’s Scratch are the go-tos for teaching children. But, as the April winners of the annual BASIC 10 Liner Contest show, in the right hands the language can still be a remarkably expressive tool.

The goal of the contest is to write a complete computer game in—as the name suggests—just 10 lines of BASIC. The contest is the brainchild of Gunnar Kanold, a teacher of science, chemistry, physics, mathematics, and IT at a secondary school in Friedrichstadt, Germany. According to Kanold in an email interview, the contest started in 2011 as “party fun at a small weekend meeting” that focused on writing games for Atari computers. There was no competition in 2012, but after that the contest began gathering steam, expanding to include other 8-bit systems and accept entries over the Internet: Kanold says he has had submissions from more than 20 countries, with 2019 marking the debut of Colombia and Ukraine.

Submissions are judged by a panel and fall into three categories: PUR-80, PUR-120, and EXTREM-256, which refer to game programs with maximum line lengths of 80, 120, and 256 characters, respectively. (There’s also a Wild category for entries that aren’t games, or that break the line limit.) In addition, you cannot load anything from storage, and no machine code is permitted. Because of the difficulty in running a smorgasbord of programs on their original target hardware—some 25 different systems over the years—a system emulator that can run on modern computers must be available.

Contestants have done amazing things within these limits, squeezing multiple commands into single lines, using abbreviations where supported, and playing operating systems like a banjo. “Every year there are programs that leave one’s mouth open,” says Kanold. Some of his favorites from recent years include Where’s My Cheese? by Victor Parada, a maze game for the Atari 800 that lets players explore 3D mazes from a first-person point of view; Cave Adventure, a bijou text adventure for the ZX81 (accomplished despite the fact that “the ZX81 allows only one command per line!” marvels Kanold); andMini Bros, an Atari 800 clone of the 1983 Nintendo arcade gameMario Bros., and the 2019 winner in the EXTREM-256 category.

Games may seem a trivial object of such programming efforts, but the competition is in the spirit of the original BASIC project at Dartmouth, which encouraged the writing and playing of computer games as a way to bridge the liberal arts/engineering divide, and indirectly led to influential programming books such as David H. Ahl’s BASIC Computer Games, published in 1973. (It should be noted that historian Joy Lisi Rankin—a Dartmouth grad herself—argues that because Dartmouth was all male until 1972, this unintentionally created an ecosystem of games designed to appeal to masculine interests, setting the tone of the computer games industry to this day.)

Kanold says that while some contestants are expert programmers who have written “special development tools to perfect their 10 Liners,” the contest is still accessible to neophytes: “The barriers to participation are low. Ten lines [is] a manageable project.” For those interested in entering the 2020 competition, Kanold points to programing tutorials that can be found on YouTube or classic manuals [PDF] and textbooks that have been archived online. “But the best resource is the contest itself,” he says. “You can find the 10 Liners from the previous years on the home page, most of them with comprehensive descriptions. With these excellent breakdowns, you can learn how the code works.”

This article appears in the June 2019 print issue as “A Basic Challenge.”

This article is for IEEE members only. Join IEEE to access our full archive.

Join the world’s largest professional organization devoted to engineering and applied sciences and get access to all of Spectrum’s articles, podcasts, and special reports. Learn more →

If you're already an IEEE member, please sign in to continue reading.

Membership includes:

  • Get unlimited access to IEEE Spectrum content
  • Follow your favorite topics to create a personalized feed of IEEE Spectrum content
  • Save Spectrum articles to read later
  • Network with other technology professionals
  • Establish a professional profile
  • Create a group to share and collaborate on projects
  • Discover IEEE events and activities
  • Join and participate in discussions