Live data from Hacker News

Donkey – A computer game included with early versions of PC DOS

github.com

141–150 of 183 posts

Re: Donkey – A computer game included with early versions of PC DOS

#141

People forget that the intention of some programming demos is to explain some concepts simply. The intended audience of that code wasn't some expert programmer - it was for those who wanted to see how things worked so that they could see how the game sucked and once they learned enough they could improve upon it. For expert BASIC code see Nibbles.BAS: http://stanislavs.org/OldPages/stanislavs/src/nibbles.bas

true enough, and I agree, it was just a demo hacked together, but i think the difference you are seeing is both a consequence of nibbles requiring qbasic, and nibbles being developed nearly 10 years later after basic has become quite popular.

Re: Donkey – A computer game included with early versions of PC DOS

#142
post #137

Why are people complaining that the game is bad? Really? Can we see what you wrote in 1982? Games like this were quickly hacked together to show the capabilities of the machine. It was done in BASIC for owner's of those machines to play with. If this was a commercial product, it would be written in assembly. If anything, this was likely a demo of Microsoft BASIC, let's not forget that Bill Gate's first product was no…

Was Kildall a better programmer than Gates?^U Who wrote more elegant software? Who undercut the price of the other's software? And why? Microsoft's early success was not due to originality. Gates has no aesthetic. He has no respectable standard of quality. Does anyone remember "Microsoft Bob"? He may be worthy of respect by less capable programmers. He may be worthy of respect by the business community. He may be wor…

Did Bill Gates personally write Microsoft Bob? I got the impression OP was referring to late 70s / early 80s Microsoft when Gates was still very much doing the coding himself, as opposed to the much bigger 90s Microsoft when he was a few layers removed.

Re: Donkey – A computer game included with early versions of PC DOS

#143
post #16

Andy Hertzfeld recollects how Macintosh team dissected the new IBM PC and what they thought of donkey.bas: http://www.folklore.org/StoryView.py?project=Macintosh&story...

That's an interesting piece of history, and certainly demonstrates a little bit of the competitive atmosphere, if nothing else.

Donkey was a 'hello world' of graphics with basic, it wasn't a game. Even as a kid, playing it never lasted more than a few seconds. Critiquing it as though it's a serious game gives this code too much credit and makes Hertzfeld look bad too- taking it seriously is almost as funny to me as the game is. For what it is, a code example, having a better game would have detracted significantly from it's value.

Re: Donkey – A computer game included with early versions of PC DOS

#144

My father bought the first family computer, an IBM PCjr, when I was 4 or 5. Donkey.BAS made a huge impact on me, although its easy to overlook as a crap game these days. Sure, there were "better" games that I played on that system: my older brother purchased Sierra's Black Cauldron–which I played the shit out of. My uncle wanted me to grow up to be a pilot, so MS Flight Simulator was in order, too. Jordan Mechner's K…

Ha! I was 9 or 10 when my dad bought us a PC jr. It was awesome. Having the code samples like Donkey.bas was what really allowed you to experiment, see what was possible, and write longer programs. There was no online documentation then.

There's a lot of shitty but accessible examples now, and a lot more ways to get them easily. If anything, it's harder now to pick a platform/device/language because there are so many choices. My kids won't put down their iPhone games long enough to read code examples, even though they talk about wanting to program.

Re: Donkey – A computer game included with early versions of PC DOS

#145

Earlier quoted context omitted.

It sounds like he's saying the "line number" is just the index to a tokenized list (i.e. line 15 is at `lines[15]') where unused lines are just nops. So my "program" would be tokenized and the lines stored like: char** lines = malloc(...); lines[10] = &line1; lines[30] = &line2; lines[20] = &line3; Then when executing, it starts at `lines[0]', sees nops, gets to `lines[10]' and runs it, sees more nops, gets to `lines…

Usually in 8-bit BASICs the lines would be stored consecutively (not in separate malloced segments) with each line starting with its line number. Yes, this meant that GOTO required a search. Memory was a really central design constraint on these systems. I don't know how closely MS's BASICA on the PC followed this model, but the PC's starting configuration had 16k bytes of RAM.

Here's a description of the file format used by BBC Basic:

http://xania.org/200711/bbc-basic-v-format

That's Basic V, which was the variant used on the ARM-based Archimedes, but it's the same file format as the 6502 machine Basics.

Note that the line numbers used by GOTO and GOSUB were specially flagged --- this was so the RENUMBER command could find them. It also meant that computed gotos weren't renumbered...

(Of course, BBC Basic had proper named procedures and functions with local variables, but all self-respecting Basics had to support GOTO and GOSUB.)

Re: Donkey – A computer game included with early versions of PC DOS

#146
https://robhagemans.github.io/pcbasic/ is a GPL3-licensed implementation of the BASIC language this game is written in. PC-BASIC is written in Python. Supposedly it can run this game, although I haven't tried it.

A couple of interesting features of the game (quotidian to those of us around at the time, but...)

1. The "PLAY" statement is barely used; the sounds are mostly done with the SOUND statement, maybe in part because they are being generated randomly. In fact it seems to be used only to verify that the program is being run on a BASIC interpreter that supports "advanced" features like DRAW.

2. The "DRAW" statement, which has its own mini-language similar to that of the "PLAY" statement. Later these were dubbed "Graphics Macro Language" and "Music Macro Language", even though neither one allows you to define macros. This is used to include vector graphics of the donkey and the racecar in the program, in the subroutines on lines 1940 and 1780, respectively. But the interpretive rendering of these vector graphics (and especially the flood fills, lines 1900 and 2010) was too slow to want to do it every frame; instead it's done at program startup (into an on-screen buffer, since that's the only way to do it in GW-BASIC or BASICA; you can see the painting happen briefly before the game starts) and stored in the arrays CAR% and DNK% with GET statements, later to be PUT onto the screen in the right place each frame. There's a bit of sloppiness there: CAR% is DIMmed right there in the subroutine on line 1910, while DNK% is DIMmed up at the top on line 1470. (And the sprites for the halves of the donkey and car are dimmed there too, along with a planned sprite called Q% which is never used.)

3. There's actually an additional sprite, B%, which isn't set up with a GET statement; it's filled in "by hand" to a simple fill pattern on lines 1510–1530. My memory was saying that the data format of this array was undocumented, but it does seem to be documented in http://www.antonis.de/qbebooks/gwbasman/, which I'm pretty sure is the actual GW-BASIC manual from Microsoft. Anyway, B% is a vertical line that's getting XORed into the framebuffer (the default PUT raster op was to XOR into the framebuffer, violating patent 4,197,590 if you use it for a cursor) to make the stripes down the middle of the road "move".

4. See how AND is being used as a bitwise operator? That's why true was -1 in MBASIC.

I think there are some important lessons in GW-BASIC/BASICA about how to design user interfaces for end-user programming, and the DRAW and PLAY statements in particular. Also, I can't have been the only person who never figured out how to use the vi-like line editor in BASIC-80 but who edited existing code all the time in Z-BASIC/GW-BASIC/BASICA because I could just use the arrow keys.

Re: Donkey – A computer game included with early versions of PC DOS

#147
post #137

Earlier quoted context omitted.

Was Kildall a better programmer than Gates?^U Who wrote more elegant software? Who undercut the price of the other's software? And why? Microsoft's early success was not due to originality. Gates has no aesthetic. He has no respectable standard of quality. Does anyone remember "Microsoft Bob"? He may be worthy of respect by less capable programmers. He may be worthy of respect by the business community. He may be wor…

Did Bill Gates personally write Microsoft Bob? I got the impression OP was referring to late 70s / early 80s Microsoft when Gates was still very much doing the coding himself, as opposed to the much bigger 90s Microsoft when he was a few layers removed.

http://www.computerworld.com/article/2483957/microsoft-windo...

"'We were just ahead of our time, like most of our mistakes,' Gates says of personal agents like the notorious Clippy character."

"Gates has a personal connection to Microsoft Bob -- more than it being just another product launched on his watch -- as his wife, Melinda French Gates, was a marketing manager on the Bob project."

Re: Donkey – A computer game included with early versions of PC DOS

#148
post #146

https://robhagemans.github.io/pcbasic/ is a GPL3-licensed implementation of the BASIC language this game is written in. PC-BASIC is written in Python. Supposedly it can run this game, although I haven't tried it. A couple of interesting features of the game (quotidian to those of us around at the time, but...) 1. The "PLAY" statement is barely used; the sounds are mostly done with the SOUND statement, maybe in part b…

PC-BASIC is a great re-implementation of GWBASIC. I tried it on some of my old gems from the late 80s and they still worked. :)

Re: Donkey – A computer game included with early versions of PC DOS

#149
post #111

Earlier quoted context omitted.

The Mac folks understood a lot more about personal computers than the IBM folks. For instance, the graphics hardware on the Mac wasn't much to write home about, but the PC's graphics was unbelievable garbage that had no hope of performing well (it probably set back GUI development on the PC by five years). The Mac's sound wasn't great, but the PC had a speaker hooked to a TTL port, with the same engineering sophistic…

PC had a speaker hooked to a TTL port, with the same engineering sophistication as the backup alarm on a garbage truck While true, the quality of sound achievable this way is a matter of software. There are many programs that achieved excellent sound quality, playing music even with just a speaker and a TTL drive. Remember, the simplest DAC is PWM into a low-pass filter.

A couple of years back, I burned out a friend's tweeters by hooking up an Arduino's 31.25kHz PWM to his stereo system. Worked fine at first, but it eventually melted his tweeters. I figured the stereo would low-pass-filter the input for me, and I paid the price.

The PC speaker didn't have PWM; it had a square-wave generator with adjustable frequency. Very few 1980s programs achieved anything even approaching decent sound quality using the PC speaker, although by the 90s, CPUs were fast enough that it was reasonably feasible. In the late 90s, I used to patch my Linux kernel with an unofficial driver that provided arbitrary PCM output via the PC speaker. It was glitchy if I left interrupts disabled during IDE disk accesses, which was the default at the time due to some buggy IDE devices that would sometimes corrupt data if you didn't. Fortunately, mine wasn't one of them.

I feel like PDM is just as simple as PWM and often gives better quality, and an R-2R DAC like a Covox is arguably just as simple as PWM and gives dramatically better quality. You need a few more pins, though, or a 74595.

Re: Donkey – A computer game included with early versions of PC DOS

#150
post #100

Earlier quoted context omitted.

Wow, that's a salty article!

I don't think salty is the right word. Salt implies some kind of frustration and I don't think that's accurate here. I'd call it an honest, judgmental article.

I always considered salty to mean the act of being bitter or resentful.
Post reply on HN