Merge pull request #2127 from xexyl/ferguson22020-try

Fix 2020/ferguson2/try scripts
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-01-31 15:39:09 -08:00
commit 0209d7fad6
58 files changed
+760 -295

No files matched your search

+1
View File
@@ -9,3 +9,4 @@ prog
prog.alt
prog.orig
spectrogram.png
*.wav
+1 -1
View File
@@ -207,7 +207,7 @@ clean:
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
${RM} -rf *.dSYM
${RM} -rf *.dSYM *.wav
${RM} -f out.raw
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
+3 -3
View File
@@ -6,7 +6,7 @@ make
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
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:
@@ -23,9 +23,9 @@ For more detailed information see [2018 algmyr in bugs.md](/bugs.md#2018-algmyr)
## To use:
```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 -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
View File
@@ -15,46 +15,60 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
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
echo 1>&2
# 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): "
echo 1>&2
./prog prog.c | ./prog -d 1 0 | less -EXF
./prog prog.c | ./prog -d 1 0 | less -rEXFK
echo 1>&2
APLAY="$(type -P aplay)"
SOX="$(type -P sox)"
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
echo "$ echo -n ' MENE MENE TEKEL UPHARSIN ' | ./prog | \
sox -t raw -c 1 -r 44100 -L -e floating-point -b 32 \
echo "$ 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" 1>&2
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 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
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
echo "$ 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
else
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
./prog | aplay -c1 -fFLOAT_LE -r44100
echo '<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~' |
./prog | aplay -c1 -fFLOAT_LE -r44100
echo "$ echo \"<<<<<< /\_/\_/\ _-_-_-_ !!!!! :.:.:.: >>>>>> ****** ~~~~~~~\" |
./prog | $APLAY -c1 -fFLOAT_LE -r44100" 1>&2
read -r -n 1 -p "Press any key to continue: "
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
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
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
+35
View File
@@ -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
+2 -2
View File
@@ -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): "
echo 1>&2
./prog < README.md | less -EXF
./prog < README.md | less -rEXFK
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog < Makefile (space = next page, q = quit): "
echo 1>&2
./prog < Makefile | less -EXF
./prog < Makefile | less -rEXFK
+11 -9
View File
@@ -17,18 +17,20 @@ code](#alternate-code) below.
## Try:
```sh
eog lena.ppm # On Linux
open -a Preview lena.ppm # On macOS
First open [Lenna.png](Lenna.png) in your graphics viewer of choice. Next, after
running the above command (`./prog > lena.ppm`), open `lena.ppm` in your
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
the netpbm project and `cjpeg(1)` comes from `libjpeg-turbo`. If you don't have
these tools already see [FAQ 3.15 - How do I compile and install netpbm for
entries that require it?](/faq.md#netpbm) and [FAQ 3.16 - How do I compile and
install libjpeg-turbo for entries that require it?](/faq.md#libjpeg).
NOTE: the script uses the tools `pngtopam(1)` (or `pngtopnm(1)` for older
versions) and `pnmscale` come from the netpbm project and `cjpeg(1)` comes from
`libjpeg-turbo`. If you don't have these tools already see [FAQ 3.15 - How do I
compile and install netpbm for entries that require it?](/faq.md#netpbm) and
[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
<https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png>.
+50
View File
@@ -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
View File
@@ -13,27 +13,27 @@ fi
make CC="$CC" everything >/dev/null || exit 1
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
echo 1>&2
read -r -n 1 -p "Press any key to run: ./$i < prog (space = next page, q = quit): "
echo 1>&2
./"$i" < prog | less -EXF
./"$i" < prog | less -rEXFK
echo 1>&2
read -r -n 1 -p "Press any key to run: ./$i < scripthd.sh (space = next page, q = quit): "
echo 1>&2
./"$i" < scripthd.sh | less -EXF
./"$i" < scripthd.sh | less -rEXFK
echo 1>&2
read -r -n 1 -p "Press any key to run: head $0 | ./$i: "
echo 1>&2
head "$0" | ./"$i"
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
tail -n 15 Makefile | ./"$i"
tail -n 15 Makefile | ./"$i" | less -rEXFK
done
+10 -4
View File
@@ -16,15 +16,21 @@ make CC="$CC" all >/dev/null || exit 1
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
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
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
echo 1>&2
read -r -n 1 -p "Press any key to run: make test (space = next page, q = quit): "
echo 1>&2
make test | less -EXF
make test | less -rEXFK
+4 -4
View File
@@ -17,27 +17,27 @@ clear
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
echo 1>&2
less -EXF prog.c
less -rEXFK prog.c
echo "$ ./prog < prog.c > prog.gif" 1>&2
./prog < prog.c > prog.gif
echo 1>&2
read -r -n 1 -p "Press any key to show golem.txt (space = next page, q = quit): "
echo 1>&2
less -EXF golem.txt
less -rEXFK golem.txt
echo "$ ./prog < golem.txt > golem.gif" 1>&2
./prog < golem.txt > golem.gif
echo 1>&2
read -r -n 1 -p "Press any key to show smily.txt (space = next page, q = quit): "
echo 1>&2
less -EXF smily.txt
less -rEXFK smily.txt
echo "$ ./prog < smily.txt > smily.gif" 1>&2
./prog < smily.txt > smily.gif
echo 1>&2
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
./prog < invisible.txt > invisible.gif
echo 1>&2
+4 -4
View File
@@ -15,12 +15,12 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to 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
./run.sh
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
./prog | tee prog_next.c
make prog_next
@@ -28,12 +28,12 @@ make prog_next
make prog_next
./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
./python.sh
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
./python3.sh
+19 -2
View File
@@ -55,9 +55,26 @@ CSTD= -std=gnu17
#
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
#
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
#
@@ -135,7 +152,7 @@ weasel: ${PROG}
${CP} -f $< $@
test: ${PROG} test.sh
./test.sh
@./test.sh
# alternative executable
#
+107 -23
View File
@@ -19,8 +19,24 @@ monkey Eric. See [Alternate code](#alternate-code) below.
```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:
@@ -45,8 +61,33 @@ Use `weasel.alt` as you would `weasel` above.
```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:
@@ -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.
**[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`
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
notes](#portability), an [more portability notes](#bugs) and a [note on
rpm.md](#rpm).
@@ -865,21 +907,24 @@ be made clear in the comments! :)*
## **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).
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
**[Compilation](#compiling)** subsection for example invocations). Both are
capped to be no greater than `SIZE_MAX - 1`. This is handled by the C
preprocessor.
capped to be no greater than `SIZE_MAX - 1` or whatever `M` (which can't be
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
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
* `S`
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).
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
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
to 3 (that's not a typo!) and this is part of an Easter egg.
```sh
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>
@@ -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)'
```
If you want to increase the number of offspring to `50` and the size of the
chromosome to `75` you would pass to the compiler:
which running `make` will always do.
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
-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`:
```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
4 it's redefined to 3* so you could have passed in `-DN=2` and have the same
result. Remember too that `S` cannot be less than `38`. Both `S` and
`N` are capped at `SIZE_MAX - 1`.
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` (`MAX_SIZE`) cannot be less than `38`. Both `S` and
`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>
+27
View File
@@ -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
+24
View File
@@ -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
+17
View File
@@ -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
+17
View File
@@ -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
+5
View File
@@ -7,7 +7,12 @@
Q unsigned d; Q char E; Q int k;
Q long u; Q size_t t; Q const char U;
#define L toupper
#ifndef M
#define M SIZE_MAX-1
#elif M < 100
#undef M
#define M SIZE_MAX-1
#endif
#ifndef S
#define S 38
#elif S < 38
+5
View File
@@ -7,7 +7,12 @@
Q unsigned d; Q char E; Q int k;
Q long u; Q size_t t; Q const char U;
#define L toupper
#ifndef M
#define M SIZE_MAX-1
#elif M < 100
#undef M
#define M SIZE_MAX-1
#endif
#ifndef S
#define S 38
#elif S < 38
+1 -1
View File
@@ -13,5 +13,5 @@ STOP MONKEYING ABOUT!
WHAT DO YOU MEAN I'M A MONKEY?!
PROBLEM BETWEEN KEYBOARD AND CHAIR
MY PRECIOUS. YES, MY PRECIOUS.
MY PRECIOUS! O MY PRECIOUS!
MY PRECIOUS! O MY PRECIOUS! PRECIOUS
IOCCC BEST USE OF WEASEL WORDS
+9 -3
View File
@@ -1,11 +1,17 @@
#!/usr/bin/env bash
#
# test.sh - make test script for IOCCC winner 2018/ferguson
# Make sure the program has been compiled
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
./weasel "$@" "${f}" # full line because of quotes
# NOTE: ./weasel $* $f would just be the final word
sleep 2
# NOTE: ./weasel $* $f would just be the final word. We quote it for the
# full line:
./weasel "$@" "${f}" | less -rEXFK
done < test-strings.txt || exit 1
echo "All done. Goodbye, you old monkeying weasel!"
+37 -26
View File
@@ -10,43 +10,54 @@ if [[ -z "$CC" ]]; then
CC="cc"
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
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
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: "
echo 1>&2
time ./weasel.alt -mq Eric
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
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)? "
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
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
# recompile with default max attempts for the next steps
make -B everything >/dev/null || exit 1
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 not display until Eric succeeds or too many generations. Hit ctrl-c" 1>&2
echo "to stop him early." 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
time ./weasel.alt -mq words
fi
# obviously '"intelligent" design' is false but who wants to try and prove
# otherwise? Or if they know better how long will it take to show that evolution
# is a proven fact?
./id.alt.sh
# If the user did not try and prove '"intelligent" design' or they waited a
# long time (though saving them some time by limiting it to 900000 attempts) I
# ask: can Eric the monkey type the word 'words' before falling asleep or
# getting too hungry to continue?
./monkey-words.alt.sh
+36 -25
View File
@@ -15,38 +15,49 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to 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
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: "
echo 1>&2
time ./weasel -mq Eric
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
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)? "
if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
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
# recompile with default max attempts for the next steps
make -B everything >/dev/null || exit 1
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 not display until Eric succeeds or too many generations. Hit ctrl-c" 1>&2
echo "to stop him early." 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
time ./weasel -mq words
fi
# obviously '"intelligent" design' is false but who wants to try and prove
# otherwise? Or if they know better how long will it take to show that evolution
# is a proven fact?
./id.sh
# If the user did not try and prove '"intelligent" design' or they waited a
# long time (though saving them some time by limiting it to 900000 attempts) I
# ask: can Eric the monkey type the word 'words' before falling asleep or
# getting too hungry to continue?
./monkey-words.sh
+2 -6
View File
@@ -1,16 +1,12 @@
#
# sort with: sort -d -u
*.dSYM
generated1.c
generated2.c
generated3.c
generated4.c
generated5.c
generated*
indent
indent.c
indent.o
left
msg[0-9]
msg*
no_leading_space.txt
prog
prog.orig
+1 -1
View File
@@ -324,7 +324,7 @@ clean:
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
${RM} -rf *.dSYM
${RM} -f generated*.c msg*
${RM} -f generated* msg*
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
+5
View File
@@ -80,4 +80,9 @@ if [[ "$REPLY" == "Y" || "$REPLY" == "y" ]]; then
read -r -n 1 -p "Press any key to run: ./msg9 < prog.c: "
echo 1>&2
./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
+6 -8
View File
@@ -15,19 +15,17 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: ./prog spam.unl | head -n 100 (space = next page, q =quit): "
echo 1>&2
echo "$ ./prog spam.unl | head -n 100 | less -EXF" 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
./prog spam.unl | head -n 100 | less -EXF
./prog spam.unl | head -n 100 | less -rEXFK
echo 1>&2
echo "$ ./prog sierpinski.unl | head -n 200 | less -EXF" 1>&2
read -r -n 1 -p "Press any key to continue: "
read -r -n 1 -p "Press any key to run: ./prog sierpinski.unl | head -n 200 (space = next page, q = quit): "
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
echo 1>&2
+5 -2
View File
@@ -16,8 +16,11 @@ echo | $x
/bin/echo -n a | $x
echo a | $x
$x < newlines
# ^---^ SC2210 (warning): This is a file redirection. Was it supposed to be a comparison or fd operation?
# Answer: 256 is a file so it is supposed to be file redirection.
# 256 is a file so it is supposed to be file redirection. Thus we have to
# 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
$x < 256
$x < remarks
+2 -2
View File
@@ -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
# 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
set -- $s
((a += $1))
+7 -3
View File
@@ -15,15 +15,19 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
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
echo 1>&2
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 ' ')"
done
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
echo 1>&2
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -x
./getwords.sh fr | ./prog.alt aàâbcdeéèêfghiîjklmnoôpqrstuùûvwxyz\'
+8 -6
View File
@@ -15,22 +15,24 @@ make CC="$CC" everything >/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: ./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz: "
./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz | less -EXF
echo "$ ./getwords.sh en | grep .. | ./prog.alt aeiouvwxyz"
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 "$ ./getwords.sh en | grep .. | ./prog.alt aeiouhjklmnvwxyz" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
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
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
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 "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): "
./en.alt.sh | less -EXF
echo 1>&2
./en.alt.sh | less -rEXFK
+7 -5
View File
@@ -15,22 +15,24 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
read -r -n 1 -p "Press any key to run: ./getwords.sh en | grep .. | ./prog aeiouvwxyz: "
./getwords.sh en | grep .. | ./prog aeiouvwxyz | less -EXF
echo "$ ./getwords.sh en | grep .. | ./prog aeiouvwxyz"
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 "$ ./getwords.sh en | grep .. | ./prog aeiouhjklmnvwxyz" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
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
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
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 "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): "
./en.sh | less -EXF
./en.sh | less -rEXFK
+17 -8
View File
@@ -15,34 +15,43 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
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
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
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
echo "Exit code of: cmp ref.Z dg1.Z: $?" 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
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
echo 1>&2
echo "Notice how the files differ:" 1>&2
echo "$ cmp ref.Z dg1.Z" 1>&2
echo "Notice how the two files differ:" 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
echo "Exit code of: cmp ref.Z dg1.Z: $?" 1>&2
echo 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
echo "Exit code of zcat < dg1.Z | cmp - Shakespeare.txt: ${PIPESTATUS[1]}"
echo 1>&2
echo "What happened?"
+33 -19
View File
@@ -19,54 +19,68 @@ SHA512SUM="$(type -P sha512sum)"
SHASUM="$(type -P shasum)"
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
echo 1>&2
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
echo 1>&2
echo "$ ./prog" 1>&2
read -r -n 1 -p "Press any key to run: ./prog: "
echo 1>&2
./prog
echo 1>&2
echo "$ $SHA512SUM prog.c | cut -f 1 -d' ' > sha512sum.txt" 1>&2
"$SHA512SUM" prog.c | cut -f 1 -d' ' > sha512sum.txt
echo "$ ./prog > prog.txt" 1>&2
./prog > prog.txt
read -r -n 1 -p "Press any key to run: $SHA512SUM prog.c | cut -f 1 -d' ' | tee sha512sum.txt: "
echo 1>&2
"$SHA512SUM" prog.c | cut -f 1 -d' ' | tee sha512sum.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 "$ 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
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
rm -f sha512sum prog.txt
elif [[ -n "$SHASUM" ]]; then
# 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
echo 1>&2
echo "$ ./prog" 1>&2
read -r -n 1 -p "Press any key to run: ./prog: "
echo 1>&2
./prog
echo 1>&2
echo "$ $SHASUM -a 512 prog.c | cut -f 1 -d' ' > sha512sum.txt" 1>&2
"$SHASUM" -a 512 prog.c | cut -f 1 -d' ' > sha512sum.txt
echo "$ ./prog > prog.txt" 1>&2
./prog > prog.txt
read -r -n 1 -p "Press any key to run: $SHASUM -a 512 prog.c | cut -f 1 -d' ' | tee sha512sum.txt: "
echo 1>&2
"$SHASUM" -a 512 prog.c | cut -f 1 -d' ' | tee sha512sum.txt
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
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
rm -f sha512sum prog.txt
fi
+2
View File
@@ -43,5 +43,7 @@ for i in glider.mc infinite_5x5.mc mosquito5.mc message.mc; do
if [[ "$REPLY" == "q" || "$REPLY" == "Q" ]]; then
exit 0
fi
read -r -n 1 -p "Press any key to run: ./prog < $i: "
echo 1>&2
./prog < "$i" 2>/dev/null
done
+5 -2
View File
@@ -35,9 +35,12 @@ echo 1>&2
"$GDB" -q -x prog.c ./prog | cat | grep : | cut -f 2 -d: | xargs ./ascii | less -rEXF
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: "
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
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
+4 -6
View File
@@ -15,15 +15,13 @@ make
## Try:
```sh
play MonodyVocals.wav
./prog MonodyVocals.wav
play out.wav
./try.sh
```
NOTE: `play` comes from SoX, the Swiss Army Knife of sound processing programs.
If you don't have this installed, see [FAQ 3.10: How do I compile and use an
IOCCC winner that requires sound](/faq.md#faq3_10).
NOTE: `play`, which [try.sh](try.sh) uses, comes from SoX, the Swiss Army Knife
of sound processing programs. If you don't have this installed, see [FAQ 3.10:
How do I compile and use an IOCCC winner that requires sound](/faq.md#faq3_10).
## Judges' remarks:
+40
View File
@@ -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
View File
@@ -16,8 +16,9 @@ make CC="$CC" all >/dev/null || exit 1
clear
# display prog.c to the user
echo "$ cat prog.c"
cat prog.c
read -r -n 1 -p "Press any key to show prog.c (space = next page, q = quit): "
echo 1>&2
less -rEXFK prog.c
# run the program on its own source code
read -r -n 1 -p "Press any key to run: ./prog < prog.c: "
@@ -28,7 +29,9 @@ echo 1>&2
reset
# 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
# run the program on maze
+1 -1
View File
@@ -38,7 +38,7 @@ include ../../var.mk
# Common C compiler warnings to silence
#
CSILENCE= -Wno-strict-prototypes
CSILENCE= -Wno-strict-prototypes -Wno-comment
# Common C compiler warning flags
#
+27 -17
View File
@@ -15,31 +15,42 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "$ (./prog < fib.hs; cat prog.c) > fib.c" 1>&2
(./prog < fib.hs; cat prog.c) > fib.c
echo "$ cc -Wno-everything fib.c -o fib" 1>&2
cc -Wno-everything fib.c -o fib
echo "$ ./fib" 1>&2
./fib
echo "$ (./prog < fib.hs; cat prog.c) | tee fib.c" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
(./prog < fib.hs; cat prog.c) | tee fib.c | less -rEXFK
read -r -n 1 -p "Press any key to run: make fib: "
echo 1>&2
read -r -n 1 -p "Press any key to continue: "
make CC="$CC" fib
echo 1>&2
echo "$ (./prog < lol.hs ; cat prog.c) > lol.c" 1>&2
(./prog < lol.hs ; cat prog.c) > lol.c
echo "$ make lol" 1>&2
make lol
read -r -n 1 -p "Press any key to run: ./fib: "
echo 1>&2
./fib
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: "
echo 1>&2
./lol
echo 1>&2
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "$ (./prog < scc.hs ; cat prog.c) > scc.c" 1>&2
(./prog < scc.hs ; cat prog.c) > scc.c
echo "$ make scc" 1>&2
make scc
echo "$ (./prog < scc.hs ; cat prog.c) | tee scc.c" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
(./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: "
echo 1>&2
./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
./scc < example-2.txt
exit 0
+5 -6
View File
@@ -18,17 +18,16 @@ echo 1>&2
echo "This may take a while:"
make test-64bit
echo "$ less IOCCC-Rules-Guidelines.output.txt" 1>&2
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
less -rEXF IOCCC-Rules-Guidelines.output.txt
less -rEXFK IOCCC-Rules-Guidelines.output.txt
echo 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): "
echo 1>&2
less -rEXF IOCCC-hints.output.txt
less -rEXFK IOCCC-hints.output.txt
echo 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
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
echo 1>&2
less -rEXF Eugene_Onegin.output.txt
less -rEXFK Eugene_Onegin.output.txt
echo 1>&2
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): "
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 "$ ./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): "
echo 1>&2
./prog < Shakespeare.cp04_1.633 | head -n 100
./prog < Shakespeare.cp04_1.633 | head -n 100 | less -rEXFK
echo 1>&2
+5 -6
View File
@@ -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
echo "$ ./prog.alt 512 ./prog.alt" 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 run: ./prog.alt 512 ./prog.alt (space = next page, q = quit): "
echo 1>&2
./prog.alt 512 ./prog.alt | less -rEXF
./prog.alt 512 ./prog.alt | less -rEXFK
echo 1>&2
echo "$ TZ=UTC24 make CC="$CC" clobber prog.alt" 1>&2
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): "
echo 1>&2
./prog.alt 512 ./prog.alt | less -rEXF
./prog.alt 512 ./prog.alt | less -rEXFK
echo 1>&2
echo "$ TZ=UTC48 make CC="$CC" clobber prog.alt" 1>&2
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
./prog.alt 512 ./prog.alt | less -rEXF
./prog.alt 512 ./prog.alt
echo 1>&2
+2 -3
View File
@@ -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
echo "$ ./prog 512 ./prog" 1>&2
read -r -n 1 -p "Press any key to continue: "
read -r -n 1 -p "Press any key to run: ./prog 512 ./prog: "
echo 1>&2
./prog 512 ./prog
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
read -r -n 1 -p "Press any key to run: ./prog 512 ./prog: "
echo 1>&2
+27 -25
View File
@@ -15,28 +15,28 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
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: "
echo 1>&2
echo "$ ./prog ioccc.txt a b c d e" 1>&2
./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
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
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
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
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
cat e
@@ -46,8 +46,7 @@ echo 1>&2
cat a b c d e | ./prog
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 continue: "
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - ioccc.txt: "
echo 1>&2
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
fi
read -r -n 1 -p "Press any key to scramble sample_input.txt into five files: "
echo 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
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
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
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
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
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
cat e
@@ -89,11 +89,10 @@ echo 1>&2
cat a b c d e | ./prog
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 continue: "
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - sample_input.txt: "
echo 1>&2
cat a b c d e | ./prog | diff -s - sample_input.txt
echo 1>&2
if [[ "$COLS" -lt 80 || "$LINES" -lt 25 ]]; then
# if screen size < 80 x 25 then exit
@@ -105,28 +104,28 @@ echo 1>&2
cat prog.c
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: "
echo 1>&2
echo "$ ./prog prog.c a b c d e" 1>&2
./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
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
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
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
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
cat e
@@ -136,16 +135,17 @@ echo 1>&2
cat a b c d e | ./prog
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 continue: "
read -r -n 1 -p "Press any key to run: cat a b c d e | ./prog | diff -s - prog.c: "
echo 1>&2
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
RUBY="$(type -P ruby)"
if [[ -n "$RUBY" ]]; then
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
echo "This may take a while, hit ctrl-c to exit script." 1>&2
echo 1>&2
@@ -153,6 +153,7 @@ if [[ -n "$RUBY" ]]; then
fi
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
echo "This may take a while, hit ctrl-c to exit script." 1>&2
echo 1>&2
@@ -160,6 +161,7 @@ if [[ -n "$RUBY" ]]; then
fi
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
echo "This may take a while, hit ctrl-c to exit script." 1>&2
echo 1>&2
+3 -1
View File
@@ -15,7 +15,8 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
echo "$ make test" 1>&2
read -r -n 1 -p "Press any key to run: make test: "
echo 1>&2
make test
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: "
echo 1>&2
./prog 1; ./prog_be 1
echo 1>&2
+2
View File
@@ -1,6 +1,8 @@
#
# sort with: sort -d -u
clock
clock.alt
clock.alt.c
clock.c
*.dSYM
indent
+10 -2
View File
@@ -113,8 +113,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG} clock
#
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
ALT_OBJ= ${PROG}.alt.o clock.alt.o
ALT_TARGET= ${PROG}.alt clock.alt
#################
@@ -146,6 +146,14 @@ alt: data ${ALT_TARGET}
${PROG}.alt: ${PROG}.alt.c
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
clock.alt: clock.alt.c
clock.alt.c: ${PROG}.alt.c
@${RM} -f $@
${CP} -f $< $@
# data files
#
data: ${DATA}
+8
View File
@@ -41,6 +41,14 @@ make alt
Use `prog.alt` as you would `prog` above.
### Alternate try:
```sh
./run_clock.alt
# And watch closely for 15-20 seconds
```
## Judges' remarks:
You may be tempted to use a mirror. Resist the temptation! Try figuring out how
+9
View File
@@ -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
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
make -B clock || exit 1
while true; do
cc -std=c11 -Wall -Wextra -pedantic -O3 clock.c -o clock
clear
+1 -2
View File
@@ -29,7 +29,7 @@ if [[ -z "$CC" ]]; then
CC="cc"
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
@@ -138,6 +138,5 @@ echo 1>&2
read -r -n 1 -p "Press any key to compare input and output2: "
echo 1>&2
diff -s input output2
diff -s input output2
# final clean up
rm -f conf input output output2
-1
View File
@@ -138,6 +138,5 @@ echo 1>&2
read -r -n 1 -p "Press any key to compare input and output2: "
echo 1>&2
diff -s input output2
diff -s input output2
# final clean up
rm -f conf input output output2
+1 -1
View File
@@ -1249,7 +1249,7 @@ for downloading, installing and using ncurses.
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
processing programs, [SoX](https://sox.sourceforge.net), will work. How to
+22 -6
View File
@@ -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))
[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))
@@ -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))
[Cody](#cody), out of abundance of caution, added a second arg to `main()`
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
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](#cody) added the [try.sh](/2018/bellard/try.sh) script.
Cody also, out of abundance of caution, added a second arg to `main()` 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 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
(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.
## <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]))
[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
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
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
@@ -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 :-)
) :-)
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))
+23 -25
View File
@@ -1,30 +1,28 @@
# 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
Ferguson](/winners.html#Cody_Boone_Ferguson) as he (that is I :-) ) wanted a way
to keep track of things in a way that did not require the information getting
lost in the thousands of changes in the repo and because it might be too much to
add to the todo list in the issues themselves.
This document is for [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) as
he (that is I :-) ) wanted a way to keep track of things in a way that did not
require the information getting lost in the thousands of changes in the repo and
because it might be too much to add to the todo list in the issues themselves.
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
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
this file the case is mostly _NOT_ been done).
Every so often this file is checked and updated to remove items and when
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
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
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 following years have had a
first pass: 1984 through 2001. However there are changes that are required
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.
completed.
* 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
following years have had a first pass: 1984 through 2001. However there are
changes that might be required in those years too so a pass over all of them
will have to be done at the time the files are to be reviewed.
- Check the [GitHub issue #3 comment
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
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
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
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.