News for hackers. Stuff that matters.
Re:Donkey.bas is 45 Years Old – 131 line of Glory by sltkr on Thursday August 13, 2026 @03:35PM (#49290885)
It was really cool! The ease of getting started was definitely one of the selling points for the “home computers” of that era (GW-BASIC ran on IBM compatible PCs instead, but the appeal of BASIC was the same). Brevity was an important feature since a lot of people obtained programs by typing them over from a magazine or recording them from the radio. And of course, there was no such thing as auto-complete (let alone AI generation).

That being said, SDL isn't actually that bad either. A minimal example is about 40 lines of code [1], not counting comments and blank lines, but including lines with just a curly brace which you could easily remove if you were concerned about size. A slightly more serious implementation of Snake runs about 345 lines of code [2].

And to be fair, DONKEY.BAS is also cheating slightly on the line metric by stuffing lines full of statements, like for example:

    A$=INKEY$:IF A$=CHR$(27) THEN 1298 ELSE POKE 106,0:IF LEN(A$)>0 THEN LINE (CX,CY)-(CX+28,CY+44),0,BF:CX=252-CX:PUT (CX,CY),CAR%,PRESET:SOUND 200,1

1. https://examples.libsdl.org/SDL3/renderer/01-clear/ 2. https://examples.libsdl.org/SDL3/demo/01-snake/
Re:Donkey.bas is 45 Years Old – 131 line of Glory by NetMageSCW on Friday August 14, 2026 @04:25PM (#49304128)
SDL is incredibly terrible based on that example - I imagine it would be about five lines of qbasic?
Re:Donkey.bas is 45 Years Old – 131 line of Glory by vunderba on Friday August 14, 2026 @05:31PM (#49304833)
Yeah for the rendering a smooth set of RGB shifting colors using SIN you could do it in a few lines of QBASIC.

The only thing is that since the SDL example uses a 640x480 resolution, which corresponds to SCREEN 12, and in QBASIC it only gives you access to 16 indexed colors at once.

So you have to "cheat" by redefining a single entry (like index 1) throughout the loop with calculated RGB using the PALETTE command. It's basically the equivalent of palette color cycling used in some older games.