Merge pull request #2062 from xexyl/endoh113-try
This commit is contained in:
28 files changed
+408
-215
No files matched your search
+40
-3
@@ -40,7 +40,7 @@ include ../../var.mk
|
|||||||
#
|
#
|
||||||
CSILENCE= -Wno-bitwise-op-parentheses -Wno-empty-body -Wno-format \
|
CSILENCE= -Wno-bitwise-op-parentheses -Wno-empty-body -Wno-format \
|
||||||
-Wno-format-security -Wno-gnu-zero-variadic-macro-arguments -Wno-main \
|
-Wno-format-security -Wno-gnu-zero-variadic-macro-arguments -Wno-main \
|
||||||
-Wno-parentheses
|
-Wno-parentheses -Wno-implicit-function-declaration -Wno-strict-prototypes
|
||||||
|
|
||||||
# Common C compiler warning flags
|
# Common C compiler warning flags
|
||||||
#
|
#
|
||||||
@@ -129,11 +129,48 @@ all: data ${TARGET}
|
|||||||
.PHONY: all alt data everything diff_orig_prog diff_prog_orig \
|
.PHONY: all alt data everything diff_orig_prog diff_prog_orig \
|
||||||
diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig \
|
diff_alt_prog diff_prog_alt diff_orig_alt diff_alt_orig \
|
||||||
clean clobber install love haste waste maker easter_egg \
|
clean clobber install love haste waste maker easter_egg \
|
||||||
sandwich supernova deep_magic magic charon pluto
|
sandwich supernova deep_magic magic charon pluto hint hint.pdf \
|
||||||
|
hello hello.pdf
|
||||||
|
|
||||||
|
|
||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
${CC} ${CFLAGS} $< -o $@ ${LDFLAGS}
|
||||||
|
|
||||||
|
# hint.pdf rules to simplify use of 2012/hamano
|
||||||
|
#
|
||||||
|
|
||||||
|
# This rule generates the hint.pdf file which is the README.md obfuscated as a
|
||||||
|
# PDF that is NOT part of the repo:
|
||||||
|
hint.pdf: ${PROG} README.md
|
||||||
|
./${PROG} < README.md > hint.pdf
|
||||||
|
@echo
|
||||||
|
|
||||||
|
# This rule, hint, depends on the hint.pdf rule. That rule generates the
|
||||||
|
# hint.pdf file (NOT part of the repo) which is an obfuscated (as a PDF) version
|
||||||
|
# of the README.md. This rule, in turn, COMPILES THAT PDF FILE AS C CODE!
|
||||||
|
hint: hint.pdf
|
||||||
|
${CC} ${CFLAGS} -xc $< -o $@
|
||||||
|
|
||||||
|
|
||||||
|
# hello.pdf rules to simplify use of 2012/hamano
|
||||||
|
#
|
||||||
|
|
||||||
|
# This rule generates the hello.pdf file which is a simple 'Hello World!'
|
||||||
|
# program obfuscated as a PDF:
|
||||||
|
hello.pdf:
|
||||||
|
echo 'int main(){puts("Hello World!");}' | ./${PROG} > hello.pdf
|
||||||
|
|
||||||
|
# This rule, hello, depends on the hello.pdf rule. That rule generates the
|
||||||
|
# hello.pdf file (NOT part of the repo) which is an obfuscated (as a PDF) version
|
||||||
|
# of a simple 'Hello World!' program. This rule, in turn, COMPILES THAT PDF FILE
|
||||||
|
# AS C CODE to hello and then pipes it to cc to compile it to hello2 which when
|
||||||
|
# run will print 'Hello World!'.
|
||||||
|
hello: hello.pdf
|
||||||
|
@echo
|
||||||
|
${CC} ${CFLAGS} -xc hello.pdf -o $@
|
||||||
|
@echo
|
||||||
|
./hello | ${CC} ${CFLAGS} -xc - -o hello2
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
#
|
#
|
||||||
alt: data ${ALT_TARGET}
|
alt: data ${ALT_TARGET}
|
||||||
@@ -204,7 +241,7 @@ clean:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
${RM} -f ${TARGET} ${ALT_TARGET}
|
${RM} -f ${TARGET} ${ALT_TARGET} hint.pdf hello.pdf hello hello2
|
||||||
${RM} -rf *.dSYM
|
${RM} -rf *.dSYM
|
||||||
@-if [ -e sandwich ]; then \
|
@-if [ -e sandwich ]; then \
|
||||||
${RM} -f sandwich; \
|
${RM} -f sandwich; \
|
||||||
|
|||||||
+18
-5
@@ -28,16 +28,29 @@ One of the PDF files generated is this README.md file as a PDF, obfuscated, and
|
|||||||
the PDF file will then be compiled as C (itself!) and executed so that it shows
|
the PDF file will then be compiled as C (itself!) and executed so that it shows
|
||||||
README.md!
|
README.md!
|
||||||
|
|
||||||
Another PDF file generated is obfuscated C code. Once this is done it will
|
That procedure looks like:
|
||||||
compile the PDF as if it was C and then run it like:
|
|
||||||
|
```sh
|
||||||
|
./hamano < README.md > hint.pdf
|
||||||
|
cc -xc hint.pdf -o hint
|
||||||
|
./hint
|
||||||
|
```
|
||||||
|
|
||||||
|
Another PDF generated is an obfuscated `Hello World!` program (obfuscated inside
|
||||||
|
the PDF). Once this is done it will compile the PDF as if it was C (itself!). It
|
||||||
|
will look like:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
|
echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
|
||||||
cc -Wno-implicit-function-declaration -xc hello.pdf -o hello2
|
cc -xc hello.pdf -o hello
|
||||||
./hello2 | gcc -Wno-implicit-function-declaration -xc - -o ./hello3
|
./hello | cc -Wno-implicit-function-declaration -xc - -o ./hello2
|
||||||
./hello3
|
|
||||||
|
./hello2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
although the `CFLAGS` will be what is in the Makefile as it uses the helper
|
||||||
|
rules `hint.pdf`, `hint`, `hello.pdf` and `hello` to do this.
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
|
|||||||
+33
-23
@@ -15,37 +15,47 @@ 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 obfuscate README.md, writing to hint.pdf: "
|
# delete hint.pdf
|
||||||
echo 1>&2
|
rm -f hint.pdf
|
||||||
echo "$ ./hamano < README.md > hint.pdf" 1>&2
|
|
||||||
./hamano < README.md > hint.pdf
|
|
||||||
|
|
||||||
echo "Now try opening it in a pdf viewer before proceeding." 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
|
|
||||||
|
echo "Will obfuscate README.md like:" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ${CC} -xc hint.pdf -o hint" 1>&2
|
echo " ./hamano < README.md > hint.pdf" 1>&2
|
||||||
${CC} -xc hint.pdf -o hint
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to run: ./hint | less (space = next page, q = quit): "
|
echo "and then compile it as C like:" 1>&2
|
||||||
./hint | less
|
echo 1>&2
|
||||||
|
echo " ${CC} -xc hint.pdf -o hint" 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to run: make hint: "
|
||||||
|
echo 1>&2
|
||||||
|
make hint
|
||||||
|
echo 1>&2
|
||||||
|
echo "Now try opening hint.pdf in a pdf viewer before proceeding." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to run: ./hint (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
./hint | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "Will obfuscate the following code: " 1>&2
|
echo "Will obfuscate the following code: " 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo " int main(){puts("Hello World!");}"
|
echo " int main(){puts("Hello World!");}"
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "writing to hello.pdf" 1>&2
|
echo "writing it to hello.pdf via:" 1>&2
|
||||||
echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "Now open hello.pdf in a pdf viewer before continuing." 1>&2
|
echo " echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf"
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to continue to deobfuscate and compile hello.pdf: "
|
echo "and then execute the following commands:" 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ${CC} -Wno-implicit-function-declaration -xc hello.pdf -o hello2" 1>&2
|
echo " ${CC} -xc hello.pdf -o hello" 1>&2
|
||||||
${CC} -Wno-implicit-function-declaration -xc hello.pdf -o hello2
|
echo " ./hello | ${CC} -xc - -o hello2" 1>&2
|
||||||
echo "$ ./hello2 | ${CC} -Wno-implicit-function-declaration -xc - -o ./hello3" 1>&2
|
echo 1>&2
|
||||||
./hello2 | ${CC} -Wno-implicit-function-declaration -xc - -o ./hello3
|
read -r -n 1 -p "Press any key to run: make hello: "
|
||||||
echo "$ ./hello3" 1>&2
|
echo 1>&2
|
||||||
./hello3
|
make hello
|
||||||
|
echo 1>&2
|
||||||
|
echo "Now open hello.pdf in a pdf viewer to see the obfuscated source." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to run: ./hello2: "
|
||||||
|
echo 1>&2
|
||||||
|
./hello2
|
||||||
+8
-4
@@ -15,14 +15,18 @@ 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: less hou.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run show hou.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -X hou.c
|
less -rEXFK hou.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./hou ansi.txt hou.c | less -r (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./hou ansi.txt hou.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./hou ansi.txt hou.c | less -r"
|
# Note: unlike the other try.sh/try.alt.sh scripts we don't use options that
|
||||||
|
# don't reset the terminal and that quit less(1) when it reaches EOF. This is
|
||||||
|
# because if we do the effect will vanish the moment they reach the EOF. Also if
|
||||||
|
# we don't have less(1) reset things the colour of the rest of the script will
|
||||||
|
# be wrong. Thus in this script the user must hit 'q' to finish this command.
|
||||||
./hou ansi.txt hou.c | less -r
|
./hou ansi.txt hou.c | less -r
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
|||||||
+11
-4
@@ -36,8 +36,9 @@ where the sound of 'V' is 'F' and so the program had the letter be 'F'. A
|
|||||||
problem, however, with changing it is that it breaks other words including in
|
problem, however, with changing it is that it breaks other words including in
|
||||||
German. Thus there is the alternate version instead which fixes a problem for
|
German. Thus there is the alternate version instead which fixes a problem for
|
||||||
Germans that causes problems for Germans so if you're German you'll just have to
|
Germans that causes problems for Germans so if you're German you'll just have to
|
||||||
deal with it :-) It is, however, good as you might be able appreciate the entry
|
deal with it :-) It also breaks other words too and this happens only for one
|
||||||
even more.
|
letter change. With this one should hopefully be able to really appreciate the
|
||||||
|
subtlety of this entry even more.
|
||||||
|
|
||||||
|
|
||||||
### Alternate build:
|
### Alternate build:
|
||||||
@@ -50,7 +51,10 @@ make alt
|
|||||||
### Alternate use:
|
### Alternate use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang.alt
|
||||||
|
|
||||||
echo vier | ./kang.alt
|
echo vier | ./kang.alt
|
||||||
|
|
||||||
echo uno | ./kang.alt
|
echo uno | ./kang.alt
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -58,14 +62,17 @@ echo uno | ./kang.alt
|
|||||||
### Alternate try:
|
### Alternate try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./de.alt.sh # German 0 through 13 both with and without umlaut
|
./try.alt.sh # try various languages
|
||||||
|
|
||||||
./en.alt.sh # English 0 through 13
|
./en.alt.sh # English 0 through 13
|
||||||
|
|
||||||
|
./de.alt.sh # German 0 through 13 with both umlauts and without (additional 'e')
|
||||||
```
|
```
|
||||||
|
|
||||||
What does it get right? What does it get wrong? How does it compare to the
|
What does it get right? What does it get wrong? How does it compare to the
|
||||||
original entry without the change of `f` to `v`?
|
original entry without the change of `f` to `v`?
|
||||||
|
|
||||||
Finally why does it get what it gets wrong wrong?
|
Finally why does it get wrong what it gets wrong?
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|||||||
+4
-3
@@ -37,7 +37,8 @@ done
|
|||||||
j=0
|
j=0
|
||||||
for i in Null eins zwei drei vier fünf fuenf sechs sieben acht neun zehn elf zwoelf zwölf dreizehn ; \
|
for i in Null eins zwei drei vier fünf fuenf sechs sieben acht neun zehn elf zwoelf zwölf dreizehn ; \
|
||||||
do
|
do
|
||||||
echo -n "$i (${NUMBERS[$j]}): "
|
read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: "
|
||||||
echo "$i"|"./$KANG"
|
echo 1>&2
|
||||||
((j++))
|
echo "$i" | "./$KANG"
|
||||||
|
((j++))
|
||||||
done
|
done
|
||||||
+4
-3
@@ -37,7 +37,8 @@ done
|
|||||||
j=0
|
j=0
|
||||||
for i in Null eins zwei drei vier fünf fuenf sechs sieben acht neun zehn elf zwoelf zwölf dreizehn ; \
|
for i in Null eins zwei drei vier fünf fuenf sechs sieben acht neun zehn elf zwoelf zwölf dreizehn ; \
|
||||||
do
|
do
|
||||||
echo -n "$i (${NUMBERS[$j]}): "
|
read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: "
|
||||||
echo "$i"|"./$KANG"
|
echo 1>&2
|
||||||
((j++))
|
echo "$i" | "./$KANG"
|
||||||
|
((j++))
|
||||||
done
|
done
|
||||||
+3
-2
@@ -32,7 +32,8 @@ done
|
|||||||
j=0
|
j=0
|
||||||
for i in zero one two three four five six seven eight nine ten eleven twelve thirteen ; \
|
for i in zero one two three four five six seven eight nine ten eleven twelve thirteen ; \
|
||||||
do
|
do
|
||||||
echo -n "$i (${NUMBERS[$j]}): "
|
read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: "
|
||||||
echo "$i"|"./$KANG"
|
echo 1>&2
|
||||||
|
echo "$i" | "./$KANG"
|
||||||
((j++))
|
((j++))
|
||||||
done
|
done
|
||||||
+3
-2
@@ -33,7 +33,8 @@ done
|
|||||||
j=0
|
j=0
|
||||||
for i in zero one two three four five six seven eight nine ten eleven twelve thirteen ; \
|
for i in zero one two three four five six seven eight nine ten eleven twelve thirteen ; \
|
||||||
do
|
do
|
||||||
echo -n "$i (${NUMBERS[$j]}): "
|
read -r -n 1 -p "Press any key to run: echo $i | ./$KANG # ${NUMBERS[$j]}: "
|
||||||
echo "$i"|"./$KANG"
|
echo 1>&2
|
||||||
|
echo "$i" | "./$KANG"
|
||||||
((j++))
|
((j++))
|
||||||
done
|
done
|
||||||
Executable
+50
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.alt.sh - demonstrate IOCCC winner 2012/kang 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" 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: echo Nineteen hundred and eighty-four | ./kang.alt # 1984: "
|
||||||
|
echo 1>&2
|
||||||
|
echo Nineteen hundred and eighty-four | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo uno | ./kang.alt # 1: "
|
||||||
|
echo 1>&2
|
||||||
|
echo uno | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo trois | ./kang.alt # 3: "
|
||||||
|
echo 1>&2
|
||||||
|
echo trois | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo fier | ./kang.alt # 4, should be vier: "
|
||||||
|
echo 1>&2
|
||||||
|
echo fier | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo vier | ./kang.alt # 4: "
|
||||||
|
echo 1>&2
|
||||||
|
echo vier | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo \"shest'\" | ./kang.alt # 6: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "shest'" | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo dos | ./kang.alt # 2: "
|
||||||
|
echo 1>&2
|
||||||
|
echo dos | ./kang.alt
|
||||||
|
echo 1>&2
|
||||||
+26
-6
@@ -14,20 +14,40 @@ 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
|
||||||
|
|
||||||
echo "$ echo Nineteen hundred and eighty-four | ./kang" 1>&2
|
read -r -n 1 -p "Press any key to run: echo Nineteen hundred and eighty-four | ./kang # 1984: "
|
||||||
|
echo 1>&2
|
||||||
echo Nineteen hundred and eighty-four | ./kang
|
echo Nineteen hundred and eighty-four | ./kang
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo uno | ./kang" 1>&2
|
read -r -n 1 -p "Press any key to run: echo uno | ./kang # 1: "
|
||||||
|
echo 1>&2
|
||||||
echo uno | ./kang
|
echo uno | ./kang
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo trois | ./kang" 1>&2
|
read -r -n 1 -p "Press any key to run: echo trois | ./kang # 3: "
|
||||||
|
echo 1>&2
|
||||||
echo trois | ./kang
|
echo trois | ./kang
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo fier | ./kang # notice the issue here, see alternate code instead" 1>&2
|
read -r -n 1 -p "Press any key to run: echo fier | ./kang # 4, should be vier: "
|
||||||
|
echo 1>&2
|
||||||
echo fier | ./kang # notice the issue here, see alternate code instead
|
echo fier | ./kang # notice the issue here, see alternate code instead
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo \"shest'\" | ./kang" 1>&2
|
read -r -n 1 -p "Press any key to run: echo vier | ./kang # 4: "
|
||||||
|
echo 1>&2
|
||||||
|
echo vier | ./kang # notice the issue here, see alternate code instead
|
||||||
|
echo 1>&2
|
||||||
|
echo "Note: for a version that gets this one right (breaking others" 1>&2
|
||||||
|
echo "including fier), see the alt code." 1>&2
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: echo \"shest'\" | ./kang # 6: "
|
||||||
|
echo 1>&2
|
||||||
echo "shest'" | ./kang
|
echo "shest'" | ./kang
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo dos | ./kang" 1>&2
|
read -r -n 1 -p "Press any key to run: echo dos | ./kang # 2: "
|
||||||
|
echo 1>&2
|
||||||
echo dos | ./kang
|
echo dos | ./kang
|
||||||
|
echo 1>&2
|
||||||
@@ -14,15 +14,19 @@ code](#alternate-code) below.
|
|||||||
./konno N
|
./konno N
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: N is an integer from 0 to 255.
|
|
||||||
|
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./try.sh
|
./try.sh
|
||||||
|
|
||||||
|
# you can also specify numbers to try before the random and preselected ones:
|
||||||
|
./try.sh 111 222 333 444 555 666 777 888 999
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Try running [try.sh](try.sh) a number of times as the first part randomly
|
||||||
|
selects ten numbers to try.
|
||||||
|
|
||||||
|
|
||||||
## Alternate code:
|
## Alternate code:
|
||||||
|
|
||||||
|
|||||||
+39
-15
@@ -15,47 +15,71 @@ 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 "$ ./konno 30" 1>&2
|
# let user specify args to run on program too
|
||||||
|
while [[ "$#" -ge 1 ]]; do
|
||||||
|
read -r -n 1 -p "Press any key to run: ./konno $1: "
|
||||||
|
echo 1>&2
|
||||||
|
./konno "$1"
|
||||||
|
echo 1>&2
|
||||||
|
shift 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# use ten random values (in range $((RANDOM % 101)))
|
||||||
|
i=0
|
||||||
|
# we do it this way to prevent the annoying shellcheck warning that 'i' appears
|
||||||
|
# to be unused (as it would be if 'for i in {0..9}; do .. done').
|
||||||
|
while [[ "$i" -lt 10 ]]; do
|
||||||
|
NUM="$((RANDOM % 101))"
|
||||||
|
read -r -n 1 -p "Press any key to run: ./konno $NUM: "
|
||||||
|
echo 1>&2
|
||||||
|
./konno "$NUM"
|
||||||
|
echo 1>&2
|
||||||
|
((i++))
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# finally use some preselected values
|
||||||
|
read -r -n 1 -p "Press any key to run: ./konno 30: "
|
||||||
|
echo 1>&2
|
||||||
./konno 30
|
./konno 30
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 90: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 90" 1>&2
|
|
||||||
./konno 90
|
./konno 90
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 102: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 102" 1>&2
|
|
||||||
./konno 102
|
./konno 102
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 109: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 109" 1>&2
|
|
||||||
./konno 109
|
./konno 109
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 165: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 165" 1>&2
|
|
||||||
./konno 165
|
./konno 165
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 42: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 42" 1>&2
|
|
||||||
./konno 42
|
./konno 42
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 37: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 37" 1>&2
|
|
||||||
./konno 37
|
./konno 37
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
read -r -n 1 -p "Press any key to run: ./konno 255: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./konno 255" 1>&2
|
|
||||||
./konno 255
|
./konno 255
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: ./konno 10000: "
|
||||||
|
echo 1>&2
|
||||||
|
./konno 10000
|
||||||
|
echo 1>&2
|
||||||
+27
-21
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# try.sh - demonstrate IOCCC winner 2012/omoikane alternate code
|
# try.alt.sh - demonstrate IOCCC winner 2012/omoikane alt code
|
||||||
#
|
#
|
||||||
|
|
||||||
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
|
||||||
@@ -10,7 +10,7 @@ if [[ -z "$CC" ]]; then
|
|||||||
CC="cc"
|
CC="cc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
make CC="$CC" everything >/dev/null || exit 1
|
make 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
|
||||||
@@ -23,27 +23,29 @@ PERL="$(type -P perl)"
|
|||||||
|
|
||||||
echo "$ echo \"A quick brown fox jumps over the lazy dog\" | ./nyaruko.alt > output.c" 1>&2
|
echo "$ echo \"A quick brown fox jumps over the lazy dog\" | ./nyaruko.alt > output.c" 1>&2
|
||||||
echo "A quick brown fox jumps over the lazy dog" | ./nyaruko.alt > output.c
|
echo "A quick brown fox jumps over the lazy dog" | ./nyaruko.alt > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
less -rEXFK output.c
|
||||||
|
|
||||||
# perl specific stuff
|
# perl specific stuff
|
||||||
if [[ -n "$PERL" ]]; then
|
if [[ -n "$PERL" && -f "$PERL" && -x "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: " 1>&2
|
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: " 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
"${PERL}" output.c > data.c
|
"${PERL}" output.c > data.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX data.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show data.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -rEXFK data.c
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to run: cc -o data data.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX data.c
|
|
||||||
echo "$ cc -o data data.c" 1>&2
|
|
||||||
cc -o data data.c
|
cc -o data data.c
|
||||||
read -r -n 1 -p "Press any key to run: ./data: "
|
read -r -n 1 -p "Press any key to run: ./data: "
|
||||||
echo "$ ./data" 1>&2
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./data
|
./data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$ cc -o output output.c" 1>&2
|
read -r -n 1 -p "Press any key to run: cc -o output output.c: "
|
||||||
|
echo 1>&2
|
||||||
cc -o output output.c
|
cc -o output output.c
|
||||||
read -r -n 1 -p "Press any key to run: ./output: "
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -53,37 +55,41 @@ echo "$ ./output" 1>&2
|
|||||||
read -r -n 1 -p "Press any key to run: ./nyaruko.alt < output > output.c: "
|
read -r -n 1 -p "Press any key to run: ./nyaruko.alt < output > output.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./nyaruko.alt < output > output.c
|
./nyaruko.alt < output > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
less -rEXFK output.c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: bash output.c > key.c: "
|
read -r -n 1 -p "Press any key to run: bash output.c > key.c: "
|
||||||
|
echo 1>&2
|
||||||
bash output.c > key.c
|
bash output.c > key.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to run: less -EX key.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: show key.c (space = next page, q = quit): "
|
||||||
less -EX key.c
|
less -rEXFK key.c
|
||||||
|
|
||||||
# more perl stuff
|
# more perl stuff
|
||||||
if [[ -n "${PERL}" ]]; then
|
if [[ -n "${PERL}" && -f "$PERL" && -x "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: "
|
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
"${PERL}" output.c > data.c
|
"${PERL}" output.c > data.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX data.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show data.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX data.c
|
less -rEXFK data.c
|
||||||
read -r -n 1 -p "Press any key to run: cat key.c data.c > output.c: "
|
read -r -n 1 -p "Press any key to run: cat key.c data.c > output.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat key.c data.c > output.c
|
cat key.c data.c > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -rEXFK output.c
|
||||||
|
read -r -n 1 -p "Press any key to run: cc output.c -o output: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
|
||||||
echo "$ cc output.c -o output" 1>&2
|
|
||||||
cc output.c -o output
|
cc output.c -o output
|
||||||
read -r -n 1 -p "Press any key to run: ./output > output.2: "
|
read -r -n 1 -p "Press any key to run: ./output > output.2: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./output > output.2
|
./output > output.2
|
||||||
echo "$ chmod +x output.2" 1>&2
|
read -r -n 1 -p "Press any key to run: chmod +x output.2: "
|
||||||
|
echo 1>&2
|
||||||
chmod +x output.2
|
chmod +x output.2
|
||||||
read -r -n 1 -p "Press any key to run: ./output.2: "
|
read -r -n 1 -p "Press any key to run: ./output.2: "
|
||||||
|
echo 1>&2
|
||||||
./output.2
|
./output.2
|
||||||
fi
|
fi
|
||||||
+25
-19
@@ -23,27 +23,29 @@ PERL="$(type -P perl)"
|
|||||||
|
|
||||||
echo "$ echo \"A quick brown fox jumps over the lazy dog\" | ./nyaruko > output.c" 1>&2
|
echo "$ echo \"A quick brown fox jumps over the lazy dog\" | ./nyaruko > output.c" 1>&2
|
||||||
echo "A quick brown fox jumps over the lazy dog" | ./nyaruko > output.c
|
echo "A quick brown fox jumps over the lazy dog" | ./nyaruko > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
less -rEXFK output.c
|
||||||
|
|
||||||
# perl specific stuff
|
# perl specific stuff
|
||||||
if [[ -n "$PERL" ]]; then
|
if [[ -n "$PERL" && -f "$PERL" && -x "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: " 1>&2
|
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: " 1>&2
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
"${PERL}" output.c > data.c
|
"${PERL}" output.c > data.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX data.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show data.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -rEXFK data.c
|
||||||
|
echo 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to run: cc -o data data.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX data.c
|
|
||||||
echo "$ cc -o data data.c" 1>&2
|
|
||||||
cc -o data data.c
|
cc -o data data.c
|
||||||
read -r -n 1 -p "Press any key to run: ./data: "
|
read -r -n 1 -p "Press any key to run: ./data: "
|
||||||
echo "$ ./data" 1>&2
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./data
|
./data
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$ cc -o output output.c" 1>&2
|
read -r -n 1 -p "Press any key to run: cc -o output output.c: "
|
||||||
|
echo 1>&2
|
||||||
cc -o output output.c
|
cc -o output output.c
|
||||||
read -r -n 1 -p "Press any key to run: ./output: "
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -53,37 +55,41 @@ echo "$ ./output" 1>&2
|
|||||||
read -r -n 1 -p "Press any key to run: ./nyaruko < output > output.c: "
|
read -r -n 1 -p "Press any key to run: ./nyaruko < output > output.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./nyaruko < output > output.c
|
./nyaruko < output > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
less -rEXFK output.c
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: bash output.c > key.c: "
|
read -r -n 1 -p "Press any key to run: bash output.c > key.c: "
|
||||||
|
echo 1>&2
|
||||||
bash output.c > key.c
|
bash output.c > key.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
read -r -n 1 -p "Press any key to run: less -EX key.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: show key.c (space = next page, q = quit): "
|
||||||
less -EX key.c
|
less -rEXFK key.c
|
||||||
|
|
||||||
# more perl stuff
|
# more perl stuff
|
||||||
if [[ -n "${PERL}" ]]; then
|
if [[ -n "${PERL}" && -f "$PERL" && -x "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: "
|
read -r -n 1 -p "Press any key to run: ${PERL} output.c > data.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
"${PERL}" output.c > data.c
|
"${PERL}" output.c > data.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX data.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show data.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX data.c
|
less -rEXFK data.c
|
||||||
read -r -n 1 -p "Press any key to run: cat key.c data.c > output.c: "
|
read -r -n 1 -p "Press any key to run: cat key.c data.c > output.c: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat key.c data.c > output.c
|
cat key.c data.c > output.c
|
||||||
read -r -n 1 -p "Press any key to run: less -EX output.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to show output.c (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
less -rEXFK output.c
|
||||||
|
read -r -n 1 -p "Press any key to run: cc output.c -o output: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EX output.c
|
|
||||||
echo "$ cc output.c -o output" 1>&2
|
|
||||||
cc output.c -o output
|
cc output.c -o output
|
||||||
read -r -n 1 -p "Press any key to run: ./output > output.2: "
|
read -r -n 1 -p "Press any key to run: ./output > output.2: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./output > output.2
|
./output > output.2
|
||||||
echo "$ chmod +x output.2" 1>&2
|
read -r -n 1 -p "Press any key to run: chmod +x output.2: "
|
||||||
|
echo 1>&2
|
||||||
chmod +x output.2
|
chmod +x output.2
|
||||||
read -r -n 1 -p "Press any key to run: ./output.2: "
|
read -r -n 1 -p "Press any key to run: ./output.2: "
|
||||||
|
echo 1>&2
|
||||||
./output.2
|
./output.2
|
||||||
fi
|
fi
|
||||||
+38
-48
@@ -15,106 +15,96 @@ 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
|
||||||
|
|
||||||
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
|
read -r -n 1 -p "Press any key to run: (cat hilbert.Blc; echo -n \"1\") | ./tromp: "
|
||||||
# shellcheck disable=SC2140
|
|
||||||
echo "$ (cat hilbert.Blc; echo -n "1") | ./tromp" 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
(cat hilbert.Blc; echo -n "1") | ./tromp
|
(cat hilbert.Blc; echo -n "1") | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
|
read -r -n 1 -p "Press any key to run: (cat hilbert.Blc; echo -n \"12\") | ./tromp: "
|
||||||
# shellcheck disable=SC2140
|
|
||||||
echo "$ (cat hilbert.Blc; echo -n "12") | ./tromp" 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
(cat hilbert.Blc; echo -n "12") | ./tromp
|
(cat hilbert.Blc; echo -n "12") | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
# ^-- SC2140 (warning): Word is of the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
|
# There's no such thing as a useless cat so we silence. Well okay it's also
|
||||||
# shellcheck disable=SC2140
|
# because it's easier to verify that it works as this form was given by the
|
||||||
echo "$ (cat hilbert.Blc; echo -n "123") | ./tromp" 1>&2
|
# author.
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
|
||||||
|
|
||||||
# There's no such thing as a useless cat so we silence:
|
|
||||||
#
|
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
|
||||||
#
|
#
|
||||||
|
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
||||||
|
# https://www.shellcheck.net/wiki/SC2002
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
|
read -r -n 1 -p "Press any key to run: (cat hilbert.Blc; echo -n \"123\") | ./tromp: "
|
||||||
|
echo 1>&2
|
||||||
(cat hilbert.Blc; echo -n "123") | ./tromp
|
(cat hilbert.Blc; echo -n "123") | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ (cat hilbert.Blc; echo -n 1234) | ./tromp" 1>&2
|
read -r -n 1 -p "Press any key to run: (cat hilbert.Blc; echo -n 1234) | ./tromp: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
# There's no such thing as a useless cat so we silence:
|
# There's no such thing as a useless cat so we silence. Well okay it's also
|
||||||
#
|
# because it's easier to verify that it works as this form was given by the
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
# author.
|
||||||
#
|
#
|
||||||
|
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
||||||
|
# https://www.shellcheck.net/wiki/SC2002
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
|
|
||||||
(cat hilbert.Blc; echo -n 1234) | ./tromp
|
(cat hilbert.Blc; echo -n 1234) | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo " Hello, world" | ./tromp"
|
read -r -n 1 -p "Press any key to run: echo \" Hello, world\" | ./tromp: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo " Hello, world" | ./tromp
|
echo " Hello, world" | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ echo "*Hello, world" | ./tromp" 1>&2
|
read -r -n 1 -p "Press any key to run: echo \"*Hello, world\" | ./tromp: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "*Hello, world" | ./tromp
|
echo "*Hello, world" | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ (cat uni8.Blc; echo " Ni hao") | ./tromp" 1>&2
|
read -r -n 1 -p "Press any key to run: (cat uni8.Blc; echo \" Ni hao\") | ./tromp: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
# There's no such thing as a useless cat so we silence:
|
|
||||||
#
|
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
|
||||||
#
|
|
||||||
# shellcheck disable=SC2002
|
|
||||||
(cat uni8.Blc; echo " Ni hao") | ./tromp
|
(cat uni8.Blc; echo " Ni hao") | ./tromp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat primes.blc | ./tromp -b | head -c 70" 1>&2
|
echo "$ cat primes.blc | ./tromp -b | head -c 70" 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
|
||||||
# There's no such thing as a useless cat so we silence:
|
# There's no such thing as a useless cat so we silence. Well okay it's also
|
||||||
#
|
# because it's easier to verify that it works as this form was given by the
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
# author.
|
||||||
#
|
#
|
||||||
|
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
||||||
|
# https://www.shellcheck.net/wiki/SC2002
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
cat primes.blc | ./tromp -b | head -c 70
|
cat primes.blc | ./tromp -b | head -c 70
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ (cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70" 1>&2
|
echo "$ (cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70" 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
|
||||||
# There's no such thing as a useless cat so we silence:
|
|
||||||
#
|
# There's no such thing as a useless cat so we silence. Well okay it's also
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
# because it's easier to verify that it works as this form was given by the
|
||||||
|
# author.
|
||||||
#
|
#
|
||||||
|
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
||||||
|
# https://www.shellcheck.net/wiki/SC2002
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
(cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70
|
(cat oddindices.Blc; echo -n " "; cat primes.blc | ./tromp -b) | ./tromp | head -c 70
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
echo "$ cat hw.bf" 1>&2
|
read -r -n 1 -p "Press any key to run: cat hw.bf: "
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
cat hw.bf
|
cat hw.bf
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ cat bf.Blc hw.bf | ./tromp" 1>&2
|
|
||||||
read -r -n 1 -p "Press any key to continue: "
|
|
||||||
|
read -r -n 1 -p "Press any key to run: cat bf.Blc hw.bf | ./tromp: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
# There's no such thing as a useless cat so we silence:
|
# There's no such thing as a useless cat so we silence. Well okay it's also
|
||||||
#
|
# because it's easier to verify that it works as this form was given by the
|
||||||
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
# author.
|
||||||
#
|
#
|
||||||
|
# SC2002 (style): Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
|
||||||
|
# https://www.shellcheck.net/wiki/SC2002
|
||||||
# shellcheck disable=SC2002
|
# shellcheck disable=SC2002
|
||||||
cat bf.Blc hw.bf | ./tromp
|
cat bf.Blc hw.bf | ./tromp
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -15,18 +15,6 @@ 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 embed chocolate in chocolate-in-ioccc.png: "
|
|
||||||
echo 1>&2
|
|
||||||
echo "$ ./vik e chocolate-in-ioccc.png \"Mmm... chocolate.\" > mmm-chocolate.png" 1>&2
|
|
||||||
./vik e chocolate-in-ioccc.png "Mmm... chocolate." > mmm-chocolate.png
|
|
||||||
echo 1>&2
|
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to extract chocolate from mmm-chocolate.png: "
|
|
||||||
echo 1>&2
|
|
||||||
echo "$ ./vik d mmm-chocolate.png" 1>&2
|
|
||||||
./vik d mmm-chocolate.png
|
|
||||||
echo 1>&2
|
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to embed chocolate.png in ioccc.png: "
|
read -r -n 1 -p "Press any key to embed chocolate.png in ioccc.png: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./vik e ioccc.png chocolate.png > chocolate-in-ioccc.png" 1>&2
|
echo "$ ./vik e ioccc.png chocolate.png > chocolate-in-ioccc.png" 1>&2
|
||||||
@@ -39,6 +27,18 @@ echo "$ ./vik e chocolate.png ioccc.png > ioccc-in-chocolate.png"
|
|||||||
./vik e chocolate.png ioccc.png > ioccc-in-chocolate.png
|
./vik e chocolate.png ioccc.png > ioccc-in-chocolate.png
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to embed chocolate in chocolate-in-ioccc.png: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ ./vik e chocolate-in-ioccc.png \"Mmm... chocolate.\" > mmm-chocolate.png" 1>&2
|
||||||
|
./vik e chocolate-in-ioccc.png "Mmm... chocolate." > mmm-chocolate.png
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to extract chocolate from mmm-chocolate.png: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ ./vik d mmm-chocolate.png" 1>&2
|
||||||
|
./vik d mmm-chocolate.png
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to embed a brainfuck program as a text file and decode it: "
|
read -r -n 1 -p "Press any key to embed a brainfuck program as a text file and decode it: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./vik e ioccc.png .+[.+] > encodedimg.png" 1>&2
|
echo "$ ./vik e ioccc.png .+[.+] > encodedimg.png" 1>&2
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ PERL="$(type -P perl)"
|
|||||||
|
|
||||||
if [[ -n "$PERL" ]]; then
|
if [[ -n "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to try a random run: "
|
read -r -n 1 -p "Press any key to try a random run: "
|
||||||
|
echo 1>&2
|
||||||
perl -e 'map{map{print int(rand()*8);}(0..16);print chr(10);}(0..30);' | tr '[0-4]' ' '| ./birken.alt
|
perl -e 'map{map{print int(rand()*8);}(0..16);print chr(10);}(0..30);' | tr '[0-4]' ' '| ./birken.alt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -30,7 +31,8 @@ for i in *.txt; do
|
|||||||
-e 's/Cheepcheep/Cheep Cheep/g' -e 's/Happyface/Happy Face/g' -e 's/Paranaplant/Piranha Plant/g' \
|
-e 's/Cheepcheep/Cheep Cheep/g' -e 's/Happyface/Happy Face/g' -e 's/Paranaplant/Piranha Plant/g' \
|
||||||
-e 's/Koopaparatroopa/Koopa Paratroopa/g')"
|
-e 's/Koopaparatroopa/Koopa Paratroopa/g')"
|
||||||
read -r -n1 -p "Press any key to try $NAME: "
|
read -r -n1 -p "Press any key to try $NAME: "
|
||||||
|
echo 1>&2
|
||||||
./birken.alt < "$i"
|
./birken.alt < "$i"
|
||||||
echo
|
echo 1>&2
|
||||||
done
|
done
|
||||||
clear
|
clear
|
||||||
+3
-1
@@ -20,6 +20,7 @@ PERL="$(type -P perl)"
|
|||||||
|
|
||||||
if [[ -n "$PERL" ]]; then
|
if [[ -n "$PERL" ]]; then
|
||||||
read -r -n 1 -p "Press any key to try a random run: "
|
read -r -n 1 -p "Press any key to try a random run: "
|
||||||
|
echo 1>&2
|
||||||
perl -e 'map{map{print int(rand()*8);}(0..16);print chr(10);}(0..30);' | tr '[0-4]' ' '| ./birken
|
perl -e 'map{map{print int(rand()*8);}(0..16);print chr(10);}(0..30);' | tr '[0-4]' ' '| ./birken
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -29,7 +30,8 @@ for i in *.txt; do
|
|||||||
-e 's/Cheepcheep/Cheep Cheep/g' -e 's/Happyface/Happy Face/g' -e 's/Paranaplant/Piranha Plant/g' \
|
-e 's/Cheepcheep/Cheep Cheep/g' -e 's/Happyface/Happy Face/g' -e 's/Paranaplant/Piranha Plant/g' \
|
||||||
-e 's/Koopaparatroopa/Koopa Paratroopa/g')"
|
-e 's/Koopaparatroopa/Koopa Paratroopa/g')"
|
||||||
read -r -n1 -p "Press any key to try $NAME: "
|
read -r -n1 -p "Press any key to try $NAME: "
|
||||||
|
echo 1>&2
|
||||||
./birken < "$i"
|
./birken < "$i"
|
||||||
echo
|
echo 1>&2
|
||||||
done
|
done
|
||||||
clear
|
clear
|
||||||
+4
-2
@@ -37,7 +37,8 @@ read -r -n 1 -p "Press any key to extract and compile C code by OCR: "
|
|||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./cable2 hello_world.bmp | gcc -xc -o hello -" 1>&2
|
echo "$ ./cable2 hello_world.bmp | gcc -xc -o hello -" 1>&2
|
||||||
./cable2 hello_world.bmp | gcc -xc -o hello -
|
./cable2 hello_world.bmp | gcc -xc -o hello -
|
||||||
echo "$ ./hello" 1>&2
|
read -r -n 1 -p "Press any key to run: ./hello: "
|
||||||
|
echo 1>&2
|
||||||
./hello
|
./hello
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
@@ -45,7 +46,8 @@ echo "Sometimes typeset text will work if the typeset has characters that are" 1
|
|||||||
echo "enough to support the handwritten shapes." 1>&2
|
echo "enough to support the handwritten shapes." 1>&2
|
||||||
read -r -n 1 -p "Press any key to try Menlo 160pt text: "
|
read -r -n 1 -p "Press any key to try Menlo 160pt text: "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
echo "$ ./cable2 typeset.bmp" 1>&2
|
read -r -n 1 -p "Press any key to run: ./cable2 typeset.bmp: "
|
||||||
|
echo 1>&2
|
||||||
./cable2 typeset.bmp
|
./cable2 typeset.bmp
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ ENTRY= cable3
|
|||||||
PROG= ${ENTRY}
|
PROG= ${ENTRY}
|
||||||
#
|
#
|
||||||
OBJ= ${PROG}.o
|
OBJ= ${PROG}.o
|
||||||
DATA= bios fd.img runme sc-ioccc.terminal screenshot_autocad.png \
|
DATA= bios fd.img cable3.sh sc-ioccc.terminal screenshot_autocad.png \
|
||||||
screenshot_flightsim4.png screenshot_lotus123.png screenshot_qbasic.png \
|
screenshot_flightsim4.png screenshot_lotus123.png screenshot_qbasic.png \
|
||||||
screenshot_simcity.png screenshot_win3_on_macosx.png
|
screenshot_simcity.png screenshot_win3_on_macosx.png
|
||||||
TARGET= ${PROG}
|
TARGET= ${PROG}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ available. See the [Alternate code](#alternate-code) section below.
|
|||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./runme
|
./cable3.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: to quit the program type `QUITEMU`. You might have to be at the top level
|
NOTE: to quit the program type `QUITEMU`. You might have to be at the top level
|
||||||
@@ -211,7 +211,7 @@ stty cbreak raw -echo min 0
|
|||||||
stty cooked echo
|
stty cooked echo
|
||||||
```
|
```
|
||||||
|
|
||||||
See the [runme](runme) script.
|
See the [cable3.sh](cable3.sh) script.
|
||||||
|
|
||||||
## To use the emulator - floppy mode only
|
## To use the emulator - floppy mode only
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ the `fd.img` provided, which is a FreeDOS boot disk.
|
|||||||
Before running the emulator on a Unix-type system, `stty` needs to be used to
|
Before running the emulator on a Unix-type system, `stty` needs to be used to
|
||||||
put the keyboard into raw mode (and afterwards it needs to be put back to
|
put the keyboard into raw mode (and afterwards it needs to be put back to
|
||||||
cooked). So, run the emulator using something like this script (provided as
|
cooked). So, run the emulator using something like this script (provided as
|
||||||
[runme](runme)):
|
[cable3.sh](cable3.sh)):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
stty cbreak raw -echo min 0
|
stty cbreak raw -echo min 0
|
||||||
|
|||||||
File renamed without changes.
+15
-7
@@ -11,12 +11,20 @@ if [[ -z "$CC" ]]; then
|
|||||||
fi
|
fi
|
||||||
make CC="$CC" all >/dev/null || exit 1
|
make CC="$CC" all >/dev/null || exit 1
|
||||||
|
|
||||||
echo "$ ./try.sh | tail -n 3 > 1.txt" 1>&2
|
read -r -n 1 -p "Press any key to run: ./try.sh | tail -n 3 | tee 1.txt: "
|
||||||
./try.sh | tail -n 3 > 1.txt
|
./try.sh | tail -n 3 | tee 1.txt
|
||||||
|
|
||||||
echo "$ echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt" 1>&2
|
echo "$ echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt" 1>&2
|
||||||
echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt
|
read -r -n 1 -p "Press any key to run: echo 'IOCCC winning entry 2013/dlowe' | tee ioccc.txt: "
|
||||||
echo "$ ./try.sh | tail -n 3 > 2.txt" 1>&2
|
echo 1>&2
|
||||||
./try.sh | tail -n 3 > 2.txt
|
echo 'IOCCC winning entry 2013/dlowe' | tee ioccc.txt
|
||||||
echo "$ diff 1.txt 2.txt" 1>&2
|
|
||||||
diff 1.txt 2.txt
|
read -r -n 1 -p "Press any key to run: ./try.sh | tail -n 3 | tee 2.txt: "
|
||||||
|
echo 1>&2
|
||||||
|
./try.sh | tail -n 3 | tee 2.txt
|
||||||
|
echo 1>&2
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press any key to run: diff -s 1.txt 2.txt: "
|
||||||
|
echo 1>&2
|
||||||
|
diff -s 1.txt 2.txt
|
||||||
rm -f 1.txt 2.txt ioccc.txt
|
rm -f 1.txt 2.txt ioccc.txt
|
||||||
@@ -15,5 +15,7 @@ make CC="$CC" all >/dev/null || exit 1
|
|||||||
|
|
||||||
ln -sf dlowe sparkl
|
ln -sf dlowe sparkl
|
||||||
ls -1 *
|
ls -1 *
|
||||||
|
echo 1>&2
|
||||||
echo -n "sparkline length of above files: "
|
echo -n "sparkline length of above files: "
|
||||||
wc -c ./* | awk '{print $1}' | xargs ./sparkl
|
wc -c ./* | awk '{print $1}' | xargs ./sparkl
|
||||||
|
echo 1>&2
|
||||||
+7
-6
@@ -17,12 +17,12 @@ clear
|
|||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: less endoh1.c (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: less endoh1.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
less -EXF endoh1.c
|
less -rEXFK endoh1.c
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./endoh1 hello.lazy: "
|
read -r -n 1 -p "Press any key to run: ./endoh1 hello.lazy (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./endoh1 hello.lazy
|
./endoh1 hello.lazy | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./hello: "
|
read -r -n 1 -p "Press any key to run: ./hello: "
|
||||||
@@ -35,12 +35,13 @@ echo 1>&2
|
|||||||
# ShellCheck gets this wrong, thinking ./echo is the shell built-in or system
|
# ShellCheck gets this wrong, thinking ./echo is the shell built-in or system
|
||||||
# command so we disable the warning.
|
# command so we disable the warning.
|
||||||
#
|
#
|
||||||
# ^----^ SC2216 (warning): Piping to 'echo', a command that doesn't read stdin. Did you want 'cat' instead?
|
# SC2216 (warning): Piping to 'echo', a command that doesn't read stdin. Did you want 'cat' instead?
|
||||||
|
# https://www.shellcheck.net/wiki/SC2216
|
||||||
# shellcheck disable=SC2216
|
# shellcheck disable=SC2216
|
||||||
echo Hello | ./echo
|
echo Hello | ./echo
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
|
|
||||||
read -r -n 1 -p "Press any key to run: ./tac < endoh1.c | less (space = next page, q = quit): "
|
read -r -n 1 -p "Press any key to run: ./tac < endoh1.c (space = next page, q = quit): "
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
./tac < endoh1.c | less -EXF
|
./tac < endoh1.c | less -rEXFK
|
||||||
echo 1>&2
|
echo 1>&2
|
||||||
@@ -3019,12 +3019,12 @@ will likely dump core.
|
|||||||
### Information: [2012/vik/README.md](2012/vik/README.md)
|
### Information: [2012/vik/README.md](2012/vik/README.md)
|
||||||
|
|
||||||
The author stated that the program will crash if no argument is passed to the
|
The author stated that the program will crash if no argument is passed to the
|
||||||
program or if invalid arguments or images of mismatching sizes or unsupported
|
program or if invalid arguments (e.g. file does not exist) or images of
|
||||||
pixel formats though we note that your computer might also [halt and catch
|
mismatching sizes or unsupported pixel formats though we note that your computer
|
||||||
|
might also [halt and catch
|
||||||
fire](https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing)) :-)
|
fire](https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing)) :-)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 2013
|
# 2013
|
||||||
|
|
||||||
## 2013 cable2
|
## 2013 cable2
|
||||||
|
|||||||
+20
-19
@@ -3769,7 +3769,9 @@ which the recipe file now links to.
|
|||||||
|
|
||||||
## <a name="2012_hamano"></a>[2012/hamano](/2012/hamano/hamano.c) ([README.md](/2012/hamano/README.md]))
|
## <a name="2012_hamano"></a>[2012/hamano](/2012/hamano/hamano.c) ([README.md](/2012/hamano/README.md]))
|
||||||
|
|
||||||
[Cody](#cody) added the [try.sh](/2012/hamano/try.sh) script.
|
[Cody](#cody) added the [try.sh](/2012/hamano/try.sh) script and the helper
|
||||||
|
Makefile rules `hint.pdf`, `hint`, `hello.pdf` and `hello` to simplify the
|
||||||
|
procedure for both `hint.pdf` and `hello.pdf` as well as compiling them as C.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2012_hou"></a>[2012/hou](/2012/hou/hou.c) ([README.md](/2012/hou/README.md]))
|
## <a name="2012_hou"></a>[2012/hou](/2012/hou/hou.c) ([README.md](/2012/hou/README.md]))
|
||||||
@@ -3795,7 +3797,7 @@ about it. Using both, however, allows one to experience different capabilities
|
|||||||
and also enjoy or appreciate the entry even more, given how simple the
|
and also enjoy or appreciate the entry even more, given how simple the
|
||||||
difference is.
|
difference is.
|
||||||
|
|
||||||
Cody also added five scripts: [en.sh](/2012/kang/en.sh),
|
Cody also added six scripts: [en.sh](/2012/kang/en.sh),
|
||||||
[de.sh](/2012/kang/de.sh), [en.alt.sh](/2012/kang/en.alt.sh) and
|
[de.sh](/2012/kang/de.sh), [en.alt.sh](/2012/kang/en.alt.sh) and
|
||||||
[de.alt.sh](/2012/de.alt.sh) which count from 0 through 13 in English and German
|
[de.alt.sh](/2012/de.alt.sh) which count from 0 through 13 in English and German
|
||||||
using the original entry and the alt version respectively.
|
using the original entry and the alt version respectively.
|
||||||
@@ -3805,8 +3807,10 @@ In the German scripts it uses the umlaut and also does it without the umlaut
|
|||||||
either version but the `.alt.sh` versions default to the `alt` version whereas
|
either version but the `.alt.sh` versions default to the `alt` version whereas
|
||||||
the other defaults to the submitted entry. See the README.md for details.
|
the other defaults to the submitted entry. See the README.md for details.
|
||||||
|
|
||||||
The fifth script, [try.sh](/2012/kang/try.sh), runs a sequence of commands to
|
The fifth and sixth scripts, [try.sh](/2012/kang/try.sh) and
|
||||||
show different languages and numbers.
|
[try.alt.sh](/2012/kang/try.alt.sh), run a sequence of commands to
|
||||||
|
show different languages and numbers with the submitted and alternate version
|
||||||
|
respectively. Notice how a single letter changes so much!
|
||||||
|
|
||||||
|
|
||||||
## <a name="2012_konno"></a>[2012/konno](/2012/konno/konno.c) ([README.md](/2012/konno/README.md]))
|
## <a name="2012_konno"></a>[2012/konno](/2012/konno/konno.c) ([README.md](/2012/konno/README.md]))
|
||||||
@@ -3816,17 +3820,15 @@ show different languages and numbers.
|
|||||||
|
|
||||||
## <a name="2012_omoikane"></a>[2012/omoikane](/2012/omoikane/omoikane.c) ([README.md](/2012/omoikane/README.md]))
|
## <a name="2012_omoikane"></a>[2012/omoikane](/2012/omoikane/omoikane.c) ([README.md](/2012/omoikane/README.md]))
|
||||||
|
|
||||||
[Cody](#cody) added the [try.sh](/2012/omoikane/try.sh) script.
|
[Cody](#cody) added the [alternate versions](/2012/omoikane/README.md#alternate-code)
|
||||||
|
|
||||||
Cody also added the [alternate code](/2012/omoikane/README.md#alternate-code)
|
|
||||||
which will, if no arg is specified, read in the program itself, rather than
|
which will, if no arg is specified, read in the program itself, rather than
|
||||||
`/dev/urandom`. This is mostly useful for those without a `/dev/urandom` device
|
`/dev/urandom`. This is mostly useful for those without a `/dev/urandom` device
|
||||||
file (the default for the entry). The second alternate version is like the first
|
file (the default for the entry). The second alternate version is like the first
|
||||||
except that it also sets binary mode on `stdin` and `stdout` which should
|
except that it also sets binary mode on `stdin` and `stdout` which should
|
||||||
theoretically make it work in Windows.
|
theoretically make it work in Windows.
|
||||||
|
|
||||||
Cody also added the [try.alt.sh](/2012/omoikane/try.alt.sh) script that is like
|
Cody also added the [try.sh](/2012/omoikane/try.sh) and
|
||||||
the `try.sh` script but which uses the (first version of the) alt code instead.
|
[try.alt.sh](/2012/omoikane/try.alt.sh) scripts.
|
||||||
|
|
||||||
|
|
||||||
## <a name="2012_tromp"></a>[2012/tromp](/2012/tromp/tromp.c) ([README.md](/2012/tromp/README.md))
|
## <a name="2012_tromp"></a>[2012/tromp](/2012/tromp/tromp.c) ([README.md](/2012/tromp/README.md))
|
||||||
@@ -3836,14 +3838,11 @@ the `try.sh` script but which uses the (first version of the) alt code instead.
|
|||||||
|
|
||||||
## <a name="2012_vik"></a>[2012/vik](/2012/vik/vik.c) ([README.md](/2012/vik/README.md]))
|
## <a name="2012_vik"></a>[2012/vik](/2012/vik/vik.c) ([README.md](/2012/vik/README.md]))
|
||||||
|
|
||||||
|
[Cody](#cody) added the [try.sh](/2012/vik/try.sh) script.
|
||||||
|
|
||||||
Based on the author's description it should be able to get this entry to work
|
Based on the author's description it should be able to get this entry to work
|
||||||
for Windows. With his instructions Cody added the alternate version that does
|
for Windows. With his instructions Cody also added the alternate version that
|
||||||
this for the few who might use Windows.
|
does this for the few who might use Windows.
|
||||||
|
|
||||||
We're not sure whether we want to thank Cody or not for this :-) and he's not
|
|
||||||
sure if he wants to be thanked either :-) but we appreciate it nonetheless.
|
|
||||||
|
|
||||||
Cody also added the [try.sh](/2012/vik/try.sh) script.
|
|
||||||
|
|
||||||
|
|
||||||
## <a name="2012_zeitak"></a>[2012/zeitak](/2012/zeitak/zeitak.c) ([README.md](/2012/zeitak/README.md]))
|
## <a name="2012_zeitak"></a>[2012/zeitak](/2012/zeitak/zeitak.c) ([README.md](/2012/zeitak/README.md]))
|
||||||
@@ -3904,9 +3903,11 @@ Later on in an updated macOS (problem discovered in macOS Sonoma) the entry
|
|||||||
failed to compile again also due to `localtime()` so he removed the prototype
|
failed to compile again also due to `localtime()` so he removed the prototype
|
||||||
entirely to solve the problem.
|
entirely to solve the problem.
|
||||||
|
|
||||||
Cody also slightly improved the `runme` script to not assume that the program has
|
Cody also slightly improved the `runme` script (renamed to
|
||||||
been compiled by running `make clobber all || exit 1` and he also made it pass
|
[cable3.sh](/2013/cable3/cable3.sh) for consistency with other entries that have
|
||||||
`shellcheck` (using `[[ .. ]]` over `[ .. ]`).
|
wrapper scripts) to not assume that the program has been compiled by running
|
||||||
|
`make clobber all || exit 1` and he also made it pass `shellcheck` (using `[[ ..
|
||||||
|
]]` over `[ .. ]`).
|
||||||
|
|
||||||
As well, based on the author's remarks, Cody added the [alternate
|
As well, based on the author's remarks, Cody added the [alternate
|
||||||
code](/2013/cable3/cable3.alt.c) which should be compilable for Windows/MS Visual
|
code](/2013/cable3/cable3.alt.c) which should be compilable for Windows/MS Visual
|
||||||
|
|||||||
Reference in new issue
Block a user