Updates to 1996/huffman - format + bugs + try.sh

The try.sh script runs the commands in the try section. It does not run
the spoiler command in the judges' remarks as that didn't feel like a
good idea.

The README.md has been typo and format checked.

Added to bugs.md to try and change to use fgets(3). In the meantime it
uses 2>/dev/null.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-11 09:20:28 -08:00
1 parent 3ca67b08ff
commit 760e5ddd32
5 files changed
+75 -9

No files matched your search

+1 -1
View File
@@ -62,7 +62,7 @@ CDEFINE=
# Include files that are needed to compile
#
CINCLUDE=
CINCLUDE= -include stdio.h
# Optimization
#
+14 -8
View File
@@ -5,22 +5,28 @@ make all
```
### Bugs and (Mis)features:
The current status of this entry is:
```
STATUS: uses gets() - change to fgets() if possible
```
For more detailed information see [1996 huffman in bugs.md](/bugs.md#1996-huffman).
## To use:
```sh
echo 'Huffman Decoding' | ./huffman
```
NOTE: this program uses `gets()` so you will likely get a warning when compiling
and/or running on modern systems.
### Try:
```sh
echo 'seeing or feeling is believing' | ./huffman
echo 'CC OR NOT CC' | ./huffman
echo 'CC OR NOT CC' | ./huffman | ./huffman
./try.sh
```
@@ -34,7 +40,7 @@ And for a misleading hint, consider who won! :-)
And if you really can't see what is going on, here is an extra spoiler:
```sh
./huffman < huffman.c
./huffman < huffman.c 2>/dev/null
```
This entry was very well received at the IOCCC BOF.
@@ -46,7 +52,7 @@ This filter program is really not obfuscated code. It compiles cleanly
with an ANSI C compiler and comes with user documentation that even a
blind person could read.
The program is a bidirectional filter with the output of the program\
The program is a bidirectional filter with the output of the program
suitable for its input. The output of this program, when used as input,
undoes the original program filtering.
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
make all >/dev/null || exit 1
echo "$ echo 'seeing or feeling is believing' | ./huffman" 1>&2
echo 'seeing or feeling is believing' | ./huffman 2>/dev/null
echo "$ echo 'CC OR NOT CC' | ./huffman" 1>&2
echo 'CC OR NOT CC' | ./huffman 2>/dev/null
echo "$ $ echo 'CC OR NOT CC' | ./huffman | ./huffman" 1>&2
echo 'CC OR NOT CC' | ./huffman 2>/dev/null | ./huffman 2>/dev/null