DONKEY.BAS
Donkey, often known by its filename DONKEY.BAS, is a video game written in 1981, and included with early versions of the IBM PC DOS operating system distributed with the original IBM PC. It is a top-down driving game in which the player must avoid hitting donkeys. The game was written by Microsoft co-founder Bill Gates and early employee Neil Konzen. Although on the game's title screen it is simply named Donkey, it is often referred to by its filename of DONKEY.BAS. All BASIC programs used the ".BAS" extension, and MS-DOS compatible operating systems that came before Windows 95 display file names in upper case. These conventions are often maintained when the game is referred to in writing. Gameplay
DONKEY.BAS is a simple driving game in which the player controls a car but cannot steer, accelerate or brake, only changing lanes to avoid a series of donkeys on the road. There is no goal other than to avoid donkeys. The game uses the CGA display mode, the only colour graphics mode available on the original IBM PC. The mode allows four colours but in DONKEY.BAS there are usually only three on screen. The center of the screen shows a vertical scrolling road with two lanes; the areas on either side of the road are used for scores and instructions. The player's car is driving up the road and every few seconds a donkey will appear at random on one side of the road at the top of the screen. As the donkey moves down the screen, the player can press the space bar to switch between lanes to avoid the donkey. If the car hits the donkey, both car and donkey explode, and parts of the graphics are scattered to the four corners of the screen to the sound of a short monophonic tune played through the PC speaker, with the word "BOOM!" displayed on the left side of the screen. If the player avoids the donkey, it will scroll off the bottom of the screen, with the words "Donkey loses!" displayed on the right side of the screen, and after a few seconds another will appear. There is never more than one donkey on the screen at any one time. The game keeps the score between the player and the donkeys. If the car hits a donkey, the donkey gets a point and the player is returned to the start of the road. As the car avoids donkeys, it moves slowly up the screen, giving the player less time to react when donkeys appear. If the car avoids enough donkeys, the player receives a point and the car is moved back to the bottom of the road. The game displays the number of points earned by the player and donkey, but does not end or change when a particular score is reached. The Esc key quits the game. Sprites are rendered slightly differently between the QBasic interpreter and the original IBM BASICA/GW-BASIC interpreter. Development
 

When IBM was developing its personal computer in the late 1970s and early 1980, it contracted Microsoft to develop an operating system and a version of the BASIC programming language to release with the new computer. The operating system was released as IBM PC DOS when included with IBM PCs and MS-DOS when sold separately by Microsoft. Both included versions of Microsoft BASIC. DONKEY.BAS was written by Bill Gates and Neil Konzen to demonstrate the IBM PC and the BASIC programming language's capability to produce interactive programs with color graphics and sound. The game continues to generate interest, in part because of the involvement of Gates at a time when Microsoft was relatively small and only six years old. According to a speech delivered by Gates in 2001:

Apple's Andy Hertzfeld mentioned the game in a description of the Macintosh team's reaction to the 1981 IBM PC purchased for them by Steve Jobs "to dissect and evaluate," noting that the new computer shipped with "some games written in BASIC that were especially embarrassing:"

The first version of DONKEY.BAS was released in 1981, followed by version 1.10 in 1982. The operating systems with which the game was first distributed still work on modern computers with compatible BIOS and 5.25-inch floppy drives; however, IBM BASICA which ran the program under PC DOS 1.x requires ROM-based IBM Cassette BASIC, which modern computers do not have. The source code is still available. The game may be played with the GW-BASIC (original code) or QBasic (adapted code) interpreters or in compiled form (see "external links" below). Legacy

As a programming example for the new  platform and Visual Basic  programming language, in 2001 Microsoft developed a game called  in homage to DONKEY.BAS. It is a three-dimensional driving game in which the aim is to hit donkeys. The game demonstrates to programmers how a  application can be structured and how to use various features of the  platform. A version was also included as part of Google's wwwBASIC browser based interpreter. See also
 GORILLA.BAS
 NIBBLES.BAS

References

External links
 
 Speech in which Bill Gates and Ari Bixhorn discuss DONKEY.BAS and Donkey .NET
 Story about Macintosh developers discovering DONKEY.BAS
 DONKEY.BAS executable , a compiled version of the above source code that can be executed on Windows PCs without an interpreter. Donkey .NET download from Microsoft. An implementation of DONKEY.BAS for the Picaxe microcontroller. Article on Donkey.bas with animation showing program running
 DONKEY.GB on PigaLore, the Piga Software Wiki
 An implementation of DONKEY.BAS for Windows Phone. DONKEY.BAS for iPhone and iPad
 DONKEY.BAS for Windows 8 in the Windows Store
 DONKEY.APP for iPhone, Apple Watch and Apple TV

1981 video games
BASIC software
Commercial video games with freely available source code
DOS games
IOS games
Linux games
Microsoft games
Video games developed in the United States
Windows games
Works by Bill Gates
Single-player video games
DOS files