It is nice when a program's author leaves a source comment with well-wishes for future readers, and they are received almost 50 years later.
https://archive.org/details/dr_dobbs_journal_vol_01/page/n143/mode/1up
Discussion
It is nice when a program's author leaves a source comment with well-wishes for future readers, and they are received almost 50 years later.
https://archive.org/details/dr_dobbs_journal_vol_01/page/n143/mode/1up
Looking at Line 5-10 of this #Basic Star Trek listing confused the heck out of me. This listing was written by Li-Chen Wang for use in his own #TinyBasic.
https://archive.org/details/1976-07-peoples-computer-company/page/22/mode/2up?view=theater
Here is the confusing part, expanded out to multiple lines and modern syntax for the benefit of today's readers.
Y=2999
INPUT "DO YOU WANT A DIFFICULT GAME? (Y OR N)",A
IF A=Y THEN Y=999
Without support for string input, how the heck can the program accept "Y or N" from the user?
Answer: In this dialect, INPUT accepts not just numbers, but expressions. Single characters (A-Z) are valid expressions and evaluate to the value in that variable. So in this program, typing "Y" sets A=2999 and typing "N" sets A=N (some uninitialized value). Then the next line checks A=Y (true if user entered "Y") and, if so, sets Y to 999 ("difficult game" value). Else, Y is left at 2999 ("easy game" value).
Li-Chen is absolutely some kind of genius.
The funniest part here is that the magazine editors also got confused by this in 1976. "Hey, for this program to work, this #BASIC must have a 1-character mini string type!" No, no strings, the author just knows his language and is squeezing every ounce of expressiveness out of it.
Forgot to thread this: https://oldbytes.space/@psf/115285802359299755
#MailStation #TinyBasic program of the day: Hangman!
I wanted something that would exercise my hacked-in "strings" support. Seems to work well enough for a word game!
Source listing (21 lines): https://gitlab.cs.washington.edu/fidelp/mailstation_apps/-/blob/master/basic/hangman.bas
A space for Bonfire maintainers and contributors to communicate