6 ms·
> "We were surprised to see that the comments at the top of the game proudly proclaimed the authors: Bill Gates and Neil Konzen." This is odd that these commen
by vmarsy 10y ago
> "We were surprised to see that the comments at the top of the game proudly proclaimed the authors: Bill Gates and Neil Konzen."
This is odd that these comments aren't in the github source code, is it missing something? Why does it starts at line 940?
940 REM The IBM Personal Computer Donkey
950 REM Version 1.10 (C)Copyright IBM Corp 1981, 1982
960 REM Licensed Material - Program Property of IBM
- Artoemius 10y ago> The first version of DONKEY.BAS was released in 1981, followed by version 1.10 in 1982 This is the improved 1982 version.
- vmarsy 10y agoI see. I thought they'd have kept the authors name, unless the code was completely rewritten.
- Buge 10y agoEven in the 1.00 version here it doesn't have Gates in the comments. http://www.pcjs.org/devices/pcx86/machine/5150/cga/64kb/donkey/ http://www.pcjs.org/devices/pcx86/machine/5150/cga/64kb/donk...
- pythonistah 10y agoThe line numbers in BASIC were arbitrary. People often started at higher numbers and jumped by 10 in case they had to put code or comments before or between lines.
- colejohnson66 10y agoCould line numbers be out of order? Like, if I did this: 10 PRINT "1" 30 PRINT "2" 20 GOTO 10 What would print out? Just a bunch of "1"s or "12"s?
- allenu 10y agoIt gets run in the correct order. Think of each line as a command that stores the instruction immediately at that line number. You could actually "re-type" a line later by reusing the same line number but replacing it with new contents.
- kqr 10y ago"Correct" order is ambiguous to someone asking that question in the first place.
- colejohnson66 10y agoIt 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[20]' and jumps to `lines[10]'. All the while ignoring `lines[21]' and up.
- abecedarius 10y agoUsually 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.
- david-given 10y agoHere's a description of the file format used by BBC Basic: http://xania.org/200711/bbc-basic-v-format 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.)
- webtechgal 10y agoWell noted. I recall there also used to be a STEP command in the basic interpreter (basica and gw-basic) with which the line number increment could be set e.g. STEP 5 will auto-increment the line numbers by 5. (The default used to be 10.)
- rurban 10y agoMicrosoft usually started at 1000 So you can see that they added the copyright and SAMPLES$ logic later.