# ROT13 in Algol68. Reads from the file named in the first command line argument, if supplied, otherwise reads from the standard input. Writes rot13ed text to the standard output. The keyword `USES' imports a module. Modules are an Algol68R extension. I'm pretending there's a `stdlib' module that defines `argv' and `argc' like C's, I don't know what Algol68R really uses to read command lines. # USES stdlib BEGIN PROC rot13 (CHAR c) CHAR: chr(ord(c) + ( c >= 'A' AND c <= 'M' | 13 |: c >= 'N' AND c <= 'Z' | -13 |: c >= 'a' AND c <= 'm' | 13 |: c >= 'n' AND c <= 'z' | -13 | 0)); REF FILE file := stand in; IF argc = 2 THEN open (file, argv[1], stand in channel) FI; on logical file end (file, (REF FILE f) BOOL: GOTO eof); DO CHAR c; read (file, (c)); print ((rot13 (c))) OD eof: close (file) END