Files
ioccc/2019/diels-grabsch1
Landon Curt Noll 4ee4c731f7 convert markdown copyright TAB chars into SPACE chars
While not strictly necessary, replacing the two ASCII tab characters
in the markdown copyright comment makes it easier to detect problematic
TAB indentation within markdown files.

After this commit, only 90 markdown files have leading ASCII TAB
characters.  And again, while not strictly necessary, we can consider
running expand on those 90 markdown files to see what effect that
might have on the HTML files they produce.

Replace leading ASCII TAB characters with multiples of 8 ASCII SPACE
characters (the default action of the `expand(1)` tool) might have
an negative effect on some HTML formatting where **hack-a-round**
formatting was attempted to fix broken indentation caused by
problematic ASCII TAB characters.

Think of this as a baseline for evaluating leading
TAB characters within markdown files.

TODO: Consider either using `expand(1)` to replace leading ASCII
TAB characters with multiples of 8 ASCII SPACE characters AND/OR
modifying the appropriate `bin` tool to convert leading ASCII TAB
characters into multiples of 8 ASCII SPACE characters.
2024-06-22 22:15:25 -07:00
..
2024-06-07 02:10:24 -07:00
2023-07-06 21:49:38 -07:00

To build:

    make

To use:

    ./prog < file > file.Z

Try:

    ./try.sh

Judges' remarks:

Finally, IOCCC now has its own text compression program, and it is short enough to qualify for the Best Short Program award! That said, can you compress it down to a one-liner, still producing files in the UNIX compress format, albeit sacrificing the compression ratio?

Can you explain why the /dev/zero file compresses identically by the entry and the standard compress(1) tool (see try.sh), but the text file compresses differently? The judges know. :)

Author's remarks:

A tiny "compress" tool:

Usage:

    ./prog < input.txt > input.txt.Z

Example:

    ./prog < guidelines.txt > guidelines.txt.Z

Check for correctness:

    zcat guidelines.txt.Z > guidelines2.txt
    diff -s guidelines.txt guidelines2.txt

Of course you can also use 2015/mills2prog.c instead of zcat to verify the output file. The achieved compression ratio roughly matches that of the classic Unix compress(1) tool. And the source code is very compressed, too: It has exactly the same size as the paragraph you are reading right now. And exactly the same shape. Nevertheless, it is portable C99 code that runs on 32-bit and 64-bit platforms. It compiles without warnings on both GCC and Clang even with -Wextra and -Weverything.

2023 note: the above paragraph might not be true as far as number of bytes goes.