Merge pull request #2136 from xexyl/todo-try

Change task wrt try scripts in todo
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2024-02-01 14:40:23 -08:00
commit 6a710c21fc
6 files changed
+50 -42

No files matched your search

+1
View File
@@ -70,6 +70,7 @@ echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog 128 128 128 128: "
echo 1>&2
./prog 128 128 128 128
echo 1>&2
echo "Why did that print strange output?"
echo 1>&2
-2
View File
@@ -24,7 +24,6 @@ read -r -n 1 -p "Press any key to show hello.txt: "
echo 1>&2
cat hello.txt
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog hello.txt: "
echo 1>&2
./prog hello.txt
@@ -34,7 +33,6 @@ read -r -n 1 -p "Press any key to show yoda.txt: "
echo 1>&2
cat yoda.txt
echo 1>&2
read -r -n 1 -p "Press any key to run: ./prog yoda.txt: "
echo 1>&2
./prog yoda.txt
+15 -11
View File
@@ -23,27 +23,29 @@ if [[ -z "$PLAY" ]]; then
if [[ -z "$PLAY" ]]; then
echo "Note: cannot find play(1) or aplay(1). Will not play sounds for you. Try installing" 1>&2
echo "SoX. See FAQ 3.10: How do I compile and use an IOCCC winner that requires sound?" 1>&2
echo "SoX. You will have to play the WAV output manually, sorry." 1>&2
echo 1>&2
echo "You will have to play the WAV output manually, sorry." 1>&2
echo "Tip: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
echo 1>&2
fi
fi
read -r -n 1 -p "Press any key to convert pi.wav to its digits: "
read -r -n 1 -p "Press any key to convert pi.wav to its digits (./prog < pi.wav): "
echo 1>&2
echo "$ ./prog < pi.wav" 1>&2
./prog < pi.wav
if [[ -n "$PLAY" ]]; then
read -r -n 1 -p "Press any key to play pi.wav with $PLAY: "
echo 1>&2
echo "$ $PLAY pi.wav" 1>&2
"$PLAY" pi.wav
else
echo "Please play pi.wav in an audio player that can play WAV files." 1>&2
echo 1>&2
echo "Tip: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
echo 1>&2
fi
read -r -n 1 -p "Press any key convert 867-5309: "
read -r -n 1 -p "Press any key convert 867-5309 (./prog 867-5309 > jenny.wav): "
echo 1>&2
echo "$ ./prog 867-5309 > jenny.wav" 1>&2
./prog 867-5309 > jenny.wav
if [[ -n "$PLAY" ]]; then
read -r -n 1 -p "Press any key to play jenny.wav with $PLAY: "
@@ -51,18 +53,20 @@ if [[ -n "$PLAY" ]]; then
echo "$ $PLAY jenny.wav" 1>&2
"$PLAY" jenny.wav
echo 1>&2
read -r -n 1 -p "Press any key to play 10666-28 ('IOCCC-28'): "
read -r -n 1 -p "Press any key to play 10666-28 ('IOCCC-28') (./prog 10666-28 | $PLAY -): "
echo 1>&2
echo "$ ./prog 10666-28 | $PLAY -"
./prog 10666-28 | "$PLAY" -
else
echo 1>&2
echo "Now try playing jenny.wav with an audio player that can play WAV files."
echo "Please play jenny.wav with an audio player that can play WAV files."
echo 1>&2
echo "Tip: see https://github.com/ioccc-src/temp-test-ioccc/blob/master/faq.md#sox." 1>&2
echo 1>&2
read -r -n 1 -p "Press any key to convert 10666-28 ('IOCCC-28'): "
echo 1>&2
echo "$ ./prog 10666-28 > ioccc28.wav"
./prog 10666-28 > ioccc28.wav
echo 1>&2
echo "Now try playing ioccc28.wav with an audio player that can play WAV files."
echo "Please play ioccc28.wav with an audio player that can play WAV files." 1>&2
echo 1>&2
fi
+1 -1
View File
@@ -208,7 +208,7 @@ clean:
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
${RM} -rf *.dSYM
${RM} -rf *.dSYM decoded code.c encoded.c
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
+27 -19
View File
@@ -15,6 +15,9 @@ make CC="$CC" all >/dev/null || exit 1
# clear screen after compilation so that only the entry is shown
clear
# remove code we generate and compile
rm -f decoded code.c encoded.c
# we will use hexdump later if it's installed
HEXDUMP="$(type -P hexdump)"
@@ -31,57 +34,62 @@ echo 1>&2
read -r -n 1 -p "Press any key to show code.c (space = next page, q = quit): "
echo 1>&2
less -rEXF code.c
less -rEXFK code.c
echo 1>&2
# compile without a PIN
echo "Trying to compile without a PIN:"
read -r -n 1 -p "Press any key to compile without a PIN ($CC code.c -o decode): "
echo 1>&2
echo "$ cc code.c -o decode" 1>&2
cc code.c -o decode
"$CC" code.c -o decode
echo 1>&2
echo "As you can see, you must compile with -DPIN=<number>" 1>&2
# if hexdump is installed we will use hexdump on the wrong code compiled
if [[ -n "$HEXDUMP" ]]; then
# compile with the wrong pin if hexdump is installed
echo 1>&2
echo "Compiling with wrong PIN: cc -DPIN=555 code.c -o wrongcoded" 1>&2
cc -DPIN=555 code.c -o wrongcoded # wait for it ...
read -r -n 1 -p "Press any key to run wrongcoded: "
echo "Press any key to compile with wrong PIN 555 ($CC -DPIN=555 code.c -o wrongcoded): " 1>&2
"$CC" -DPIN=555 code.c -o wrongcoded # wait for it ...
read -r -n 1 -p "Press any key to run ./wrongcoded | $HEXDUMP -C: "
echo 1>&2
./wrongcoded | "$HEXDUMP" -C
else
echo 1>&2
echo "Press any key to compile with wrong PIN 555 ($CC -DPIN=555 code.c -o wrongcoded): " 1>&2
"$CC" -DPIN=555 code.c -o wrongcoded # wait for it ...
read -r -n 1 -p "Press any key to run ./wrongcoded: "
echo 1>&2
./wrongcoded
fi
read -r -n 1 -p "Press any key to compile with a good PIN: "
echo 1>&2
# compile with a PIN
echo "$ cc -DPIN=23209 code.c -o decoded" 1>&2
cc -DPIN=23209 code.c -o decoded
read -r -n 1 -p "Press any key to compile with good PIN 23209 ($CC -DPIN=23209 code.c -o decoded): "
echo 1>&2
"$CC" -DPIN=23209 code.c -o decoded
read -r -n 1 -p "Press any key to run: ./decoded: "
echo 1>&2
./decoded
read -r -n 1 -p "Press any key to continue: "
echo 1>&2
echo "$ echo \"Hello, world!\" | ./prog 56789 > encoded.c" 1>&2
read -r -n 1 -p "Press any key to run: echo \"Hello, world!\" | ./prog 56789 > encoded.c: "
echo 1>&2
echo "Hello, world!" | ./prog 56789 > encoded.c
echo 1>&2
read -r -n 1 -p "Press any key to show encoded.c (space = next page, q = quit): "
echo 1>&2
less -rEXF encoded.c
less -rEXFK encoded.c
echo 1>&2
read -r -n 1 -p "Press any key to compile with PIN 56789: "
read -r -n 1 -p "Press any key to compile with good PIN 56789 ($CC -DPIN=56789 encoded.c -o decoded): "
echo 1>&2
echo "$ cc -DPIN=56789 encoded.c -o decoded" 1>&2
cc -DPIN=56789 encoded.c -o decoded
"$CC" -DPIN=56789 encoded.c -o decoded
echo 1>&2
read -r -n 1 -p "Press any key to run decoded: "
read -r -n 1 -p "Press any key to run ./decoded: "
echo 1>&2
echo "$ ./decoded" 1>&2
./decoded
echo 1>&2
rm -f decoded code.c encoded.c