diff --git a/2000/dhyang/README.md b/2000/dhyang/README.md index d10c76ec8..1153d899c 100644 --- a/2000/dhyang/README.md +++ b/2000/dhyang/README.md @@ -15,20 +15,7 @@ make ### Try: ```sh -make saitou -./saitou > aku.c -cat aku.c - -make soku -./soku > soku.c -cat soku.c - -make zan -./zan > zan.c -cat zan.c - -make aku -./aku | diff - aku.c +./try.sh ``` @@ -53,9 +40,9 @@ them with cool layout! For your enjoyment: 1. Compile [dhyang.c](dhyang.c). -2. Run `./dhyang` and pipe output to another .c file -3. Compile that file -4. Repeat steps 2 and 3 until eventually the output cycles +2. Run `./dhyang` and pipe output to another `.c` file. +3. Compile that file. +4. Repeat steps 2 and 3 until eventually the output cycles. To interpret the output: the [dhyang.c](dhyang.c.c) is an image of Saitou Hajime, which eventually generates three sources files that are images of "aku diff --git a/2000/dhyang/dhyang.c b/2000/dhyang/dhyang.c index 34b00bf61..78ba7d8d8 100644 --- a/2000/dhyang/dhyang.c +++ b/2000/dhyang/dhyang.c @@ -47,7 +47,7 @@ x^(p?6:0):(p = 34 X X X ) ;}s(){for(x= n (); ( x^ ( p ?6:0))==32;x= n () ) ;return x ; } - void/**/main X () { r = p + int/**/main X () { r = p =0;w=sprintf (X X X X X X o ,"char*d="); for ( f=1;f < * d +143;)if(33-( b=d [ f++ X ] ) diff --git a/2000/dhyang/try.sh b/2000/dhyang/try.sh new file mode 100755 index 000000000..fdf9934d0 --- /dev/null +++ b/2000/dhyang/try.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2000/dhyang +# + +# 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 + + +echo "$ make saitou >/dev/null" 1>&2 +make saitou >/dev/null + +echo "$ ./saitou > aku.c" 1>&2 +./saitou > aku.c + +echo "$ cat aku.c" +cat aku.c + +echo "$ make soku >/dev/null" 1>&2 +make soku >/dev/null + +echo "$ ./soku > soku.c" 1>&2 +./soku > soku.c + +echo "$ cat soku.c" 1>&2 +cat soku.c + +echo "$ make zan >/dev/null" 1>&2 +make zan >/dev/null + +echo "$ ./zan > zan.c" 1>&2 +./zan > zan.c + +echo "$ cat zan.c" 1>&2 +cat zan.c + +echo "$ make aku >/dev/null" 1>&2 +make aku >/dev/null + +echo "$ ./aku | diff - aku.c" 1>&2 +./aku | diff - aku.c diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 6335b1a42..8564b8167 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -2265,6 +2265,13 @@ Cody fixed this to compile in systems that require one to explicitly link in `libm`. +## [2000/dhyang](2000/dhyang/dhyang.c) ([README.md](2000/dhyang/README.md])) + +Cody made this more portable by changing the `void main` to `int main`. + +He also added the [try.sh](2000/dhyang/try.sh) script. + + ## [2000/dlowe](2000/dlowe/dlowe.c) ([README.md](2000/dlowe/README.md])) Cody fixed this to compile with more recent perl versions; the symbol that's now