Live data from Hacker News

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

donkeybas.com

31–40 of 153 posts

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

#33
post #17
post #10

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…

raylib might do it in less lines. SDL is designed as a cross platform base layer to wrap in another framework not as something you should be using directly.

I usually recommend the inexperienced do at least 1 project in godot:

https://godotengine.org/

Then port it to UE if they are interested in skill reuse for future projects:

https://www.unrealengine.com/

SDL has a lot of issues, and falls into the "only if you must" category. Still better than .NET or Java in many ways, as spacial audio is easy in the mixer. =3

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

#35
post #10

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…

>I'm not sure if you could even get an SDL window open and game loop running in 131 lines of (non-golfed) C.

The basics (window, events, renderer) can be done in about 30 lines:

    #include 
    #include 

    static SDL_Window* window;
    static SDL_Renderer* renderer;

    int main(int argc, char* argv) {
        SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_GAMEPAD);
        SDL_CreateWindowAndRenderer("test", 640, 480, SDL_WINDOW_RESIZABLE, &window, &renderer);
        SDL_Event event;
    
        while(true) {
            while(SDL_PollEvent(&event) != 0) {
                if (event.type == SDL_EVENT_QUIT) {
                    goto ENDGAME;
                }
                //events go here
            }
            
            // update here
            SDL_SetRenderDrawColor(renderer,0,0,0,255);
            SDL_RenderClear(renderer);

            // render here
            SDL_RenderPresent(renderer);

        }

        ENDGAME:
        SDL_DestroyRenderer(renderer);
        SDL_DestroyWindow(window);
        SDL_Quit();
    }
I don't think you could get all of donkey.bas done in 131 lines, though. SDL3 does ship with an embedded debug font but that seems like cheating. You probably couldn't replicate the drawing code easily, it would probably need to be faked with images, and you'd need a font atlas for the text.

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

#37
post #7

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 Mic…

aw neat I'd love to try doing this for its predecessor GWBASIC (my first programming language on the Tandy 1000EX)

You absolutely should!

I’ve already sunk hundreds of hours into building out the fidelity of QuickBASIC (everything down to emulating memory access so you can simulate realistic PEEKing and POKEing), so I don’t have the sanity points left to tackle any other variants myself, but I’d love to see a GW-BASIC version.

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

#38
post #19
post #12

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

For those who don't know why GORILLA.BAS is so cool... Back in the day, computers were expensive and games weren't readily available. Sometimes a parent would buy a computer for word processing or spreadsheets or take kids to the office which also had business computers. Children were curious about the computers but there wasn't really anything fun to do with them besides banging on the keyboard... ...Until you found…

> Back in the day, computers were expensive and games weren't readily available.

You could get a PC for a thousand bucks back then, and shareware was a thing in 1990-91. Crystal Caves, Commander Keen, Duke Nukem were huge hits and there were tons of less popular games...not to mention copying commercial games from friends.

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

#39
post #2

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.

nothing novel? just a generated port?

- https://gorillas.zone

- https://codepen.io/manz/pen/RmEQgv

- https://github.com/rizwan-virani/gorillas

- https://github.com/theraccoonbear/BrowserGORILLAS.BAS

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

#40
post #19

Earlier quoted context omitted.

For those who don't know why GORILLA.BAS is so cool... Back in the day, computers were expensive and games weren't readily available. Sometimes a parent would buy a computer for word processing or spreadsheets or take kids to the office which also had business computers. Children were curious about the computers but there wasn't really anything fun to do with them besides banging on the keyboard... ...Until you found…

> Back in the day, computers were expensive and games weren't readily available. You could get a PC for a thousand bucks back then, and shareware was a thing in 1990-91. Crystal Caves, Commander Keen, Duke Nukem were huge hits and there were tons of less popular games...not to mention copying commercial games from friends.

Crystal Caves! I've been trying to remember the name of that game for ages! I never bought the full version but played the shareware endlessly...
Post reply on HN