Make 1987/heckbert look more like original
As index(3) in some systems requires strings.h and since it's identical to strchr and since the judges said in System V machines (not that we should have to worry about those these days) they had to define index to strchr I have done this in the Makefile. Also the #define _ define was restored even though it's not used in order to make it look closer to the original entry. This has to be done in other files as well, as I think on it. Format and typo checked README.md.
This commit is contained in:
1 parent
a2a5bcd507
commit
12e547c1fa
5 files changed
+26
-8
No files matched your search
@@ -7,3 +7,4 @@ ph
|
||||
ph.c
|
||||
heckbert.orig
|
||||
prog.orig
|
||||
foo.md
|
||||
@@ -58,7 +58,7 @@ ARCH=
|
||||
|
||||
# Defines that are needed to compile
|
||||
#
|
||||
CDEFINE=
|
||||
CDEFINE= -Dindex=strchr
|
||||
|
||||
# Include files that are needed to compile
|
||||
#
|
||||
|
||||
+12
-7
@@ -1,7 +1,6 @@
|
||||
# Best Obfuscator of Programs
|
||||
|
||||
Paul Heckbert
|
||||
Pixar
|
||||
Paul Heckbert<br>
|
||||
|
||||
## To build:
|
||||
|
||||
@@ -12,15 +11,20 @@ make all
|
||||
On System V systems, we had to compile with `-Dindex=strchr`.
|
||||
To compile on a 16 bit machine, change 300000 to 30000.
|
||||
|
||||
## To run:
|
||||
|
||||
```sh
|
||||
./heckbert col < file
|
||||
```
|
||||
|
||||
where col is the number of columns to fold at and file is the file to fold.
|
||||
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./heckbert 40 < heckbert.c > ph.c; make ph
|
||||
./ph 21 < heckbert.c > bar.c; make bar
|
||||
# or more generally fold some other file at a positive column:
|
||||
./ph col < file
|
||||
|
||||
```
|
||||
|
||||
Ask yourself what happens to `foo.md` if you try:
|
||||
@@ -41,9 +45,10 @@ Try not to
|
||||
[Fold, Spindle or Mutilate](https://repository.library.brown.edu/studio/item/bdr:788264/PDF/)
|
||||
files. :-)
|
||||
|
||||
The judges used this program to fold up very long lines which the
|
||||
BSD fold(1) was unable to process. This program has been added
|
||||
to the contest tool chest.
|
||||
The judges used this program to fold up<br>
|
||||
very long lines which the BSD fold(1)<br>
|
||||
was unable to process. This program has<br>
|
||||
been added to the contest tool chest.
|
||||
|
||||
## Author's remarks:
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#define _ define
|
||||
#define A putchar
|
||||
#define B return
|
||||
#define C index
|
||||
|
||||
Reference in new issue
Block a user