Merge pull request #1792 from xexyl/hague86-try

This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-12-23 10:22:21 -08:00
commit 15fb53ac9e
5 files changed
+43 -37

No files matched your search

+4 -9
View File
@@ -16,17 +16,12 @@ make all
### Try:
```sh
./hague 2>/dev/null
IOCCC
International Obfuscated C Code Contest
Jim Hague
./try.sh
```
Also try:
```sh
echo IOCCC | ./hague 2>/dev/null
```
Note that you can run the program without feeding it anything and then type in a
message and line by line it will show the right output. Notice also how certain
characters will print a `?`.
## Judges' remarks:
-28
View File
@@ -1,28 +0,0 @@
#define DIT (
#define DAH )
#define __DAH ++
#define DITDAH *
#define DAHDIT for
#define DIT_DAH malloc
#define DAH_DIT fgets
#define _DAHDIT char
_DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:"
;main DIT DAH{_DAHDIT
DITDAH _DIT,DITDAH DAH_,DITDAH DIT_,
DITDAH _DIT_,DITDAH DIT_DAH DIT
DAH,DITDAH DAH_DIT DIT DAH;DAHDIT
DIT _DIT=DIT_DAH DIT 81 DAH,DIT_=_DIT
__DAH;_DIT==DAH_DIT DIT _DIT,81,stdin DAH&&(_DIT[strlen(_DIT)-1]='\0',_DIT);__DIT
DIT'\n'DAH DAH DAHDIT DIT DAH_=_DIT;DITDAH
DAH_;__DIT DIT DITDAH
_DIT_?_DAH DIT DITDAH DIT_ DAH:'?'DAH,__DIT
DIT' 'DAH,DAH_ __DAH DAH DAHDIT DIT
DITDAH DIT_=2,_DIT_=_DAH_; DITDAH _DIT_&&DIT
DITDAH _DIT_!=DIT DITDAH DAH_>='a'? DITDAH
DAH_&223:DITDAH DAH_ DAH DAH; DIT
DITDAH DIT_ DAH __DAH,_DIT_ __DAH DAH
DITDAH DIT_+= DIT DITDAH _DIT_>='a'? DITDAH _DIT_-'a':0
DAH;}_DAH DIT DIT_ DAH{ __DIT DIT
DIT_>3?_DAH DIT DIT_>>1 DAH:'\0'DAH;return
DIT_&1?'-':'.';}__DIT DIT DIT_ DAH _DAHDIT
DIT_;{DIT void DAH write DIT 1,&DIT_,1 DAH;}
+3
View File
@@ -0,0 +1,3 @@
IOCCC
International Obfuscated C Code Contest
Jim Hague
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# try.sh - demonstrate IOCCC winner 1986/hague
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to show input.txt: "
echo 1>&2
cat input.txt
echo 1>&2
read -r -n 1 -p "Press any key to feed input.txt to hague: "
echo 1>&2
./hague < input.txt
echo 1>&2
read -r -n 1 -p "Press any key to run: echo IOCCC | ./hague: "
echo 1>&2
echo IOCCC | ./hague
+3
View File
@@ -349,6 +349,9 @@ Cody also added the [try.sh](/1985/sicherman/try.sh) script.
[Cody](#cody) made this use `fgets()`.
Cody also added the [try.sh](1986/hague/try.sh) script which also feeds to the
program the added `input.txt` file.
## <a name="1986_holloway"></a>[1986/holloway](/1986/holloway/holloway.c) ([README.md](/1986/holloway/README.md]))