Add 2019/poikola alt code, try, try.alt, others

The alt code is so one can more easily filter the long output: it prints
a newline after each number is printed. The try.alt.sh script uses this.

Force -O0: the author stated that with clang they got correct output for
[0123s] but with GCC 6 they only got that with level 0. Since 0 works
with clang and since the author stated that the compilers used were
picky I changed it to level 0. Similarly and for the same reason I
changed the C standard to gnu11 from gnu17.

Format/typo check README.md file.

Updated bugs.md: noted that the max file size is 1GB.

I would like to give two quotes from the person this entry was dedicated
to:

    'When you are about to jump, you are all alone and have to make your own
     decisions. Up there, it's all "up yours".'

and

    'I will move to Copenhagen and apply for Swedish citizenship.'

simply because they're funny and ironic (and one is quoted by the
author). These might be found somewhere in this commit.
This commit is contained in:
Cody Boone Ferguson committed 2023-12-20 08:27:07 -08:00
1 parent 631869dc7f
commit 9e057cd4ab
8 files changed
+261 -28

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
#
# try.alt.sh - demonstrate IOCCC winner 2019/poikola alt code
#
# 'I will move to Copenhagen and apply for Swedish citizenship.'
#
# -- Matti Ensio Nykänen
#
# 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 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): "
echo 1>&2
./prog.alt 512 ./prog.alt | less -rEXF
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
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): "
echo 1>&2
./prog.alt 512 ./prog.alt | less -rEXF
echo 1>&2