7 ms·
Donkey.bas is 45 Years Old – 131 line of Glory
- jkrauska 2mo agoInspired 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.
- grimgrin 2mo agonothing novel? just a generated port? - https://gorillas.zone https://gorillas.zone - https://codepen.io/manz/pen/RmEQgv https://codepen.io/manz/pen/RmEQgv - https://github.com/rizwan-virani/gorillas https://github.com/rizwan-virani/gorillas - https://github.com/theraccoonbear/BrowserGORILLAS.BAS https://github.com/theraccoonbear/BrowserGORILLAS.BAS
- jkrauska 2mo agoyou can play as the donkey cheat mode sexy bill
- zahlman 2mo ago> I got my slopmachine cracking on a port For 131 lines?
- pavel_lishin 2mo agoOn 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.
- jkrauska 2mo agomaybe fixed. https://github.com/jkrauska/DONKEY.BAS/pull/4 https://github.com/jkrauska/DONKEY.BAS/pull/4
- pavel_lishin 2mo agoAlso, on reflection, I think the firefox window size is half of what I reported - I'm not sure what OSX does to its screenshots, but using SHIFT-CTRL-CMD-3, it's reporting about half that size. Not sure if that makes a difference to your changes (likely not).
- flowofcontrol 2mo agomy car keeps hitting the donkey when switching lanes even though I'm already well past it..
- stronglikedan 2mo agohave you had anything to drink recently?
- SoftTalker 2mo agoOfficer, I'm not going to discuss my day with you.
- smackeyacky 2mo agoI haven’t looked at the code but the collision detection was buggy even back in the day. You have to switch lanes while there is nothing or a donkey in front of you. If the donkey is in the other lane it registers a hit even if it looks like you passed it Edit: line 1750 is where it does a simple collision check and yep looks like it registers a collision without checking you’re past the donkey or not
- ChrisArchitect 2mo agoRelated: Happy 45th Birthday to the IBM PC and Model F/XT https://news.ycombinator.com/item?id=49280103 https://news.ycombinator.com/item?id=49280103
- vunderba 2mo agoNice 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 https://mordenstar.com/share/qbasic-core-demos
- HeyLaughingBoy 2mo agoAt my first job, our entire order-entry and inventory management system was written in QBASIC. I wish I had the source to try it out with this. I know someone who might, if we could figure out how to get it off a DOS 5.25" floppy!
- vunderba 2mo agoThat’s awesome. If you ever end up getting a copy of it, I’d love to stress-test QBasic-Core against it since I built in a virtual hard drive to allow File I/O (PUT for random access, PRINT to file number, etc.) I’ve got a fairly large collection of several hundred programs from the early to late ’90s that I’ve been carefully testing A/B testing against period accurate hardware and my simulator but actual professionally used QBASIC-based applications from back with the source intact are hard to come by.
- ColdStream 2mo agoThe good news is that 5.25" floppies have tended to be more resilient to time than the 3.5" discs. Turns out just having less data spread over a larger space helped them in this regard. Hardest part is usually trying to find working drives and a means of getting the data off the system.
- spwa4 2mo agoAhhh 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.
- dec0dedab0de 2mo agoDonkey was for basica/gwbasic. Gorillas was for qbasic, like a decade later.
- spwa4 2mo agoNice. First DOS I actually installed was Dos 6.22 and first one I worked on was DOS 5.0. Never actually used gwbasic, I was stuck on Commodore 64 until DOS 5.0.
- pjmlp 2mo agoDOS 5 is when edit and qbasic were introduced, after the DOS 4.0 failure. Similar experience I was stuck with Timex 2068 until the 386SX kind of became affordable enough for leasing, however our school had computer labs, thus I did my typography lessons on MS-DOS 3.3, on nice 5.25" inch floppies.
- wk_end 2mo agoIt 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.
- tancop 2mo agoraylib 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.
- Joel_Mckay 2mo agoI usually recommend the inexperienced do at least 1 project in godot: https://godotengine.org/ https://godotengine.org/ Then port it to UE if they are interested in skill reuse for future projects: https://www.unrealengine.com/ 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
- Joel_Mckay 2mo agoPython is the modern Basic replacement, and also has similar fundamental design trade-offs. VB6 was the peak of the OLE/Multimedia paradigm, and was functionally replaced by the web browser script sandbox. > we've lost something over the years. Indeed, Information Appliances were never general-purpose computers. Some people used to care about that sort of thing, and left civilization the GNU compilers as one of the most important intellectual artifacts of our generation. =3
- sltkr 2mo agoIt 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/ https://examples.libsdl.org/SDL3/renderer/01-clear/ 2. https://examples.libsdl.org/SDL3/demo/01-snake/ https://examples.libsdl.org/SDL3/demo/01-snake/
- nfriend 2mo agoBrings back memories of GORILLA.BAS! https://en.wikipedia.org/wiki/Gorillas_(video_game) https://en.wikipedia.org/wiki/Gorillas_(video_game)
- gxd 2mo agoFor 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 the BASIC dialect that came with MS-DOS, that is! GORILLA.BAS was bundled with DOS and was a fun little game you could play in those computers. It's not like you could access web games on the Internet - there was no Internet!
- pavel_lishin 2mo agoIt was also a very educational experience to start messing with the code until you broke it - forcing you to figure out how to fix it, to get your game back.
- tomcam 2mo agoAt my age, getting my game back sounds fabulous
- eastbound 2mo agoYes, when did we start messing with the code? We need to fix it?
- plasticchris 2mo agoMy earliest coding memory is messing with the gorilla code to get an advantage playing this against my brother…
- friarpuck 2mo agoSomeone 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.
- dmd 2mo agoI learned most of the best cursing I've ever done from my grandfather. He took pride in teaching his grandkids to curse. He was involved in setting up the radar systems at Pearl Harbor, much good that did.
- transitorykris 2mo agoModifying those games were the first times I ever touched code! There was one that existed somewhere between DOS 2.0 and 3.2 that simply asked your name, then asked how the hell you got that name. It was maybe half a dozen lines, but easy enough to modify output and learn a bit about variables.
- syntheticnature 2mo agoAs a kid I modified DONKEY.BAS for my younger brother who wanted to play as a donkey avoiding cars. It was a clumsy modification, I didn't account for the differing size of the pseudo-sprites, but it made him happy.
- jamesdhutton 2mo agoFor 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 https://en.wikipedia.org/wiki/DONKEY.BAS
- jakzurr 2mo ago2nd, the wikipedia article has some fun stuff in it
- toolslive 2mo agotangential: 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)
- 1313ed01 2mo agoPC was a clear winner for RPGs, adventure games, and wargames/strategy, even in the early days of PC/XT. Anything that could make use of more RAM and disk, while also not demanding too much of graphics or audio, was great on PC.
- sedatk 2mo agoI 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.
- ColdStream 2mo agoThat has all the hall marks of urban legend, but why let the truth get in the way of a great story. I have said it for a very long time, Gates wasn't innovative in technology but he absolutely innovated in bringing the most ruthless business practices into software.
- keeda 2mo agoFeel free to correct the Wikipedia entry (which does not say anything about it being his last contribution though): https://en.wikipedia.org/wiki/DONKEY.BAS https://en.wikipedia.org/wiki/DONKEY.BAS And you may also want to correct this one about the Pancake Sorting algorithm he invented as a student that was not improved for another 30 years: https://en.wikipedia.org/wiki/Pancake_sorting#The_original_pancake_problem https://en.wikipedia.org/wiki/Pancake_sorting#The_original_p...
- sedatk 2mo agoIt really sounds like an urban legend, but apparently, Bill Gates admits it here himself. Not sure if it was the last piece of code he wrote though: https://web.archive.org/web/20120213015238/http://www.microsoft.com/presspass/exec/billg/speeches/2001/06-19teched.aspx https://web.archive.org/web/20120213015238/http://www.micros...
- mempko 2mo agoThis 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.
- makapuf 2mo agoWTF 386 was for me a sci-fi like device I wouldnt dare think about having when I was a kid. I had a very nice 8086 I cherished, with VGA video no less ! (Yes driving a vga card with a 8086 was slow..
- lukeh 2mo agoHa yes, PC XT clone here! And then eventually, a 486SX around 1993, which was my first foray into Linux.
- atum47 2mo agoMy perceptron can play this game, I think https://github.com/victorqribeiro/carGamePerceptron https://github.com/victorqribeiro/carGamePerceptron
- phront 2mo agoIt turned out that Dino run has deep roots
- NDlurker 2mo agoSurprisingly fun!
- buildsjets 2mo agoClearly this needs to be replicated as GTA minigame.
- marcuskaz 2mo agoThe 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"
- deleted 2mo ago[deleted]
- chaoticmass 2mo agoDonkey running on a PC 5150: https://youtu.be/kmCMkD1vv0E?si=RqGhqIC-EHVhXnDI&t=145 https://youtu.be/kmCMkD1vv0E?si=RqGhqIC-EHVhXnDI&t=145
- nocman 2mo agoThat video should totally have this as the soundtrack beneath it: https://m.youtube.com/watch?v=Z3qRXDGApNU https://m.youtube.com/watch?v=Z3qRXDGApNU
- foxglacier 2mo agoA 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.
- Aeolun 2mo agoI’m partial to Gorrila.bas
- ssl232 2mo ago> 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.
- Anamon 2mo agoNot tongue in cheek, but called that to distinguish it from ROM BASIC. AFAIK, Advanced BASIC had to be loaded from the DOS disk and mostly added disk management and graphics features.
- shakow 2mo agoIs it an easter egg that I can move the donkey with A/D rather than move the car with Space?
- jkrauska 2mo agoyep. gamer
- _trampeltier 2mo agoSo simple, so cool, so much fun :-)
- deleted 2mo ago[deleted]
- kinghho 2mo ago[dead]