logoalt Hacker News

Donkey.bas is 45 Years Old – 131 line of Glory

265 pointsby jkrauskayesterday at 5:45 PM138 commentsview on HN

Comments

vunderbayesterday at 6:07 PM

Nice job. The sound effects are a bit too advanced because early IBM computers shipped with pretty simple, magnetically driven dynamic speakers.

On a related note, I’ve actually spent the last four months working on a 100% faithful adaptation of both QBasic and QuickBasic 4.5 that runs entirely in the browser on a virtual CPU and hardware abstraction layer. It’s a love letter to everyone who learned to program on Microsoft’s BASIC interpreters in the ’80s and early ’90s.

The best compliment I’ve received so far is from friends who grew up in the same era I did: when I fullscreen the browser, a few of them assumed it was a virtual machine running the real thing.

A QBasic port of the original BASIC-based DONKEY.BAS was one of the first programs I got running in it:

https://mordenstar.com/share/qbasic-core-demos

show 9 replies
nfriendyesterday at 6:35 PM

Brings back memories of GORILLA.BAS! https://en.wikipedia.org/wiki/Gorillas_(video_game)

show 6 replies
jamesdhuttonyesterday at 6:43 PM

For anyone unfamiliar with DONKEY.BAS: it’s notable for having been co-written by Bill Gates. More info on its history bere: https://en.wikipedia.org/wiki/DONKEY.BAS

show 1 reply
jkrauskayesterday at 5:45 PM

Inspired by the 45th anniversary of the IBM PC, I got my slopmachine cracking on a port of DONKEY.BAS to work in a browser. Pretty happy with the result. As a young person I remember being fascinated that you could make a game like this with so little code.

show 2 replies
marcuskazyesterday at 9:38 PM

The game theory is all wrong, this is a cooperative game, either they both win or both lose. I don't see how the Donkey getting hit by a car should be classified as "Donkey wins"

show 1 reply
sedatkyesterday at 7:17 PM

I once heard the rumor that DONKEY.BAS was the last piece of code Bill Gates wrote himself at Microsoft. I wonder if it's true.

show 1 reply
friarpuckyesterday at 6:39 PM

Someone gave my grandfather a Games BASICA floppy that had this and other games on it. But this copy had a few games that had been "modified". I remember in DONKEY.BAS, it would curse at you if you hit the donkey. "YOU STUPID SONOFABITCH". We thought it was hilarious. My grandfather was less pleased. He took it away from us when he found out.

show 3 replies
chaoticmasstoday at 12:05 AM

Donkey running on a PC 5150:

https://youtu.be/kmCMkD1vv0E?si=RqGhqIC-EHVhXnDI&t=145

show 1 reply
ssl232today at 6:24 AM

> 1296 PRINT "THIS PROGRAM REQUIRES ADVANCED BASIC -- USE COMMAND 'BASICA'":COLOR 15,0,0:FOR I=1 TO 9000:NEXT: RESUME 1298

TIL there is an “Advanced Basic”. I hope the naming was tongue in cheek.

shakowtoday at 9:57 AM

Is it an easter egg that I can move the donkey with A/D rather than move the car with Space?

flowofcontrolyesterday at 6:03 PM

my car keeps hitting the donkey when switching lanes even though I'm already well past it..

show 2 replies
wk_endyesterday at 6:20 PM

It says something about what a thoughtful development environment these early BASICs were, that you could make a full simple little game like this in only 131 lines even though they're ostensibly far less powerful than modern languages. I'm not sure if you could even get an SDL window open and game loop running in 131 lines of (non-golfed) C.

Never mind how compact, beginner-friendly, and just plain fun they were to use. It's been said countless times but I'll say it again - we've lost something over the years.

show 8 replies
_trampeltiertoday at 10:51 AM

So simple, so cool, so much fun :-)

pavel_lishinyesterday at 5:56 PM

On my machine, it is flickering like _crazy_, as if it's trying to shift back and forth between two resolutions.

OSX, Firefox, browser size 3326×2830 pixels. Only happens at or around that particular size - resizing the window fixes the issue.

show 1 reply
atum47yesterday at 7:39 PM

My perceptron can play this game, I think

https://github.com/victorqribeiro/carGamePerceptron

ChrisArchitectyesterday at 6:04 PM

Related:

Happy 45th Birthday to the IBM PC and Model F/XT

https://news.ycombinator.com/item?id=49280103

buildsjetsyesterday at 8:02 PM

Clearly this needs to be replicated as GTA minigame.

Aeoluntoday at 1:54 AM

I’m partial to Gorrila.bas

phrontyesterday at 7:40 PM

It turned out that Dino run has deep roots

NDlurkeryesterday at 7:43 PM

Surprisingly fun!

foxglaciertoday at 12:42 AM

A greyscale photo of a donkey appears if you lose badly enough. Surely that wasn't possible in basic with 16 colors??

EDIT: That must be the easter egg mentioned in the repo.

show 1 reply
toolsliveyesterday at 7:16 PM

tangential: I still remember how disappointed I was in PCs being used to a C64 (which was released in 1982) The quality of the games & sound effects was just not on the same level (C64 being much more advanced)

mempkoyesterday at 7:35 PM

This is what got me into programming. When I was a kid, I had a shitty 386 because my father got a computer second hand from a friend (we were poor). I was playing the game and then pressed a key and it took me to the basic editor. I was confused with what I saw and started changing things. I changed a number and the size of the explosion on the banana got bigger. My best friend at the time went to computer camp and explained to me that it was code. 30 years later I'm still programming.

show 1 reply
spwa4yesterday at 6:08 PM

Ahhh I never saw donkey.bas, and only saw the Microsoft one. You know, when that company cared about being part of the industry, as opposed to being the entire industry, and really want to be 5 other industries to, as they do now.

Gorillas.bas (it's more or less like worms, except with only 1 gorilla per team)

On the plus side: it was much prettier.

show 1 reply