Re:
by marcodiego on Wednesday May 03, 2023 @11:36AM
(#35803693)
I think "Towers of Hanoi in SNOBOL" would get to first page even today.
[ Parent
| on HN ]
https://raganwald.com/assets/snobol-green-book.pdf
"4.6.4 Example - Tower of Hanoi" on pages 109-111 (the scanned page numbers)
Is it even a 1980s programming language without a Hanoi example?
Here's the program in its all-caps, weirdly indented beauty:
DEFINE('HANOI(N,NS,ND,NI)') :(HANOI.END)
HANOI EQ(N,O) :S(RETURN)
HANOI(N - 1,NS,NI,ND)
OUTPUT 'MOVE DISC ' N ' FROM ' NS ' TO ' ND
HANOI(N - 1,NI,ND,NS) :(RETURN)
HANOI.END
TEST HANOI (5,'A','C','B')
ENDActually, SNOBOL is a 1960s programming language[1], so it wouldn't have been a trendy new language in an 80s version of HN.
In the 1960s, most programming was done on punched cards, and keypunch machines (and many computers) didn't have lower case letters on them. Hence, languages from that era, like FORTRAN, COBOL, PL/I, LISP and assembly language, were written in all-caps.