Files
ioccc/1990/dg
Landon Curt Noll dbf6921b3a use include 1337.mk to hold 1337 hacker rulz
Updated 1337 hacker rulz to version 7.

Added `1337.mk` to contain the updated 1337 hacker rulz (v7).

We use an optional include of `1337.mk` (or `../1337.mk`,
or `../../1337.mk`) to include the 1337 hacker rulz.

Changed `make deep_magic` to `make more_magic`.

Changed `bin/tar-entry.sh` VERSION from "1.3.7 2024-07-22"
to "1.3.8 2024-07-23".

Changed `bin/tar-year.sh` VERSION from "1.2.5 2024-07-22"
to "1.2.6 2024-07-23".

Add `make new_entry` to `YYYY/Makefile` and `template/Makefile.year`.

Change `make new_year` to use `sort -n -u`.

Made minor debug message fixes to `bin/new-year.sh`.

Changed `bin/new-year.sh` VERSION from "1.3 2024-07-23"
to "1.3.1 2024-07-23".

Improved `bin/add-dir.sh` to update `YYYY/Makefile` with
the new entry directory name.

Changed `bin/add-dir.sh` VERSION from "1.0 2024-07-21"
to "1.1 2024-07-23".

Performed `make www` to accomplish the above and to test under macOS.
2024-07-23 22:45:16 -07:00
..
2024-06-14 06:52:23 -07:00
2023-07-06 21:49:38 -07:00

To build:

    make all

To use:

    echo foo bar | ./dg

Try:

    ./try.sh

Judges' remarks:

Some C preprocessors got confused about single quotes in certain cases. In particular, the following source line:

    b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))

sometimes has to be changed to:

    b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))

particularly if the C preprocessor botches single quotes in cpp expansions, which we have done for the wider audience.

Author's remarks:

If my preprocessor could hack it, I could write this as one single line rather than 4, but when I do that I get a complaint "defines nested too deeply".

NOTICE to those who wish for a greater challenge:

If you want a greater challenge, don't read any further: just try to understand the program via the source.

If you get stuck, come back and read below for additional hints and information.

How this entry works:

This is another rot13 job (believe it or not) - the #defines are a novel way of adding tokens: #define b12(x) 12 x means that at some point in the source a 12 is followed by the compressed nested #defines. The b12 gets the previous compression as an argument, and prepends the 12, thus making another step in the recreation of the source. The axx() #defines do the same, but add tokens after.

As for the rot13 algorithm, it relies on index(3) to find if the character is in the set A-Za-z. l[] is an array that gets filled with:

    "nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM"

If index(3) says the char is in the alphabet, then XOR the offset with 16 to translate, and output, otherwise pass it unchanged.