Add preview of 1984-2019

The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.

One will find HTML commented out with:

    <!-- XXX remove when 2020 is ready
    2020 links here
    XXX remove when 2020 is ready -->

The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks.  Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known.  The following files
have such HTML comment blocks in them.

    ./winners.html
    ./years-spoiler.html
    ./years.html

In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.

The 2020 winner code AND write-ups are NOT part of this set.

p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
This commit is contained in:
Landon Curt Noll committed 2020-12-30 16:57:03 -08:00
1 parent 28efc67f5d
commit c0663537cb
1683 files changed
+220064

No files matched your search

+132
View File
@@ -0,0 +1,132 @@
#!/bin/ksh
# Assume a POSIX compliant shell.
PROG="./prog"
args=$(getopt 'f:w' $*)
if [ $? -ne 0 ]; then
echo "usage: prog-test.sh [-w][-f flags]"
exit 2
fi
set -- $args
while [ $# -gt 0 ]; do
case "$1" in
-w)
PROG="./prog-w64"
;;
-f)
flags=$2; shift
;;
--)
shift; break
;;
esac
shift
done
function distance
{
typeset A="$1"; shift
typeset B="$1"; shift
typeset expect="$1"; shift
printf "$A" | sed -e 's/./&\
/g' >$A.tmp
printf "$B" | sed -e 's/./&\
/g' >$B.tmp
echo "<<< A='$A' B='$B' $@"
typeset dist=$($PROG -d $@ $A.tmp $B.tmp | tr -d '\r')
printf '>>> got=%d expect=%d ' "$dist" "$expect"
if [ "$dist" -ne "$expect" ]; then
echo FAIL
return 1
fi
echo -OK-
return 0
}
function dif
{
typeset A="$1"; shift
typeset B="$1"; shift
typeset expect="$1"; shift
echo "==== $A $B"
$PROG $A $B | tee patch.tmp
typeset ex=$?
if [ "$expect" -eq 0 ]; then
printf "got=%d expect=%d " $ex $expect
if [ $expect -ne $ex ]; then
echo FAIL
return 1
fi
echo -OK-
return 0
fi
printf "forward patch "
cp $A copy.tmp
if ! patch -f -s copy.tmp patch.tmp ; then
echo FAIL
return 1
fi
echo -OK-
printf "forward compare "
if ! cmp $B copy.tmp ; then
echo FAIL
return 1
fi
echo -OK-
printf "reverse patch "
if ! patch -R -f -s copy.tmp patch.tmp ; then
echo FAIL
return 1
fi
echo -OK-
printf "reverse compare "
if ! cmp $A copy.tmp ; then
echo FAIL
return 1
fi
echo -OK-
return 0
}
distance "1" "1" 0 $flags
distance "1" "A" 2 $flags
distance "123" "ABCDE" 8 $flags
distance "ABCDE" "123" 8 $flags
distance "ABD" "ABCD" 1 $flags
distance "ABCD" "ABD" 1 $flags
distance "ABCD" "ACDBECFD" 4 $flags
distance "ABCDEF" "ABXYEFCD" 6 $flags
distance "ABCDEFGHIJK" "ABCEFGIJKDEFGHIJK" 6 $flags
distance "ABCABBA" "CBABAC" 5 $flags
distance "ACEBDABBABED" "ACBDEACBED" 6 $flags
touch EMPTY.tmp
dif 1.tmp 1.tmp 0
dif EMPTY.tmp 123.tmp 1
dif 123.tmp EMPTY.tmp 1
dif ABCD.tmp ACDBECFD.tmp 1
dif ACDBECFD.tmp ABCD.tmp 1
dif 123.tmp ABCDE.tmp 1
dif ABCDE.tmp 123.tmp 1
# Note that prog and diff(1) have same edit distance,
# but differ in the output.
dif CBABAC.tmp ABCABBA.tmp 1
dif ABCABBA.tmp CBABAC.tmp 1
rm copy.tmp* 2>/dev/null
echo DONE