Merge pull request #2127 from xexyl/ferguson22020-try
Fix 2020/ferguson2/try scripts
This commit is contained in:
58 files changed
+760
-295
No files matched your search
@@ -9,3 +9,4 @@ prog
|
|||||||
prog.alt
|
prog.alt
|
||||||
prog.orig
|
prog.orig
|
||||||
spectrogram.png
|
spectrogram.png
|
||||||
|
*.wav
|
||||||
@@ -207,7 +207,7 @@ clean:
|
|||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
${RM} -rf *.dSYM
|
${RM} -rf *.dSYM *.wav
|
||||||
${RM} -f out.raw
|
${RM} -f out.raw
|
||||||
@-if [ -e sandwich ]; then \
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f sandwich; \
|
${RM} -f sandwich; \
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ make
|
|||||||
|
|
||||||
To use this entry requires, in some invocations, a sound processing program.
|
To use this entry requires, in some invocations, a sound processing program.
|
||||||
This can be ALSA or SoX but we recommend the latter. See [FAQ 3.10 - How do I
|
This can be ALSA or SoX but we recommend the latter. See [FAQ 3.10 - How do I
|
||||||
compile and use an IOCCC winner that requires sound?](/faq.md#faq3_10).
|
compile and use an IOCCC winner that requires sound?](/faq.md#sox).
|
||||||
|
|
||||||
|
|
||||||
### Bugs and (Mis)features:
|
### Bugs and (Mis)features:
|
||||||
@@ -23,9 +23,9 @@ For more detailed information see [2018 algmyr in bugs.md](/bugs.md#2018-algmyr)
|
|||||||
## To use:
|
## To use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cat prog.c | ./prog # Print garbage: might mess up your terminal
|
./prog < prog.c # Print garbage: might mess up your terminal
|
||||||
./prog <file1> <file2> > out.raw
|
./prog <file1> <file2> > out.raw
|
||||||
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
|
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+29
-15
@@ -15,46 +15,60 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ ./prog -h | ./prog -d 1 0" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog -h | ./prog -d 1 0: "
|
||||||
|
echo 1>&2
|
||||||
./prog -h | ./prog -d 1 0
|
./prog -h | ./prog -d 1 0
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
# Who needs cat? Answer: more people than you think.
|
# Who needs cat? Answer: more people than you think.
|
||||||
read -r -n 1 -p "Press any key to run: ./prog prog.c | ./prog -d 1 0 (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./prog prog.c | ./prog -d 1 0 (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog prog.c | ./prog -d 1 0 | less -EXF
|
./prog prog.c | ./prog -d 1 0 | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
APLAY="$(type -P aplay)"
|
APLAY="$(type -P aplay)"
|
||||||
SOX="$(type -P sox)"
|
SOX="$(type -P sox)"
|
||||||
|
|
||||||
if [[ -z "$SOX" && -z "$APLAY" ]]; then
|
if [[ -z "$SOX" && -z "$APLAY" ]]; then
|
||||||
echo "Missing both sox and aplay, cannot do this step."
|
echo "Missing both sox and aplay, cannot do this step." 1>&2
|
||||||
|
echo "NOTE: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
|
||||||
elif [[ -n "$SOX" ]]; then
|
elif [[ -n "$SOX" ]]; then
|
||||||
echo "$ echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog | \
|
echo "$ echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog | \
|
||||||
sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 \
|
$SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 \
|
||||||
- -n spectrogram -d 10 -X 300" 1>&2
|
- -n spectrogram -d 10 -X 300" 1>&2
|
||||||
echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog |\
|
echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog |\
|
||||||
sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - -n spectrogram -d 10 -X 300
|
$SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 - -n spectrogram -d 10 -X 300
|
||||||
|
|
||||||
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
|
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
|
||||||
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ echo "IOCCC 2018" | ./prog | sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav"
|
echo "$ echo \"IOCCC 2018\" | ./prog | $SOX -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav"
|
||||||
echo "IOCCC 2018" | ./prog | sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "IOCCC 2018" | ./prog | "$SOX" -t raw -c 1 -r 44100 -L -e floating-point -b 32 - ioccc.wav
|
||||||
echo "Now listen to ioccc.wav." 1>&2
|
echo "Now listen to ioccc.wav." 1>&2
|
||||||
|
|
||||||
else
|
else
|
||||||
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
|
echo "$ echo \"<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~\" |
|
||||||
./prog | aplay -c1 -fFLOAT_LE -r44100
|
./prog | $APLAY -c1 -fFLOAT_LE -r44100" 1>&2
|
||||||
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
./prog | aplay -c1 -fFLOAT_LE -r44100
|
echo 1>&2
|
||||||
|
echo "<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~" | ./prog | "$APLAY" -c1 -fFLOAT_LE -r44100
|
||||||
|
|
||||||
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
|
echo "Now open spectrogram.png in an image viewer or editor." 1>&2
|
||||||
fi
|
fi
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo "IOCCC 2018!" | ./prog | ./prog -d 1 0" 1>&2
|
read -r -n 1 -p "Press any key to run: echo \"IOCCC 2018!\" | ./prog | ./prog -d 1 0: "
|
||||||
|
echo 1>&2
|
||||||
echo "IOCCC 2018!" | ./prog | ./prog -d 1 0
|
echo "IOCCC 2018!" | ./prog | ./prog -d 1 0
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog README.md prog.c > out.raw: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog README.md prog.c > out.raw
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog -d 2 0 out.raw (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./prog -d 2 0 out.raw | less -rEXFK
|
||||||
|
echo 1>&2
|
||||||
Executable
+35
@@ -0,0 +1,35 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2018/anderson alt code
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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" alt >/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 run: ./prog.alt < prog.alt.c: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog.alt < prog.alt.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog.alt < prog.c: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog.alt < prog.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog.alt < README.md (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./prog.alt < README.md | less -rEXFK
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog.alt < Makefile (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./prog.alt < Makefile | less -rEXFK
|
||||||
@@ -27,9 +27,9 @@ echo 1>&2
|
|||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./prog < README.md (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./prog < README.md (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog < README.md | less -EXF
|
./prog < README.md | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./prog < Makefile (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./prog < Makefile (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog < Makefile | less -EXF
|
./prog < Makefile | less -rEXFK
|
||||||
+11
-9
@@ -17,18 +17,20 @@ code](#alternate-code) below.
|
|||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
First open [Lenna.png](Lenna.png) in your graphics viewer of choice. Next, after
|
||||||
eog lena.ppm # On Linux
|
running the above command (`./prog > lena.ppm`), open `lena.ppm` in your
|
||||||
open -a Preview lena.ppm # On macOS
|
graphics viewer of choice. After that try:
|
||||||
|
|
||||||
pngtopam < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpg
|
```sh
|
||||||
|
./try.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: `pngtopam(1)` (or `pngtopnm(1)` for older versions) and `pnmscale` come from
|
NOTE: the script uses the tools `pngtopam(1)` (or `pngtopnm(1)` for older
|
||||||
the netpbm project and `cjpeg(1)` comes from `libjpeg-turbo`. If you don't have
|
versions) and `pnmscale` come from the netpbm project and `cjpeg(1)` comes from
|
||||||
these tools already see [FAQ 3.15 - How do I compile and install netpbm for
|
`libjpeg-turbo`. If you don't have these tools already see [FAQ 3.15 - How do I
|
||||||
entries that require it?](/faq.md#netpbm) and [FAQ 3.16 - How do I compile and
|
compile and install netpbm for entries that require it?](/faq.md#netpbm) and
|
||||||
install libjpeg-turbo for entries that require it?](/faq.md#libjpeg).
|
[FAQ 3.16 - How do I compile and install libjpeg-turbo for entries that require
|
||||||
|
it?](/faq.md#libjpeg).
|
||||||
|
|
||||||
NOTE: [Lenna.png](Lenna.png) is from
|
NOTE: [Lenna.png](Lenna.png) is from
|
||||||
<https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png>.
|
<https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png>.
|
||||||
|
|||||||
Executable
+50
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2018/bellard
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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.
|
||||||
|
[[ -z "$CC" ]] && CC="cc"
|
||||||
|
|
||||||
|
make CC="$CC" all >/dev/null || exit 1
|
||||||
|
|
||||||
|
# clear screen after compilation so that only the entry is shown
|
||||||
|
clear
|
||||||
|
|
||||||
|
# find out if we have necessary tools
|
||||||
|
PNGTOPAM="$(type -P pngtopam)"
|
||||||
|
PNMSCALE="$(type -P pnmscale)"
|
||||||
|
PNGTOPNM="$(type -P pngtopnm)"
|
||||||
|
CJPEG="$(type -P cjpeg)"
|
||||||
|
|
||||||
|
rm -f small.jpg
|
||||||
|
|
||||||
|
if [[ -n "$PNGTOPAM" && -n "$PNMSCALE" && -n "$CJPEG" ]]; then
|
||||||
|
echo "$ $PNGTOPAM < Lenna.png | $PNMSCALE 0.25 | $CJPEG -arithmetic -dct float -quality 14 > small.jpg" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
"$PNGTOPAM" < Lenna.png | "$PNMSCALE" 0.25 | "$CJPEG" -arithmetic -dct float -quality 14 > small.jpg
|
||||||
|
if [[ -f small.jpg ]]; then
|
||||||
|
echo "Now open small.jpg in your graphics viewer of choice." 1>&2
|
||||||
|
fi
|
||||||
|
elif [[ -n "$PNGTOPNM" && -n "$PNMSCALE" && -n "$CJPEG" ]]; then
|
||||||
|
echo "$ $PNGTOPNM < Lenna.png | $PNMSCALE 0.25 | $CJPEG -arithmetic -dct float -quality 14 > small.jpg" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
"$PNGTOPNM" < Lenna.png | "$PNMSCALE" 0.25 | "$CJPEG" -arithmetic -dct float -quality 14 > small.jpg
|
||||||
|
if [[ -f small.jpg ]]; then
|
||||||
|
echo "Now open small.jpg in your graphics viewer of choice." 1>&2
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ -z "$PNGTOPAM" || -z "$PNGTOPNM" || "$PNMSCALE" ]]; then
|
||||||
|
echo "Cannot find pngtopam(1) or pnmscale(1). Try installing netpbm first." 1>&2
|
||||||
|
echo "See https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#netpbm" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
fi
|
||||||
|
if [[ -z "$CJPEG" ]]; then
|
||||||
|
echo "Cannot find cjpeg. Try installing libjpeg-turbo." 1>&2
|
||||||
|
echo "See https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#libjpeg." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
fi
|
||||||
+6
-6
@@ -13,27 +13,27 @@ fi
|
|||||||
make CC="$CC" everything >/dev/null || exit 1
|
make CC="$CC" everything >/dev/null || exit 1
|
||||||
|
|
||||||
for i in prog scripthd.sh; do
|
for i in prog scripthd.sh; do
|
||||||
echo "$ ./$i < prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: ./$i < prog.c: "
|
||||||
|
echo 1>&2
|
||||||
./"$i" < prog.c
|
./"$i" < prog.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./$i < prog (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./$i < prog (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./"$i" < prog | less -EXF
|
./"$i" < prog | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./$i < scripthd.sh (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./$i < scripthd.sh (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./"$i" < scripthd.sh | less -EXF
|
./"$i" < scripthd.sh | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: head $0 | ./$i: "
|
read -r -n 1 -p "Press any key to run: head $0 | ./$i: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
head "$0" | ./"$i"
|
head "$0" | ./"$i"
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: tail -n 15 Makefile | ./$i: "
|
read -r -n 1 -p "Press any key to run: tail -n 15 Makefile | ./$i (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
tail -n 15 Makefile | ./"$i"
|
tail -n 15 Makefile | ./"$i" | less -rEXFK
|
||||||
done
|
done
|
||||||
+10
-4
@@ -16,15 +16,21 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
clear
|
clear
|
||||||
|
|
||||||
|
|
||||||
echo "$ ./prog -i < prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog -i < prog.c: "
|
||||||
|
echo 1>&2
|
||||||
./prog -i < prog.c
|
./prog -i < prog.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog -s < prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog -s < prog.c: "
|
||||||
|
echo 1>&2
|
||||||
./prog -s < prog.c
|
./prog -s < prog.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog -sk < prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog -sk < prog.c: "
|
||||||
|
echo 1>&2
|
||||||
./prog -sk < prog.c
|
./prog -sk < prog.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: make test (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: make test (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
make test | less -EXF
|
make test | less -rEXFK
|
||||||
+4
-4
@@ -17,27 +17,27 @@ clear
|
|||||||
|
|
||||||
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EXF prog.c
|
less -rEXFK prog.c
|
||||||
echo "$ ./prog < prog.c > prog.gif" 1>&2
|
echo "$ ./prog < prog.c > prog.gif" 1>&2
|
||||||
./prog < prog.c > prog.gif
|
./prog < prog.c > prog.gif
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to show golem.txt (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show golem.txt (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EXF golem.txt
|
less -rEXFK golem.txt
|
||||||
echo "$ ./prog < golem.txt > golem.gif" 1>&2
|
echo "$ ./prog < golem.txt > golem.gif" 1>&2
|
||||||
./prog < golem.txt > golem.gif
|
./prog < golem.txt > golem.gif
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to show smily.txt (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show smily.txt (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EXF smily.txt
|
less -rEXFK smily.txt
|
||||||
echo "$ ./prog < smily.txt > smily.gif" 1>&2
|
echo "$ ./prog < smily.txt > smily.gif" 1>&2
|
||||||
./prog < smily.txt > smily.gif
|
./prog < smily.txt > smily.gif
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to show invisible.txt (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show invisible.txt (space = next page, q = quit): "
|
||||||
less -EXF invisible.txt
|
less -rEXFK invisible.txt
|
||||||
echo "$ ./prog < invisible.txt > invisible.gif" 1>&2
|
echo "$ ./prog < invisible.txt > invisible.gif" 1>&2
|
||||||
./prog < invisible.txt > invisible.gif
|
./prog < invisible.txt > invisible.gif
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|||||||
+4
-4
@@ -15,12 +15,12 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue (ctrl-c/intr = skip to next early, runs 20 seconds): "
|
read -r -n 1 -p "Press any key to continue (ctrl-c/intr = skip to next step early, runs 20 seconds): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./run.sh
|
./run.sh
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run a few times (ctrl-c/intr exits script): "
|
read -r -n 1 -p "Press any key to run a few times: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog | tee prog_next.c
|
./prog | tee prog_next.c
|
||||||
make prog_next
|
make prog_next
|
||||||
@@ -28,12 +28,12 @@ make prog_next
|
|||||||
make prog_next
|
make prog_next
|
||||||
./prog_next | tee prog_next.c
|
./prog_next | tee prog_next.c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to sleep 1 sec between runs (intr/ctrl-c to exit): "
|
read -r -n 1 -p "Press any key to sleep 1 sec between runs (intr/ctrl-c to stop): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./python.sh
|
./python.sh
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key run without sleeping (intr/ctrl-c to exit): "
|
read -r -n 1 -p "Press any key run without sleeping (intr/ctrl-c to stop): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./python3.sh
|
./python3.sh
|
||||||
|
|
||||||
|
|||||||
+19
-2
@@ -55,9 +55,26 @@ CSTD= -std=gnu17
|
|||||||
#
|
#
|
||||||
ARCH=
|
ARCH=
|
||||||
|
|
||||||
|
# Variables to help simplify configuring the build
|
||||||
|
#
|
||||||
|
|
||||||
|
# Maximum size of the target string defaults at 38. See README.md for why this
|
||||||
|
# is.
|
||||||
|
#
|
||||||
|
MAX_SIZE= 38
|
||||||
|
|
||||||
|
# Number of offspring per generation defaults at 25.
|
||||||
|
#
|
||||||
|
OFFSPRING= 25
|
||||||
|
|
||||||
|
# Max attempts defaults at SIZE_MAX - 1 but one can change it to see what
|
||||||
|
# happens when the maximum is reached.
|
||||||
|
MAX_ATTEMPTS= SIZE_MAX-1
|
||||||
|
|
||||||
# Defines that are needed to compile
|
# Defines that are needed to compile
|
||||||
#
|
#
|
||||||
CDEFINE= -DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'
|
CDEFINE= -DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' -DM=${MAX_ATTEMPTS} \
|
||||||
|
-DS=${MAX_SIZE} -DN=${OFFSPRING}
|
||||||
|
|
||||||
# Include files that are needed to compile
|
# Include files that are needed to compile
|
||||||
#
|
#
|
||||||
@@ -135,7 +152,7 @@ weasel: ${PROG}
|
|||||||
${CP} -f $< $@
|
${CP} -f $< $@
|
||||||
|
|
||||||
test: ${PROG} test.sh
|
test: ${PROG} test.sh
|
||||||
./test.sh
|
@./test.sh
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
|
|||||||
+107
-23
@@ -19,8 +19,24 @@ monkey Eric. See [Alternate code](#alternate-code) below.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
./try.sh
|
./try.sh
|
||||||
|
|
||||||
|
# For those who believe in '"intelligent" design' or want to see how easy it is
|
||||||
|
# to prove evolution is a proven fact:
|
||||||
|
./id.sh
|
||||||
|
|
||||||
|
# For those who want to see if Eric the monkey can type the word 'words' before
|
||||||
|
# falling asleep or giving up:
|
||||||
|
./monkey-words.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NOTE: the [try.sh](try.sh) script will run the other two scripts but if the
|
||||||
|
first one, [id.sh](id.sh) is terminated early in the try script, the second one,
|
||||||
|
[monkey-words.sh](monkey-words.sh) will not be run.
|
||||||
|
|
||||||
|
You can reconfigure certain values. These are described by the author in more
|
||||||
|
detail in the [S, M and N Constants](#constants) section. The script above will
|
||||||
|
make use of some of these.
|
||||||
|
|
||||||
|
|
||||||
## Alternate code:
|
## Alternate code:
|
||||||
|
|
||||||
@@ -45,8 +61,33 @@ Use `weasel.alt` as you would `weasel` above.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
./try.alt.sh
|
./try.alt.sh
|
||||||
|
|
||||||
|
# For those who believe in '"intelligent" design' or want to see how easy it is
|
||||||
|
# to prove evolution is a proven fact:
|
||||||
|
./id.alt.sh
|
||||||
|
|
||||||
|
# For those who want to see if Eric the monkey can type the word 'words' before
|
||||||
|
# falling asleep or giving up:
|
||||||
|
./monkey-words.alt.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NOTE: the [try.alt.sh](try.alt.sh) script will run the other two scripts but if the
|
||||||
|
first one, [id.alt.sh](id.alt.sh) is terminated early in the try script, the second one,
|
||||||
|
[monkey-words.alt.sh](monkey-words.alt.sh) will not be run.
|
||||||
|
|
||||||
|
You can reconfigure certain values. These are described by the author in more
|
||||||
|
detail in the [S, M and N Constants](#constants) section. The script above will
|
||||||
|
make use of some of these.
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./try.alt.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
You can reconfigure certain values. These are described by the author in more
|
||||||
|
detail in the [S, M and N Constants](#constants) section. The script above will
|
||||||
|
make use of some of these.
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
@@ -131,9 +172,10 @@ don't need this unless there is something specific you're after.
|
|||||||
**[Obfuscation](#obfuscation):** Some of the techniques that might not be used.
|
**[Obfuscation](#obfuscation):** Some of the techniques that might not be used.
|
||||||
|
|
||||||
**[How to build](#build):** Here I describe briefly
|
**[How to build](#build):** Here I describe briefly
|
||||||
[the constants that can be redefined](#constants) `S` and `N`: the
|
[the constants that can be redefined](#constants) `S`, `M` and `N`: the
|
||||||
maximum size of the chromosome (target string; the maximum length is `S - 1`
|
maximum size of the chromosome (target string; the maximum length is `S - 1`
|
||||||
but it must be >= the default 38) and the number of offspring, respectively. I
|
but it must be >= the default 38), the number of maximum attempts before giving
|
||||||
|
up and the number of offspring, respectively. I
|
||||||
also give [example compiler invocations](#compiling), [portability
|
also give [example compiler invocations](#compiling), [portability
|
||||||
notes](#portability), an [more portability notes](#bugs) and a [note on
|
notes](#portability), an [more portability notes](#bugs) and a [note on
|
||||||
rpm.md](#rpm).
|
rpm.md](#rpm).
|
||||||
@@ -865,21 +907,24 @@ be made clear in the comments! :)*
|
|||||||
|
|
||||||
## **5. <a name="build">How to build</a>**
|
## **5. <a name="build">How to build</a>**
|
||||||
|
|
||||||
### <a name="constants">S and N Constants</a>
|
### <a name="constants">S, M and N Constants</a>
|
||||||
|
|
||||||
Skip to [Compilation](#compiling).
|
Skip to [Compilation](#compiling).
|
||||||
|
|
||||||
These two `#define`d constants can be redefined at compilation to modify the
|
There are three `#define`d constants that can be redefined at compilation to modify the
|
||||||
behaviour of the program in a number of ways (see the
|
behaviour of the program in a number of ways (see the
|
||||||
**[Compilation](#compiling)** subsection for example invocations). Both are
|
**[Compilation](#compiling)** subsection for example invocations). Both are
|
||||||
capped to be no greater than `SIZE_MAX - 1`. This is handled by the C
|
capped to be no greater than `SIZE_MAX - 1` or whatever `M` (which can't be
|
||||||
preprocessor.
|
lower than 100) is set to (maximum attempts before giving up). This is handled
|
||||||
|
by the C preprocessor.
|
||||||
|
|
||||||
`S`
|
|
||||||
|
|
||||||
This determines the maximum size of the target string but it **must be at least
|
* `S`
|
||||||
38**; this is because `38 >= 29` and because `strlen("METHINKS IT IS LIKE
|
|
||||||
A WEASEL") == 28` (which is the default target string - it would hardly be an
|
The macro `S` (or `MAX_SIZE` in the Makefile) is the maximum size of the target
|
||||||
|
string but it **must be at least 38** (which is protected against in the code);
|
||||||
|
this is because `38 >= 29` and because `strlen("METHINKS IT IS LIKE A WEASEL")
|
||||||
|
== 28` (which is the default target string - it would hardly be an
|
||||||
implementation of the Weasel program otherwise).
|
implementation of the Weasel program otherwise).
|
||||||
|
|
||||||
There is obviously a reason `38` is the chosen size but the only hints I
|
There is obviously a reason `38` is the chosen size but the only hints I
|
||||||
@@ -888,14 +933,43 @@ referenced there (it's *not the only Easter egg* but it's the only Easter egg I
|
|||||||
won't spoil; yes this ironically and amusingly means I've left a rotten egg
|
won't spoil; yes this ironically and amusingly means I've left a rotten egg
|
||||||
somewhere!).
|
somewhere!).
|
||||||
|
|
||||||
`N`
|
The Makefile simplifies how to reconfigure this value with the variable
|
||||||
|
`MAX_SIZE`:
|
||||||
|
|
||||||
This is the number of offspring per generation. Anything less than 4 will be set
|
```sh
|
||||||
to 3 (that's not a typo!) and this is part of an Easter egg.
|
make clobber MAX_SIZE=55 all
|
||||||
|
```
|
||||||
|
|
||||||
|
The next macro that can be reconfigured, `M` (or `MAX_ATTEMPTS` in the
|
||||||
|
Makefile), is the maximum attempts before giving up. This was added as another
|
||||||
|
feature in 2024 but it was not made an alt version because there already is an
|
||||||
|
alt version. This macro allows for seeing what happens when reaching the maximum
|
||||||
|
number attempts without waiting for a very long time.
|
||||||
|
|
||||||
|
The Makefile simplifies how to reconfigure this value with the variable
|
||||||
|
`MAX_ATTEMPTS`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make clobber MAX_ATTEMPTS=100 all
|
||||||
|
```
|
||||||
|
|
||||||
|
The final macro, `N` (or `OFFSPRING` in the Makefile), is the number of offspring
|
||||||
|
per generation.
|
||||||
|
|
||||||
|
Anything less than 4 will be set to 3 (that's not a typo!) and this is part of
|
||||||
|
an Easter egg.
|
||||||
|
|
||||||
|
Be aware that depending on the size of `S` (`MAX_SIZE`) and `N` (`OFFSPRING`)
|
||||||
|
both individually and together the program will use varying amounts of memory
|
||||||
|
and the larger the values the more memory it'll require.
|
||||||
|
|
||||||
|
The Makefile simplifies how to reconfigure this value with the variable
|
||||||
|
`OFFSPRING`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make clobber OFFSPRING=55 all
|
||||||
|
```
|
||||||
|
|
||||||
Be aware that depending on the size of `S` and `N` (individually and
|
|
||||||
together) the program will use varying amounts of memory and the larger the
|
|
||||||
values the more memory it'll require.
|
|
||||||
|
|
||||||
### <a name="compiling">Compilation</a>
|
### <a name="compiling">Compilation</a>
|
||||||
|
|
||||||
@@ -907,23 +981,33 @@ The following options **must always be passed to the compiler:**
|
|||||||
-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'
|
-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to increase the number of offspring to `50` and the size of the
|
which running `make` will always do.
|
||||||
chromosome to `75` you would pass to the compiler:
|
|
||||||
|
|
||||||
|
If you want to increase the number of offspring to `50` (`N`) and the size of the
|
||||||
|
chromosome to `75` (`S`) you would do:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' -DN=50 -DS=75
|
make clobber OFFSPRING=50 MAX_SIZE=75 everything
|
||||||
```
|
```
|
||||||
|
|
||||||
If you wanted to change `N` to `3`:
|
If you wanted to change `N` to `3`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)' -DN=3
|
make clobber OFFSPRING=3 everything
|
||||||
```
|
```
|
||||||
|
|
||||||
Remember that it cannot be less than `3`; *more correctly if it's less than
|
Remember that it cannot be less than `3`; *more correctly if it's less than
|
||||||
4 it's redefined to 3* so you could have passed in `-DN=2` and have the same
|
4 it's redefined to 3* so you could have passed in `-DN=2` (or `MAX_SIZE=2`) and have the same
|
||||||
result. Remember too that `S` cannot be less than `38`. Both `S` and
|
result. Remember too that `S` (`MAX_SIZE`) cannot be less than `38`. Both `S` and
|
||||||
`N` are capped at `SIZE_MAX - 1`.
|
`N` are capped at `SIZE_MAX - 1` or whatever `M` (`MAX_ATTEMPTS`) is set to.
|
||||||
|
|
||||||
|
If you wanted to change the maximum number attempts to 100 you could do:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make clobber MAX_ATTEMPTS=100 everything
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### <a name="portability">Portability</a>
|
### <a name="portability">Portability</a>
|
||||||
|
|
||||||
|
|||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# id.alt.sh - determine exactly how real '"intelligent" design' is with alt code
|
||||||
|
#
|
||||||
|
|
||||||
|
# limit to 250000 attempts to save them time if they really wish to try and
|
||||||
|
# prove that '"intelligent" design' is real (or more correctly so that they
|
||||||
|
# might last long enough in the try scripts to move on to the next step)
|
||||||
|
make -B MAX_ATTEMPTS=250000 everything >/dev/null || exit 1
|
||||||
|
|
||||||
|
read -r -p "Do you wish to try and prove '\"intelligent\" design' (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
echo "$ ./weasel.alt -m 'INTELLIGENT DESIGN'" 1>&2
|
||||||
|
echo "Limiting to 250000 attempts to save you time." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
echo "Press any key to continue. Send ctrl-c when convinced that intelligent" 1>&2
|
||||||
|
read -r -n 1 -p "design is not real or you're tired of waiting: "
|
||||||
|
echo 1>&2
|
||||||
|
./weasel.alt -m 'INTELLIGENT DESIGN'
|
||||||
|
echo 1>&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
read -r -n 1 -p "Press any key to run: time ./weasel.alt -r8 'EVOLUTION IS A PROVEN FACT': "
|
||||||
|
echo 1>&2
|
||||||
|
time ./weasel.alt -r8 'EVOLUTION IS A PROVEN FACT'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# id.sh - determine exactly how real '"intelligent" design' is
|
||||||
|
#
|
||||||
|
|
||||||
|
# limit to 250000 attempts to save them time if they really wish to try and
|
||||||
|
# prove that '"intelligent" design' is real (or more correctly so that they
|
||||||
|
# might last long enough in the try scripts to move on to the next step)
|
||||||
|
make -B MAX_ATTEMPTS=250000 everything >/dev/null || exit 1
|
||||||
|
|
||||||
|
read -r -p "Do you wish to try and prove '\"intelligent\" design' (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
echo "$ ./weasel -m 'INTELLIGENT DESIGN'" 1>&2
|
||||||
|
echo "Limiting to 250000 attempts to save you time." 1>&2
|
||||||
|
echo "Press any key to continue. Send ctrl-c when convinced that intelligent" 1>&2
|
||||||
|
read -r -n 1 -p "design is not real or you're tired of waiting: "
|
||||||
|
./weasel -m 'INTELLIGENT DESIGN'
|
||||||
|
echo 1>&2
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "$ ./weasel -r8 'EVOLUTION IS A PROVEN FACT'" 1>&2
|
||||||
|
time ./weasel -r8 'EVOLUTION IS A PROVEN FACT'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# monkey-words.sh - try and get Eric the monkey to type 'words'.
|
||||||
|
#
|
||||||
|
echo 1>&2
|
||||||
|
make -B MAX_ATTEMPTS=SIZE_MAX-1 >/dev/null || exit 1
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Do you want to see how long it might take the monkey Eric to type 'words'? (Y/N)? "
|
||||||
|
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
||||||
|
echo 1>&2
|
||||||
|
echo "Will let Eric try until he succeeds, gives up or he falls asleep." 1>&2
|
||||||
|
echo "Hit ctrl-c/intr to let him nap early." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
time ./weasel -m words
|
||||||
|
fi
|
||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# monkey-words.sh - try and get Eric the monkey to type 'words'.
|
||||||
|
#
|
||||||
|
echo 1>&2
|
||||||
|
make -B MAX_ATTEMPTS=SIZE_MAX-1 >/dev/null || exit 1
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Do you want to see how long it might take the monkey Eric to type 'words'? (Y/N)? "
|
||||||
|
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
||||||
|
echo 1>&2
|
||||||
|
echo "Will let Eric try until he succeeds, gives up or he falls asleep." 1>&2
|
||||||
|
echo "Hit ctrl-c/intr to let him nap early." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
time ./weasel -m words
|
||||||
|
fi
|
||||||
@@ -7,7 +7,12 @@
|
|||||||
Q unsigned d; Q char E; Q int k;
|
Q unsigned d; Q char E; Q int k;
|
||||||
Q long u; Q size_t t; Q const char U;
|
Q long u; Q size_t t; Q const char U;
|
||||||
#define L toupper
|
#define L toupper
|
||||||
|
#ifndef M
|
||||||
#define M SIZE_MAX-1
|
#define M SIZE_MAX-1
|
||||||
|
#elif M < 100
|
||||||
|
#undef M
|
||||||
|
#define M SIZE_MAX-1
|
||||||
|
#endif
|
||||||
#ifndef S
|
#ifndef S
|
||||||
#define S 38
|
#define S 38
|
||||||
#elif S < 38
|
#elif S < 38
|
||||||
|
|||||||
@@ -7,7 +7,12 @@
|
|||||||
Q unsigned d; Q char E; Q int k;
|
Q unsigned d; Q char E; Q int k;
|
||||||
Q long u; Q size_t t; Q const char U;
|
Q long u; Q size_t t; Q const char U;
|
||||||
#define L toupper
|
#define L toupper
|
||||||
|
#ifndef M
|
||||||
#define M SIZE_MAX-1
|
#define M SIZE_MAX-1
|
||||||
|
#elif M < 100
|
||||||
|
#undef M
|
||||||
|
#define M SIZE_MAX-1
|
||||||
|
#endif
|
||||||
#ifndef S
|
#ifndef S
|
||||||
#define S 38
|
#define S 38
|
||||||
#elif S < 38
|
#elif S < 38
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ STOP MONKEYING ABOUT!
|
|||||||
WHAT DO YOU MEAN I'M A MONKEY?!
|
WHAT DO YOU MEAN I'M A MONKEY?!
|
||||||
PROBLEM BETWEEN KEYBOARD AND CHAIR
|
PROBLEM BETWEEN KEYBOARD AND CHAIR
|
||||||
MY PRECIOUS. YES, MY PRECIOUS.
|
MY PRECIOUS. YES, MY PRECIOUS.
|
||||||
MY PRECIOUS! O MY PRECIOUS!
|
MY PRECIOUS! O MY PRECIOUS! PRECIOUS
|
||||||
IOCCC BEST USE OF WEASEL WORDS
|
IOCCC BEST USE OF WEASEL WORDS
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# test.sh - make test script for IOCCC winner 2018/ferguson
|
||||||
|
|
||||||
# Make sure the program has been compiled
|
# Make sure the program has been compiled
|
||||||
make everything 1> /dev/null|| exit 1
|
make everything 1> /dev/null|| exit 1
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run tests (space = next page, G = end, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
while read -r f; do
|
while read -r f; do
|
||||||
./weasel "$@" "${f}" # full line because of quotes
|
# NOTE: ./weasel $* $f would just be the final word. We quote it for the
|
||||||
# NOTE: ./weasel $* $f would just be the final word
|
# full line:
|
||||||
sleep 2
|
./weasel "$@" "${f}" | less -rEXFK
|
||||||
done < test-strings.txt || exit 1
|
done < test-strings.txt || exit 1
|
||||||
|
|
||||||
echo "All done. Goodbye, you old monkeying weasel!"
|
echo "All done. Goodbye, you old monkeying weasel!"
|
||||||
+37
-26
@@ -10,43 +10,54 @@ if [[ -z "$CC" ]]; then
|
|||||||
CC="cc"
|
CC="cc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make CC="$CC" alt >/dev/null || exit 1
|
make CC="$CC" everything >/dev/null || exit 1
|
||||||
|
|
||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./weasel.alt words (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./weasel.alt words (space = next page, q = quit, G = end): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
time ./weasel.alt words | less -EXF
|
time ./weasel.alt words | less -rEXFK
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to see how long it'll take Eric the monkey to type his name: "
|
read -r -n 1 -p "Press any key to see how long it'll take Eric the monkey to type his name: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
time ./weasel.alt -mq Eric
|
time ./weasel.alt -mq Eric
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: make test: "
|
read -r -p "Do you want to run make test (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
make test
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -r -p "Do you wish to see the undocumented Easter egg (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
make -B OFFSPRING=97 everything 1>/dev/null || exit 1
|
||||||
|
read -r -n 1 -p "Press any key to show Easter egg (./weasel.alt): "
|
||||||
|
echo 1>&2
|
||||||
|
./weasel.alt
|
||||||
|
echo 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
make test
|
read -r -n 1 -p "Press any key to change max attempts to 100: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ make -B MAX_ATTEMPTS=100 everything >/dev/null || exit 1" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
make -B MAX_ATTEMPTS=100 everything >/dev/null || exit 1
|
||||||
|
read -r -n 1 -p "Press any key to see what happens when the maximum attempts are reached: "
|
||||||
|
echo 1>&2
|
||||||
|
./weasel.alt -m 'Eric the Monkey'
|
||||||
|
|
||||||
read -r -p "Do you wish to try and prove 'intelligent design' (Y/N)? "
|
# recompile with default max attempts for the next steps
|
||||||
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
make -B everything >/dev/null || exit 1
|
||||||
echo "$ ./weasel.alt -m 'INTELLIGENT DESIGN'" 1>&2
|
|
||||||
echo "Press any key to continue. Send ctrl-c when convinced that intelligent" 1>&2
|
|
||||||
read -r -n 1 -p "design is not real or you're tired of waiting: "
|
|
||||||
echo 1>&2
|
|
||||||
time ./weasel.alt -m 'INTELLIGENT DESIGN'
|
|
||||||
echo 1>&2
|
|
||||||
else
|
|
||||||
echo "$ ./weasel.alt -q -r8 'EVOLUTION IS A PROVEN FACT'" 1>&2
|
|
||||||
time ./weasel.alt -q -r8 'EVOLUTION IS A PROVEN FACT'
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -r -n 1 -p "Do you want to see how long it might take the monkey Eric to type 'words'? (Y/N)? "
|
# obviously '"intelligent" design' is false but who wants to try and prove
|
||||||
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
# otherwise? Or if they know better how long will it take to show that evolution
|
||||||
echo 1>&2
|
# is a proven fact?
|
||||||
echo "Will not display until Eric succeeds or too many generations. Hit ctrl-c" 1>&2
|
./id.alt.sh
|
||||||
echo "to stop him early." 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
# If the user did not try and prove '"intelligent" design' or they waited a
|
||||||
echo 1>&2
|
# long time (though saving them some time by limiting it to 900000 attempts) I
|
||||||
time ./weasel.alt -mq words
|
# ask: can Eric the monkey type the word 'words' before falling asleep or
|
||||||
fi
|
# getting too hungry to continue?
|
||||||
|
./monkey-words.alt.sh
|
||||||
+36
-25
@@ -15,38 +15,49 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./weasel words (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./weasel words (space = next page, q = quit, G = end): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
time ./weasel words | less -EXF
|
time ./weasel words | less -rEXFK
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to see how long it'll take Eric the monkey to type his name: "
|
read -r -n 1 -p "Press any key to see how long it'll take Eric the monkey to type his name: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
time ./weasel -mq Eric
|
time ./weasel -mq Eric
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: make test: "
|
read -r -p "Do you want to run make test (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
make test
|
||||||
|
fi
|
||||||
|
|
||||||
|
read -r -p "Do you wish to see the undocumented Easter egg (Y/N)? "
|
||||||
|
if [[ "$REPLY" = "Y" || "$REPLY" = "y" ]]; then
|
||||||
|
make -B OFFSPRING=97 everything 1>/dev/null || exit 1
|
||||||
|
read -r -n 1 -p "Press any key to show Easter egg (./weasel): "
|
||||||
|
echo 1>&2
|
||||||
|
./weasel
|
||||||
|
echo 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
make test
|
read -r -n 1 -p "Press any key to change max attempts to 100: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ make -B MAX_ATTEMPTS=100 everything >/dev/null || exit 1" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
make -B MAX_ATTEMPTS=100 everything >/dev/null || exit 1
|
||||||
|
read -r -n 1 -p "Press any key to see what happens when the maximum attempts are reached: "
|
||||||
|
echo 1>&2
|
||||||
|
./weasel -m 'Eric the Monkey'
|
||||||
|
|
||||||
read -r -p "Do you wish to try and prove 'intelligent design' (Y/N)? "
|
# recompile with default max attempts for the next steps
|
||||||
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
make -B everything >/dev/null || exit 1
|
||||||
echo "$ ./weasel -m 'INTELLIGENT DESIGN'" 1>&2
|
|
||||||
echo "Press any key to continue. Send ctrl-c when convinced that intelligent" 1>&2
|
|
||||||
read -r -n 1 -p "design is not real or you're tired of waiting: "
|
|
||||||
echo 1>&2
|
|
||||||
time ./weasel -m 'INTELLIGENT DESIGN'
|
|
||||||
echo 1>&2
|
|
||||||
else
|
|
||||||
echo "$ ./weasel -q -r8 'EVOLUTION IS A PROVEN FACT'" 1>&2
|
|
||||||
time ./weasel -q -r8 'EVOLUTION IS A PROVEN FACT'
|
|
||||||
fi
|
|
||||||
|
|
||||||
read -r -n 1 -p "Do you want to see how long it might take the monkey Eric to type 'words'? (Y/N)? "
|
# obviously '"intelligent" design' is false but who wants to try and prove
|
||||||
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
# otherwise? Or if they know better how long will it take to show that evolution
|
||||||
echo 1>&2
|
# is a proven fact?
|
||||||
echo "Will not display until Eric succeeds or too many generations. Hit ctrl-c" 1>&2
|
./id.sh
|
||||||
echo "to stop him early." 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
# If the user did not try and prove '"intelligent" design' or they waited a
|
||||||
echo 1>&2
|
# long time (though saving them some time by limiting it to 900000 attempts) I
|
||||||
time ./weasel -mq words
|
# ask: can Eric the monkey type the word 'words' before falling asleep or
|
||||||
fi
|
# getting too hungry to continue?
|
||||||
|
./monkey-words.sh
|
||||||
@@ -1,16 +1,12 @@
|
|||||||
#
|
#
|
||||||
# sort with: sort -d -u
|
# sort with: sort -d -u
|
||||||
*.dSYM
|
*.dSYM
|
||||||
generated1.c
|
generated*
|
||||||
generated2.c
|
|
||||||
generated3.c
|
|
||||||
generated4.c
|
|
||||||
generated5.c
|
|
||||||
indent
|
indent
|
||||||
indent.c
|
indent.c
|
||||||
indent.o
|
indent.o
|
||||||
left
|
left
|
||||||
msg[0-9]
|
msg*
|
||||||
no_leading_space.txt
|
no_leading_space.txt
|
||||||
prog
|
prog
|
||||||
prog.orig
|
prog.orig
|
||||||
|
|||||||
+1
-1
@@ -324,7 +324,7 @@ clean:
|
|||||||
clobber: clean
|
clobber: clean
|
||||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
${RM} -f ${TARGET} ${ALT_TARGET}
|
||||||
${RM} -rf *.dSYM
|
${RM} -rf *.dSYM
|
||||||
${RM} -f generated*.c msg*
|
${RM} -f generated* msg*
|
||||||
@-if [ -e sandwich ]; then \
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f sandwich; \
|
${RM} -f sandwich; \
|
||||||
echo 'ate sandwich'; \
|
echo 'ate sandwich'; \
|
||||||
|
|||||||
@@ -80,4 +80,9 @@ if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
|
|||||||
read -r -n 1 -p "Press any key to run: ./msg9 < prog.c: "
|
read -r -n 1 -p "Press any key to run: ./msg9 < prog.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./msg9 < prog.c
|
./msg9 < prog.c
|
||||||
|
|
||||||
|
make generated1 1>/dev/null || exit 1
|
||||||
|
read -r -n 1 -p "Press any key to run: echo IOCCC | ./generated1: "
|
||||||
|
echo 1>&2
|
||||||
|
echo IOCCC | ./generated1
|
||||||
fi
|
fi
|
||||||
@@ -15,19 +15,17 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog spam.unl | head -n 100 (space = next page, q =quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./prog spam.unl | head -n 100 | less -EXF" 1>&2
|
./prog spam.unl | head -n 100 | less -rEXFK
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
|
||||||
./prog spam.unl | head -n 100 | less -EXF
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog sierpinski.unl | head -n 200 | less -EXF" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog sierpinski.unl | head -n 200 (space = next page, q = quit): "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog sierpinski.unl | head -n 200 | less -EXF
|
./prog sierpinski.unl | head -n 200 | less -rEXFK
|
||||||
|
|
||||||
echo "$ make identify" 1>&2
|
read -r -n 1 -p "Press any key to run: make identify: "
|
||||||
|
echo 1>&2
|
||||||
make identify
|
make identify
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,11 @@ echo | $x
|
|||||||
/bin/echo -n a | $x
|
/bin/echo -n a | $x
|
||||||
echo a | $x
|
echo a | $x
|
||||||
$x < newlines
|
$x < newlines
|
||||||
# ^---^ SC2210 (warning): This is a file redirection. Was it supposed to be a comparison or fd operation?
|
# 256 is a file so it is supposed to be file redirection. Thus we have to
|
||||||
# Answer: 256 is a file so it is supposed to be file redirection.
|
# disable this warning:
|
||||||
|
#
|
||||||
|
# SC2210 (warning): This is a file redirection. Was it supposed to be a comparison or fd operation?
|
||||||
|
# https://www.shellcheck.net/wiki/SC2210
|
||||||
# shellcheck disable=SC2210
|
# shellcheck disable=SC2210
|
||||||
$x < 256
|
$x < 256
|
||||||
$x < remarks
|
$x < remarks
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@ do if test -r "$name"; then
|
|||||||
# (or, to use Bart Simpson's advice, make it 'not have a cow.sh'), as we
|
# (or, to use Bart Simpson's advice, make it 'not have a cow.sh'), as we
|
||||||
# actually need this to happen:
|
# actually need this to happen:
|
||||||
#
|
#
|
||||||
# ^-- SC2086 (info): Double quote to prevent globbing and word splitting.
|
# SC2086 (info): Double quote to prevent globbing and word splitting.
|
||||||
#
|
# https://www.shellcheck.net/wiki/SC2086
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
set -- $s
|
set -- $s
|
||||||
((a += $1))
|
((a += $1))
|
||||||
|
|||||||
+7
-3
@@ -15,15 +15,19 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ cat prog.c" 1>&2
|
read -r -n 1 -p "Press any key to show prog.c: "
|
||||||
|
echo 1>&2
|
||||||
cat prog.c
|
cat prog.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
for i in prog.c Makefile README.md; do
|
for i in prog.c Makefile README.md; do
|
||||||
echo "$ ./prog < $i && wc < $i" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog < $i && wc < $i: "
|
||||||
|
echo 1>&2
|
||||||
printf "prog: %s\n%4s: %s\n\n" "$(./prog < "$i"|tr -s ' ')" "wc" "$(wc "$i" | tr -s ' ')"
|
printf "prog: %s\n%4s: %s\n\n" "$(./prog < "$i"|tr -s ' ')" "wc" "$(wc "$i" | tr -s ' ')"
|
||||||
done
|
done
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ make test" 1>&2
|
read -r -n 1 -p "Press any key to run: make test: "
|
||||||
|
echo 1>&2
|
||||||
make test
|
make test
|
||||||
|
echo 1>&2
|
||||||
Executable
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -x
|
||||||
|
./getwords.sh fr | ./prog.alt aàâbcdeéèêfghiîjklmnoôpqrstuùûvwxyz\'
|
||||||
@@ -15,22 +15,24 @@ make CC="$CC" everything >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz: "
|
echo "$ ./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz"
|
||||||
./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz | less -EXF
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz" 1>&2
|
echo "$ ./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz | less -EXF
|
./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz | less -rEXFK
|
||||||
|
|
||||||
echo "$ ./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
echo "$ ./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256 | less -EXF
|
./getwords.sh en | grep .. | ./prog.alt mrjocktvquizphdbagsfewlynx | head -n 256 | less -rEXFK
|
||||||
|
|
||||||
|
|
||||||
echo "$ ./en.alt.sh" 1>&2
|
echo "$ ./en.alt.sh" 1>&2
|
||||||
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
./en.alt.sh | less -EXF
|
echo 1>&2
|
||||||
|
./en.alt.sh | less -rEXFK
|
||||||
+7
-5
@@ -15,22 +15,24 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./getwords.sh en | grep .. | ./prog aeiouvwxyz: "
|
echo "$ ./getwords.sh en | grep .. | ./prog aeiouvwxyz"
|
||||||
./getwords.sh en | grep .. | ./prog aeiouvwxyz | less -EXF
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./getwords.sh en | grep .. | ./prog aeiouvwxyz | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz" 1>&2
|
echo "$ ./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz | less -EXF
|
./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz | less -rEXFK
|
||||||
|
|
||||||
echo "$ ./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
echo "$ ./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256 | less -EXF
|
./getwords.sh en | grep .. | ./prog mrjocktvquizphdbagsfewlynx | head -n 256 | less -rEXFK
|
||||||
|
|
||||||
|
|
||||||
echo "$ ./en.sh" 1>&2
|
echo "$ ./en.sh" 1>&2
|
||||||
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
echo "There will likely be a lot of output. Quit when bored. No logophiles will be hurt." 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
./en.sh | less -EXF
|
./en.sh | less -rEXFK
|
||||||
@@ -15,34 +15,43 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ dd bs=1024 count=2048 < /dev/zero | compress > ref.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: dd bs=1024 count=2048 < /dev/zero | compress > ref.Z: "
|
||||||
|
echo 1>&2
|
||||||
dd bs=1024 count=2048 < /dev/zero | compress > ref.Z
|
dd bs=1024 count=2048 < /dev/zero | compress > ref.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z
|
dd bs=1024 count=2048 < /dev/zero | ./prog > dg1.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cmp ref.Z dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: cmp ref.Z dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
cmp ref.Z dg1.Z
|
cmp ref.Z dg1.Z
|
||||||
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ compress < Shakespeare.txt > ref.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: compress < Shakespeare.txt > ref.Z: "
|
||||||
|
echo 1>&2
|
||||||
compress < Shakespeare.txt > ref.Z
|
compress < Shakespeare.txt > ref.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog < Shakespeare.txt > dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog < Shakespeare.txt > dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
./prog < Shakespeare.txt > dg1.Z
|
./prog < Shakespeare.txt > dg1.Z
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "Notice how the files differ:" 1>&2
|
echo "Notice how the two files differ:" 1>&2
|
||||||
echo "$ cmp ref.Z dg1.Z" 1>&2
|
read -r -n 1 -p "Press any key to run: cmp ref.Z dg1.Z: "
|
||||||
|
echo 1>&2
|
||||||
cmp ref.Z dg1.Z # Oops, the files differ
|
cmp ref.Z dg1.Z # Oops, the files differ
|
||||||
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "... and notice how this works fine:" 1>&2
|
echo "... and notice how this works fine:" 1>&2
|
||||||
echo "$ zcat < dg1.Z | cmp - Shakespeare.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: zcat < dg1.Z | cmp - Shakespeare.txt: "
|
||||||
|
echo 1>&2
|
||||||
zcat < dg1.Z | cmp - Shakespeare.txt
|
zcat < dg1.Z | cmp - Shakespeare.txt
|
||||||
|
echo "Exit code of zcat < dg1.Z | cmp - Shakespeare.txt: ${PIPESTATUS[1]}"
|
||||||
|
echo 1>&2
|
||||||
echo "What happened?"
|
echo "What happened?"
|
||||||
+33
-19
@@ -19,54 +19,68 @@ SHA512SUM="$(type -P sha512sum)"
|
|||||||
SHASUM="$(type -P shasum)"
|
SHASUM="$(type -P shasum)"
|
||||||
|
|
||||||
if [[ -z "$SHA512SUM" && -z "$SHASUM" ]]; then
|
if [[ -z "$SHA512SUM" && -z "$SHASUM" ]]; then
|
||||||
echo "$ ./prog" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog: "
|
||||||
|
echo 1>&2
|
||||||
./prog
|
./prog
|
||||||
|
echo 1>&2
|
||||||
elif [[ -n "$SHA512SUM" ]]; then
|
elif [[ -n "$SHA512SUM" ]]; then
|
||||||
echo "$ $SHA512SUM prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: $SHA512SUM prog.c: "
|
||||||
|
echo 1>&2
|
||||||
"$SHA512SUM" prog.c
|
"$SHA512SUM" prog.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog: "
|
||||||
|
echo 1>&2
|
||||||
./prog
|
./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ $SHA512SUM prog.c | cut -f 1 -d' ' > sha512sum.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: $SHA512SUM prog.c | cut -f 1 -d' ' | tee sha512sum.txt: "
|
||||||
"$SHA512SUM" prog.c | cut -f 1 -d' ' > sha512sum.txt
|
echo 1>&2
|
||||||
echo "$ ./prog > prog.txt" 1>&2
|
"$SHA512SUM" prog.c | cut -f 1 -d' ' | tee sha512sum.txt
|
||||||
./prog > prog.txt
|
read -r -n 1 -p "Press any key to run: ./prog | tee prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog | tee prog.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat sha512sum.txt prog.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: cat sha512sum.txt prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
cat sha512sum.txt prog.txt
|
cat sha512sum.txt prog.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ diff -s sha512sum.txt prog.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: diff -s sha512sum.txt prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
diff -s sha512sum.txt prog.txt
|
diff -s sha512sum.txt prog.txt
|
||||||
rm -f sha512sum prog.txt
|
rm -f sha512sum prog.txt
|
||||||
|
|
||||||
elif [[ -n "$SHASUM" ]]; then
|
elif [[ -n "$SHASUM" ]]; then
|
||||||
# Be extra careful and don't use 'else'
|
# Be extra careful and don't use 'else'
|
||||||
echo "$ $SHASUM -a 512 prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: $SHASUM -a 512 prog.c: "
|
||||||
|
echo 1>&2
|
||||||
"$SHASUM" -a 512 prog.c
|
"$SHASUM" -a 512 prog.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog: "
|
||||||
|
echo 1>&2
|
||||||
./prog
|
./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ $SHASUM -a 512 prog.c | cut -f 1 -d' ' > sha512sum.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: $SHASUM -a 512 prog.c | cut -f 1 -d' ' | tee sha512sum.txt: "
|
||||||
"$SHASUM" -a 512 prog.c | cut -f 1 -d' ' > sha512sum.txt
|
echo 1>&2
|
||||||
echo "$ ./prog > prog.txt" 1>&2
|
"$SHASUM" -a 512 prog.c | cut -f 1 -d' ' | tee sha512sum.txt
|
||||||
./prog > prog.txt
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat sha512sum.txt prog.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog | tee prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog | tee prog.txt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: cat sha512sum.txt prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
cat sha512sum.txt prog.txt
|
cat sha512sum.txt prog.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ diff -s sha512sum.txt prog.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: diff -s sha512sum.txt prog.txt: "
|
||||||
|
echo 1>&2
|
||||||
diff -s sha512sum.txt prog.txt
|
diff -s sha512sum.txt prog.txt
|
||||||
rm -f sha512sum prog.txt
|
rm -f sha512sum prog.txt
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
@@ -43,5 +43,7 @@ for i in glider.mc infinite_5x5.mc mosquito5.mc message.mc; do
|
|||||||
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
|
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog < $i: "
|
||||||
|
echo 1>&2
|
||||||
./prog < "$i" 2>/dev/null
|
./prog < "$i" 2>/dev/null
|
||||||
done
|
done
|
||||||
+5
-2
@@ -35,9 +35,12 @@ echo 1>&2
|
|||||||
"$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii | less -rEXF
|
"$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii | less -rEXF
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
echo "$ $GDB -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii > prog2.c" 1>&2
|
||||||
read -r -n 1 -p "Press any key to compare reconstructed code with original: "
|
read -r -n 1 -p "Press any key to compare reconstructed code with original: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ "$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii > prog2.c" 1>&2
|
|
||||||
"$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii > prog2.c
|
"$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii > prog2.c
|
||||||
echo "$ diff -s prog.c prog2.c" 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: diff -s prog.c prog2.c: "
|
||||||
|
echo 1>&2
|
||||||
diff -s prog.c prog2.c
|
diff -s prog.c prog2.c
|
||||||
@@ -15,15 +15,13 @@ make
|
|||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
play MonodyVocals.wav
|
./try.sh
|
||||||
./prog MonodyVocals.wav
|
|
||||||
play out.wav
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
NOTE: `play` comes from SoX, the Swiss Army Knife of sound processing programs.
|
NOTE: `play`, which [try.sh](try.sh) uses, comes from SoX, the Swiss Army Knife
|
||||||
If you don't have this installed, see [FAQ 3.10: How do I compile and use an
|
of sound processing programs. If you don't have this installed, see [FAQ 3.10:
|
||||||
IOCCC winner that requires sound](/faq.md#faq3_10).
|
How do I compile and use an IOCCC winner that requires sound](/faq.md#faq3_10).
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|||||||
Executable
+40
@@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2019/giles
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# find out if SoX is installed
|
||||||
|
PLAY="$(type -P play)"
|
||||||
|
|
||||||
|
if [[ -n "$PLAY" ]]; then
|
||||||
|
read -r -n 1 -p "Press any key to run: $PLAY MonodyVocals.wav: "
|
||||||
|
echo 1>&2
|
||||||
|
"$PLAY" MonodyVocals.wav
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./prog MonodyVocals.wav: "
|
||||||
|
echo 1>&2
|
||||||
|
./prog MonodyVocals.wav
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: $PLAY MonodyVocals.wav: "
|
||||||
|
echo 1>&2
|
||||||
|
"$PLAY" MonodyVocals.wav
|
||||||
|
echo 1>&2
|
||||||
|
else
|
||||||
|
echo "play(1) from SoX not installed." 1>&2
|
||||||
|
echo "NOTE: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
|
||||||
|
fi
|
||||||
|
|
||||||
+6
-3
@@ -16,8 +16,9 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
clear
|
clear
|
||||||
|
|
||||||
# display prog.c to the user
|
# display prog.c to the user
|
||||||
echo "$ cat prog.c"
|
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
|
||||||
cat prog.c
|
echo 1>&2
|
||||||
|
less -rEXFK prog.c
|
||||||
|
|
||||||
# run the program on its own source code
|
# run the program on its own source code
|
||||||
read -r -n 1 -p "Press any key to run: ./prog < prog.c: "
|
read -r -n 1 -p "Press any key to run: ./prog < prog.c: "
|
||||||
@@ -28,7 +29,9 @@ echo 1>&2
|
|||||||
reset
|
reset
|
||||||
|
|
||||||
# display maze
|
# display maze
|
||||||
echo "$ cat maze"
|
read -r -n 1 -p "Press any key to run: cat maze: "
|
||||||
|
echo 1>&2
|
||||||
|
# Role swap: cat in maze instead of mice
|
||||||
cat maze
|
cat maze
|
||||||
|
|
||||||
# run the program on maze
|
# run the program on maze
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ include ../../var.mk
|
|||||||
|
|
||||||
# Common C compiler warnings to silence
|
# Common C compiler warnings to silence
|
||||||
#
|
#
|
||||||
CSILENCE= -Wno-strict-prototypes
|
CSILENCE= -Wno-strict-prototypes -Wno-comment
|
||||||
|
|
||||||
# Common C compiler warning flags
|
# Common C compiler warning flags
|
||||||
#
|
#
|
||||||
|
|||||||
+27
-17
@@ -15,31 +15,42 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ (./prog < fib.hs; cat prog.c) > fib.c" 1>&2
|
echo "$ (./prog < fib.hs; cat prog.c) | tee fib.c" 1>&2
|
||||||
(./prog < fib.hs; cat prog.c) > fib.c
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo "$ cc -Wno-everything fib.c -o fib" 1>&2
|
(./prog < fib.hs; cat prog.c) | tee fib.c | less -rEXFK
|
||||||
cc -Wno-everything fib.c -o fib
|
|
||||||
echo "$ ./fib" 1>&2
|
read -r -n 1 -p "Press any key to run: make fib: "
|
||||||
./fib
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
make CC="$CC" fib
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ (./prog < lol.hs ; cat prog.c) > lol.c" 1>&2
|
read -r -n 1 -p "Press any key to run: ./fib: "
|
||||||
(./prog < lol.hs ; cat prog.c) > lol.c
|
echo 1>&2
|
||||||
echo "$ make lol" 1>&2
|
./fib
|
||||||
make lol
|
|
||||||
|
echo "$ (./prog < lol.hs ; cat prog.c) | tee lol.c" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
|
(./prog < lol.hs ; cat prog.c) | tee lol.c | less -rEXFK
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: make lol: " 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
make CC="$CC" lol
|
||||||
read -r -n 1 -p "Press any key to run: ./lol: "
|
read -r -n 1 -p "Press any key to run: ./lol: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./lol
|
./lol
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ (./prog < scc.hs ; cat prog.c) > scc.c" 1>&2
|
echo "$ (./prog < scc.hs ; cat prog.c) | tee scc.c" 1>&2
|
||||||
(./prog < scc.hs ; cat prog.c) > scc.c
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo "$ make scc" 1>&2
|
echo 1>&2
|
||||||
make scc
|
(./prog < scc.hs ; cat prog.c) | tee scc.c | less -rEXFK
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: make scc: "
|
||||||
|
echo 1>&2
|
||||||
|
make CC="$CC" scc
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./scc < example-1.txt: "
|
read -r -n 1 -p "Press any key to run: ./scc < example-1.txt: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./scc < example-1.txt
|
./scc < example-1.txt
|
||||||
@@ -47,6 +58,5 @@ read -r -n 1 -p "Press any key to run: ./scc < example-2.txt: "
|
|||||||
echo 1>&2
|
echo 1>&2
|
||||||
./scc < example-2.txt
|
./scc < example-2.txt
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
+5
-6
@@ -18,17 +18,16 @@ echo 1>&2
|
|||||||
echo "This may take a while:"
|
echo "This may take a while:"
|
||||||
make test-64bit
|
make test-64bit
|
||||||
|
|
||||||
|
|
||||||
echo "$ less IOCCC-Rules-Guidelines.output.txt" 1>&2
|
echo "$ less IOCCC-Rules-Guidelines.output.txt" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -rEXF IOCCC-Rules-Guidelines.output.txt
|
less -rEXFK IOCCC-Rules-Guidelines.output.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ less IOCCC-hints.output.txt" 1>&2
|
echo "$ less IOCCC-hints.output.txt" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -rEXF IOCCC-hints.output.txt
|
less -rEXFK IOCCC-hints.output.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ less Eugene_Onegin.output.txt" 1>&2
|
echo "$ less Eugene_Onegin.output.txt" 1>&2
|
||||||
@@ -36,17 +35,17 @@ echo "You should be able to safely ignore the warnings about this file" 1>&2
|
|||||||
echo "being a binary file." 1>&2
|
echo "being a binary file." 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -rEXF Eugene_Onegin.output.txt
|
less -rEXFK Eugene_Onegin.output.txt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog < IOCCC-Rules-Guidelines.cp98_0.175 |head -n 100"
|
echo "$ ./prog < IOCCC-Rules-Guidelines.cp98_0.175 |head -n 100"
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog < IOCCC-Rules-Guidelines.cp98_0.175 |head -n 100
|
./prog < IOCCC-Rules-Guidelines.cp98_0.175 |head -n 100 | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ ./prog < Shakespeare.cp04_1.633 | head -n 100" 1>&2
|
echo "$ ./prog < Shakespeare.cp04_1.633 | head -n 100" 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog < Shakespeare.cp04_1.633 | head -n 100
|
./prog < Shakespeare.cp04_1.633 | head -n 100 | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -19,22 +19,21 @@ make clobber CC="$CC" alt >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ ./prog.alt 512 ./prog.alt" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog.alt 512 ./prog.alt (space = next page, q = quit): "
|
||||||
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog.alt 512 ./prog.alt | less -rEXF
|
./prog.alt 512 ./prog.alt | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ TZ=UTC24 make CC="$CC" clobber prog.alt" 1>&2
|
echo "$ TZ=UTC24 make CC="$CC" clobber prog.alt" 1>&2
|
||||||
TZ=UTC24 make CC="$CC" clobber prog.alt || exit 1
|
TZ=UTC24 make CC="$CC" clobber prog.alt || exit 1
|
||||||
read -r -n 1 -p "Press any key to run: ./prog.alt 512 ./prog.alt (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./prog.alt 512 ./prog.alt (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog.alt 512 ./prog.alt | less -rEXF
|
./prog.alt 512 ./prog.alt | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ TZ=UTC48 make CC="$CC" clobber prog.alt" 1>&2
|
echo "$ TZ=UTC48 make CC="$CC" clobber prog.alt" 1>&2
|
||||||
TZ=UTC48 make CC="$CC" clobber prog.alt || exit 1
|
TZ=UTC48 make CC="$CC" clobber prog.alt || exit 1
|
||||||
read -r -n 1 -p "Press any key to run: ./prog.alt 512 ./prog.alt (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./prog.alt 512 ./prog.alt: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog.alt 512 ./prog.alt | less -rEXF
|
./prog.alt 512 ./prog.alt
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
+2
-3
@@ -20,13 +20,12 @@ make clobber CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ ./prog 512 ./prog" 1>&2
|
read -r -n 1 -p "Press any key to run: ./prog 512 ./prog: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog 512 ./prog
|
./prog 512 ./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ TZ=UTC24 make CC="$CC" clobber prog" 1>&2
|
echo "$ TZ=UTC24 make CC=$CC clobber prog" 1>&2
|
||||||
TZ=UTC24 make CC="$CC" clobber prog || exit 1
|
TZ=UTC24 make CC="$CC" clobber prog || exit 1
|
||||||
read -r -n 1 -p "Press any key to run: ./prog 512 ./prog: "
|
read -r -n 1 -p "Press any key to run: ./prog 512 ./prog: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|||||||
+27
-25
@@ -15,28 +15,28 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
|
echo "$ ./prog ioccc.txt a b c d e" 1>&2
|
||||||
read -r -n 1 -p "Press any key to scramble ioccc.txt into five files: "
|
read -r -n 1 -p "Press any key to scramble ioccc.txt into five files: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./prog ioccc.txt a b c d e" 1>&2
|
|
||||||
./prog ioccc.txt a b c d e
|
./prog ioccc.txt a b c d e
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part a with cat: "
|
read -r -n 1 -p "Press any key to unscramble part a with: cat a: "
|
||||||
clear
|
clear
|
||||||
cat a
|
cat a
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part b with cat: "
|
read -r -n 1 -p "Press any key to unscramble part b with: cat b: "
|
||||||
clear
|
clear
|
||||||
cat b
|
cat b
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part c with cat: "
|
read -r -n 1 -p "Press any key to unscramble part c with: cat c: "
|
||||||
clear
|
clear
|
||||||
cat c
|
cat c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part d with cat: "
|
read -r -n 1 -p "Press any key to unscramble part d with: cat d: "
|
||||||
clear
|
clear
|
||||||
cat d
|
cat d
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part e with cat: "
|
read -r -n 1 -p "Press any key to unscramble part e with: cat e: "
|
||||||
clear
|
clear
|
||||||
cat e
|
cat e
|
||||||
|
|
||||||
@@ -46,8 +46,7 @@ echo 1>&2
|
|||||||
cat a b c d e | ./prog
|
cat a b c d e | ./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat a b c d e | ./prog | diff - ioccc.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - ioccc.txt: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat a b c d e | ./prog | diff -s - ioccc.txt
|
cat a b c d e | ./prog | diff -s - ioccc.txt
|
||||||
|
|
||||||
@@ -58,28 +57,29 @@ if [[ "$COLS" -lt 75 || "$LINES" -lt 13 ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to scramble sample_input.txt into five files: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./prog sample_input.txt a b c d e" 1>&2
|
echo "$ ./prog sample_input.txt a b c d e" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to scramble sample_input.txt into five files: "
|
||||||
|
echo 1>&2
|
||||||
./prog sample_input.txt a b c d e
|
./prog sample_input.txt a b c d e
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part a with cat: "
|
read -r -n 1 -p "Press any key to unscramble part a with: cat a: "
|
||||||
clear
|
clear
|
||||||
cat a
|
cat a
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part b with cat: "
|
read -r -n 1 -p "Press any key to unscramble part b with: cat b: "
|
||||||
clear
|
clear
|
||||||
cat b
|
cat b
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part c with cat: "
|
read -r -n 1 -p "Press any key to unscramble part c with: cat c: "
|
||||||
clear
|
clear
|
||||||
cat c
|
cat c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part d with cat: "
|
read -r -n 1 -p "Press any key to unscramble part d with: cat d: "
|
||||||
clear
|
clear
|
||||||
cat d
|
cat d
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part e with cat: "
|
read -r -n 1 -p "Press any key to unscramble part e with: cat e: "
|
||||||
clear
|
clear
|
||||||
cat e
|
cat e
|
||||||
|
|
||||||
@@ -89,11 +89,10 @@ echo 1>&2
|
|||||||
cat a b c d e | ./prog
|
cat a b c d e | ./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat a b c d e | ./prog | diff - sample_input.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - sample_input.txt: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat a b c d e | ./prog | diff -s - sample_input.txt
|
cat a b c d e | ./prog | diff -s - sample_input.txt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
if [[ "$COLS" -lt 80 || "$LINES" -lt 25 ]]; then
|
if [[ "$COLS" -lt 80 || "$LINES" -lt 25 ]]; then
|
||||||
# if screen size < 80 x 25 then exit
|
# if screen size < 80 x 25 then exit
|
||||||
@@ -105,28 +104,28 @@ echo 1>&2
|
|||||||
cat prog.c
|
cat prog.c
|
||||||
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
echo "$ ./prog prog.c a b c d e" 1>&2
|
||||||
read -r -n 1 -p "Press any key to scramble prog.c into five files: "
|
read -r -n 1 -p "Press any key to scramble prog.c into five files: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./prog prog.c a b c d e" 1>&2
|
|
||||||
./prog prog.c a b c d e
|
./prog prog.c a b c d e
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part a with cat: "
|
read -r -n 1 -p "Press any key to unscramble part a with: cat a: "
|
||||||
clear
|
clear
|
||||||
cat a
|
cat a
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part b with cat: "
|
read -r -n 1 -p "Press any key to unscramble part b with: cat b: "
|
||||||
clear
|
clear
|
||||||
cat b
|
cat b
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part c with cat: "
|
read -r -n 1 -p "Press any key to unscramble part c with: cat c: "
|
||||||
clear
|
clear
|
||||||
cat c
|
cat c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part d with cat: "
|
read -r -n 1 -p "Press any key to unscramble part d with: cat d: "
|
||||||
clear
|
clear
|
||||||
cat d
|
cat d
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to unscramble part e with cat: "
|
read -r -n 1 -p "Press any key to unscramble part e with: cat e: "
|
||||||
clear
|
clear
|
||||||
cat e
|
cat e
|
||||||
|
|
||||||
@@ -136,16 +135,17 @@ echo 1>&2
|
|||||||
cat a b c d e | ./prog
|
cat a b c d e | ./prog
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat a b c d e | ./prog | diff - prog.c" 1>&2
|
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - prog.c: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat a b c d e | ./prog | diff -s - prog.c
|
cat a b c d e | ./prog | diff -s - prog.c
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
# For the next three we have to see if ruby is installed
|
# For the next three we have to see if ruby is installed
|
||||||
RUBY="$(type -P ruby)"
|
RUBY="$(type -P ruby)"
|
||||||
|
|
||||||
if [[ -n "$RUBY" ]]; then
|
if [[ -n "$RUBY" ]]; then
|
||||||
read -r -p "Do you want to see the slow scrambling: ./prog prog.c | ruby prog.c (Y/N)? "
|
read -r -p "Do you want to see the slow scrambling: ./prog prog.c | ruby prog.c (Y/N)? "
|
||||||
|
echo 1>&2
|
||||||
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
||||||
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -153,6 +153,7 @@ if [[ -n "$RUBY" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
read -r -p "Do you want to see the slow scrambling: ./prog violet.c | ruby prog.c (Y/N)? "
|
read -r -p "Do you want to see the slow scrambling: ./prog violet.c | ruby prog.c (Y/N)? "
|
||||||
|
echo 1>&2
|
||||||
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
||||||
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -160,6 +161,7 @@ if [[ -n "$RUBY" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
read -r -p "Do you want to see the slow scrambling: ./prog violet.c | ruby violet.c (Y/N)? "
|
read -r -p "Do you want to see the slow scrambling: ./prog violet.c | ruby violet.c (Y/N)? "
|
||||||
|
echo 1>&2
|
||||||
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
if [[ "$REPLY" == "y" || "$REPLY" == "Y" ]]; then
|
||||||
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
echo "This may take a while, hit ctrl-c to exit script." 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|||||||
+3
-1
@@ -15,7 +15,8 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
|
|
||||||
echo "$ make test" 1>&2
|
read -r -n 1 -p "Press any key to run: make test: "
|
||||||
|
echo 1>&2
|
||||||
make test
|
make test
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
@@ -75,3 +76,4 @@ echo 1>&2
|
|||||||
read -r -n 1 -p "Press any key to run: ./prog 1; ./prog_be 1: "
|
read -r -n 1 -p "Press any key to run: ./prog 1; ./prog_be 1: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./prog 1; ./prog_be 1
|
./prog 1; ./prog_be 1
|
||||||
|
echo 1>&2
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
#
|
#
|
||||||
# sort with: sort -d -u
|
# sort with: sort -d -u
|
||||||
clock
|
clock
|
||||||
|
clock.alt
|
||||||
|
clock.alt.c
|
||||||
clock.c
|
clock.c
|
||||||
*.dSYM
|
*.dSYM
|
||||||
indent
|
indent
|
||||||
|
|||||||
+10
-2
@@ -113,8 +113,8 @@ OBJ= ${PROG}.o
|
|||||||
DATA=
|
DATA=
|
||||||
TARGET= ${PROG} clock
|
TARGET= ${PROG} clock
|
||||||
#
|
#
|
||||||
ALT_OBJ= ${PROG}.alt.o
|
ALT_OBJ= ${PROG}.alt.o clock.alt.o
|
||||||
ALT_TARGET= ${PROG}.alt
|
ALT_TARGET= ${PROG}.alt clock.alt
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@@ -146,6 +146,14 @@ alt: data ${ALT_TARGET}
|
|||||||
${PROG}.alt: ${PROG}.alt.c
|
${PROG}.alt: ${PROG}.alt.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
|
clock.alt: clock.alt.c
|
||||||
|
|
||||||
|
clock.alt.c: ${PROG}.alt.c
|
||||||
|
@${RM} -f $@
|
||||||
|
${CP} -f $< $@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# data files
|
# data files
|
||||||
#
|
#
|
||||||
data: ${DATA}
|
data: ${DATA}
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ make alt
|
|||||||
Use `prog.alt` as you would `prog` above.
|
Use `prog.alt` as you would `prog` above.
|
||||||
|
|
||||||
|
|
||||||
|
### Alternate try:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./run_clock.alt
|
||||||
|
# And watch closely for 15-20 seconds
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
You may be tempted to use a mirror. Resist the temptation! Try figuring out how
|
You may be tempted to use a mirror. Resist the temptation! Try figuring out how
|
||||||
|
|||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
make -B clock.alt || exit 1
|
||||||
|
while true; do
|
||||||
|
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.alt.c -o clock.alt
|
||||||
|
clear
|
||||||
|
./clock.alt | tee clock.alt.c
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
make -B clock || exit 1
|
||||||
while true; do
|
while true; do
|
||||||
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.c -o clock
|
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.c -o clock
|
||||||
clear
|
clear
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ if [[ -z "$CC" ]]; then
|
|||||||
CC="cc"
|
CC="cc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make CC="$CC" alt >/dev/null || exit 1
|
make CC="$CC" everything >/dev/null || exit 1
|
||||||
|
|
||||||
# clear screen after compilation so that only the entry is shown
|
# clear screen after compilation so that only the entry is shown
|
||||||
clear
|
clear
|
||||||
@@ -138,6 +138,5 @@ echo 1>&2
|
|||||||
read -r -n 1 -p "Press any key to compare input and output2: "
|
read -r -n 1 -p "Press any key to compare input and output2: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
diff -s input output2
|
diff -s input output2
|
||||||
diff -s input output2
|
|
||||||
# final clean up
|
# final clean up
|
||||||
rm -f conf input output output2
|
rm -f conf input output output2
|
||||||
@@ -138,6 +138,5 @@ echo 1>&2
|
|||||||
read -r -n 1 -p "Press any key to compare input and output2: "
|
read -r -n 1 -p "Press any key to compare input and output2: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
diff -s input output2
|
diff -s input output2
|
||||||
diff -s input output2
|
|
||||||
# final clean up
|
# final clean up
|
||||||
rm -f conf input output output2
|
rm -f conf input output output2
|
||||||
@@ -1249,7 +1249,7 @@ for downloading, installing and using ncurses.
|
|||||||
We recommend trying a method suitable for your environment first, if possible.
|
We recommend trying a method suitable for your environment first, if possible.
|
||||||
|
|
||||||
|
|
||||||
### <a name="faq3_10"></a>FAQ 3.10: How do I compile and use an IOCCC winner that requires sound?
|
### <a name="faq3_10"></a><a name="sox"></a>FAQ 3.10: How do I compile and use an IOCCC winner that requires sound?
|
||||||
|
|
||||||
This might depend on the entry but most likely the Swiss Army Knife of sound
|
This might depend on the entry but most likely the Swiss Army Knife of sound
|
||||||
processing programs, [SoX](https://sox.sourceforge.net), will work. How to
|
processing programs, [SoX](https://sox.sourceforge.net), will work. How to
|
||||||
|
|||||||
+22
-6
@@ -4352,7 +4352,8 @@ He also added the [try.sh](/2015/yang/try.sh) script.
|
|||||||
|
|
||||||
## <a name="2018_anderson"></a>[2018/anderson](/2018/anderson/prog.c) ([README.md](/2018/anderson/README.md))
|
## <a name="2018_anderson"></a>[2018/anderson](/2018/anderson/prog.c) ([README.md](/2018/anderson/README.md))
|
||||||
|
|
||||||
[Cody](#cody) added the [try.sh](/2018/anderson/try.sh) script.
|
[Cody](#cody) added the [try.sh](/2018/anderson/try.sh) and
|
||||||
|
[try.alt.sh](/2018/anderson/try.alt.sh) scripts.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2018_algmyr"></a>[2018/algmyr](/2018/algmyr/prog.c) ([README.md](/2018/algmyr/README.md))
|
## <a name="2018_algmyr"></a>[2018/algmyr](/2018/algmyr/prog.c) ([README.md](/2018/algmyr/README.md))
|
||||||
@@ -4363,11 +4364,13 @@ He also added the [try.sh](/2015/yang/try.sh) script.
|
|||||||
|
|
||||||
## <a name="2018_bellard"></a>[2018/bellard](/2018/bellard/prog.c) ([README.md](/2018/bellard/README.md))
|
## <a name="2018_bellard"></a>[2018/bellard](/2018/bellard/prog.c) ([README.md](/2018/bellard/README.md))
|
||||||
|
|
||||||
[Cody](#cody), out of abundance of caution, added a second arg to `main()`
|
[Cody](#cody) added the [try.sh](/2018/bellard/try.sh) script.
|
||||||
because some versions of clang object to the number of args of `main()`, saying
|
|
||||||
that it must be 0, 2 or 3. The version this has been observed in does not
|
Cody also, out of abundance of caution, added a second arg to `main()` because
|
||||||
actually object to 1 arg but it is entirely possible that this changes so a
|
some versions of clang object to the number of args of `main()`, saying that it
|
||||||
second arg (that's not needed and is unused) has been added just in case.
|
must be 0, 2 or 3. The version this has been observed in does not actually
|
||||||
|
object to 1 arg but it is entirely possible that this changes so a second arg
|
||||||
|
(that's not needed and is unused) has been added just in case.
|
||||||
|
|
||||||
Cody also added explicit linking of libm (`-lm`) for systems that do not do this
|
Cody also added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
(Linux doesn't seem to but macOS does).
|
(Linux doesn't seem to but macOS does).
|
||||||
@@ -4620,6 +4623,11 @@ to easily reconstruct the source code through GDB by the fact it's a backtrace
|
|||||||
quine.
|
quine.
|
||||||
|
|
||||||
|
|
||||||
|
## <a name="2019_giles"></a>[2019/giles](/2019/giles/prog.c) ([README.md](/2019/giles/README.md]))
|
||||||
|
|
||||||
|
[Cody](#cody) added the [try.sh](/2019/giles/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2019_karns"></a>[2019/karns](/2019/karns/prog.c) ([README.md](/2019/karns/README.md]))
|
## <a name="2019_karns"></a>[2019/karns](/2019/karns/prog.c) ([README.md](/2019/karns/README.md]))
|
||||||
|
|
||||||
[Cody](#cody) reported that with `-O` level > 0 this program segfaults (sometimes?). He's
|
[Cody](#cody) reported that with `-O` level > 0 this program segfaults (sometimes?). He's
|
||||||
@@ -4729,6 +4737,10 @@ What was wrong? A typo in the shebang which had `/usr/bin/end` instead of
|
|||||||
`/usr/bin/env`. Anyone who knows Cody would know that he'd zoom in on that quite
|
`/usr/bin/env`. Anyone who knows Cody would know that he'd zoom in on that quite
|
||||||
quick.
|
quick.
|
||||||
|
|
||||||
|
Also if `clock` did not exist and one tried to run the script it would make an
|
||||||
|
invalid `clock.c` which meant it could not compile so it now runs `make clock`
|
||||||
|
first.
|
||||||
|
|
||||||
Cody also reported (during the preview period of 2020) for some systems (at some
|
Cody also reported (during the preview period of 2020) for some systems (at some
|
||||||
point?) like macOS the use of `make clock` would not work due possibly to a
|
point?) like macOS the use of `make clock` would not work due possibly to a
|
||||||
timing issue so [Yusuke](#yusuke) changed it to compile the
|
timing issue so [Yusuke](#yusuke) changed it to compile the
|
||||||
@@ -4740,6 +4752,10 @@ that if someone moves something of his even a millimetre from where it was he
|
|||||||
knows it so he might be called unusual (and he argues, with pride, eccentric :-)
|
knows it so he might be called unusual (and he argues, with pride, eccentric :-)
|
||||||
) :-)
|
) :-)
|
||||||
|
|
||||||
|
Cody also added the [run_clock.alt.sh](/2020/endoh3/run_clock.alt.sh) script
|
||||||
|
which is analogous to the [run_clock.sh](/2020/endoh3/run_clock.sh) but for the
|
||||||
|
alt code provided by the author, Yusuke.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2020_ferguson1"></a>[2020/ferguson1](/2020/ferguson1/prog.c) ([README.md](/2020/ferguson1/README.md))
|
## <a name="2020_ferguson1"></a>[2020/ferguson1](/2020/ferguson1/prog.c) ([README.md](/2020/ferguson1/README.md))
|
||||||
|
|
||||||
|
|||||||
+23
-25
@@ -1,30 +1,28 @@
|
|||||||
# A todo list of known things to check and/or do
|
# A todo list of known things to check and/or do
|
||||||
*Last updated: Thu 11 Jan 2024 16:42:28 UTC*
|
*Last updated: Wed 31 Jan 2024 12:22:09 UTC*
|
||||||
|
|
||||||
This document is primarily for [Cody Boone
|
This document is for [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) as
|
||||||
Ferguson](/winners.html#Cody_Boone_Ferguson) as he (that is I :-) ) wanted a way
|
he (that is I :-) ) wanted a way to keep track of things in a way that did not
|
||||||
to keep track of things in a way that did not require the information getting
|
require the information getting lost in the thousands of changes in the repo and
|
||||||
lost in the thousands of changes in the repo and because it might be too much to
|
because it might be too much to add to the todo list in the issues themselves.
|
||||||
add to the todo list in the issues themselves.
|
|
||||||
|
|
||||||
More things will likely be added over time and as items are done they _should
|
More things will likely be added over time and as items are done they _should
|
||||||
be_ removed from the list IF AND ONLY IF (!!) we are _absolutely certain_ it is
|
be_ removed from the list IF AND ONLY IF (!!) we are _absolutely certain_ it is
|
||||||
done (many times it's thought that a task was done only to find out it wasn't).
|
done (many times it's thought that a task was done only to find out it wasn't).
|
||||||
It is hoped that this will be referenced and updated as this is an easy way to
|
|
||||||
keep track of things that have been done already and what hasn't been done (in
|
Every so often this file is checked and updated to remove items and when
|
||||||
this file the case is mostly _NOT_ been done).
|
something needs to be done is thought of it is also updated unless it can be
|
||||||
|
done right then and there or it seems more appropriate to add to the issue (#3)
|
||||||
|
todo list.
|
||||||
|
|
||||||
- Typo fix ALL markdown files. For the README.md files the entries have all been
|
- Typo fix ALL markdown files. For the README.md files the entries have all been
|
||||||
done (along with format fixes) but the YYYY/README.md files have not been
|
done (along with format fixes) but the YYYY/README.md files have not been
|
||||||
completed. See below item for details on that (several items in this file refer
|
completed.
|
||||||
to those).
|
* Go through all year README.md files: that is 1984/README.md,
|
||||||
|
1985/README.md and so on. As of **Mon 16 Oct 11:22:52 UTC 2023** the
|
||||||
- Go through all year README.md files: that is 1984/README.md, 1985/README.md and
|
following years have had a first pass: 1984 through 2001. However there are
|
||||||
so on. As of **Mon 16 Oct 11:22:52 UTC 2023** the following years have had a
|
changes that might be required in those years too so a pass over all of them
|
||||||
first pass: 1984 through 2001. However there are changes that are required
|
will have to be done at the time the files are to be reviewed.
|
||||||
namely to do with email addresses that no longer exist. At this point it is not
|
|
||||||
determined if this will be done with the typo pass (what should be the final
|
|
||||||
pass) or not but it's very possible that it can be just to speed things along.
|
|
||||||
|
|
||||||
- Check the [GitHub issue #3 comment
|
- Check the [GitHub issue #3 comment
|
||||||
1615962832](https://github.com/ioccc-src/temp-test-ioccc/issues/3#issuecomment-1615962832)
|
1615962832](https://github.com/ioccc-src/temp-test-ioccc/issues/3#issuecomment-1615962832)
|
||||||
@@ -38,13 +36,13 @@ embedded into the README.md files themselves. An entry that the video file is
|
|||||||
downloaded already is 2006/sykes1. There are others that I need to look at once
|
downloaded already is 2006/sykes1. There are others that I need to look at once
|
||||||
the rest of the entries are done, assuming that it's possible.
|
the rest of the entries are done, assuming that it's possible.
|
||||||
|
|
||||||
- Although I will have to do this when another issue is opened up I am aware of
|
|
||||||
some issues in 2020/ferguson1/.winner.json. I do not want to forget this,
|
|
||||||
however, so I am noting it here. A reference to a file in 2020/ferguson2 is in
|
|
||||||
1992/buzzard.2. This type of thing will have to be checked for all entries in
|
|
||||||
the new issue.
|
|
||||||
|
|
||||||
- Verify that all entries that should have (or could be benefited by) a try
|
- Verify that all entries that should have (or could be benefited by) a try
|
||||||
script do in fact have one. Also verify (mostly in earlier years) consistency in
|
script do in fact have one. Also verify (mostly in earlier years) consistency in
|
||||||
the way it is displayed and interactivity. The later years are probably done
|
the way it is displayed and interactivity. The later years are probably done
|
||||||
better.
|
better. As of *Wed 31 Jan 2024 12:22:09 UTC* almost all of this is done: just
|
||||||
|
some of 2018 and then all of 2019 and 2020 have to be checked. It is very likely
|
||||||
|
that before the day is over 2018 will be done and possibly part of 2019 will be
|
||||||
|
done but this is currently unknown. The shellcheck updates is another issue
|
||||||
|
entirely.
|
||||||
|
|
||||||
|
- Test and fix as and if necessary 2018/ferguson/weasel.spec.
|
||||||
Reference in new issue
Block a user