News for hackers. Stuff that matters.
Re: by tpmx on Wednesday May 03, 2023 @11:51AM (#35803854)
https://raganwald.com/assets/snobol-green-book.pdf

"4.6.4 Example - Tower of Hanoi" on pages 109-111 (the scanned page numbers)

Re: by pavlov on Wednesday May 03, 2023 @12:04PM (#35804055)
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')
  END
Re: by greenyoda on Wednesday May 03, 2023 @03:02PM (#35806332)
Actually, 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.

[1] https://en.wikipedia.org/wiki/SNOBOL