03-11-2023, 02:08 PM
Not trying to make this contribution in this thread less important. Bubble sort used to be one way to teach programming in general, if not BASIC programming. It was the first sort routine I came across, in the Radio Shack TRS-80 Color Computer manual. I was able to remember only the double FOR... NEXT loop and the comparison out of it, and a bunch of ordinary variables juggled around. It was for a program which could have been expanded easily into a full-screen editor, which would have been something on that very slow 8-bit computer. The original purpose of the program was an "inventory list", held by a string array. So it used "INPUT" to ask for the content of each line. That computer's BASIC instruction set didn't have "LINE INPUT" nor "PRINT USING", therefore the program was rather simple although it wouldn't have run on a 4KB computer.
Now I'm not sure where I read the quotation by someone else I offered earlier. I did have "The Art of C" book by Herbert Schildt. The most fascinating chapter was the one about building a BASIC interpreter. It was too limited for some, but I used it as prototype for a vain project of mine, an interpreter that replaced MS-DOS batch-file language. It had custom file listing, graphics with text, ability to get input from user, ability to do simple math and more. As you could probably imagine, this project made better sense before MS-DOS v5. My interpreter's language wasn't much more tolerable. I failed in particular trying to invent a block-IF, wasn't patient enough to scan the interpreted source code to allow nesting and to allow it with a looping construct. I wanted to jump out of any block I wanted, and I also wanted to support subprograms. It became a total mess I was forced to abandon because I hated programming in C much more than in BASIC or Pascal.
Now I'm not sure where I read the quotation by someone else I offered earlier. I did have "The Art of C" book by Herbert Schildt. The most fascinating chapter was the one about building a BASIC interpreter. It was too limited for some, but I used it as prototype for a vain project of mine, an interpreter that replaced MS-DOS batch-file language. It had custom file listing, graphics with text, ability to get input from user, ability to do simple math and more. As you could probably imagine, this project made better sense before MS-DOS v5. My interpreter's language wasn't much more tolerable. I failed in particular trying to invent a block-IF, wasn't patient enough to scan the interpreted source code to allow nesting and to allow it with a looping construct. I wanted to jump out of any block I wanted, and I also wanted to support subprograms. It became a total mess I was forced to abandon because I hated programming in C much more than in BASIC or Pascal.