Add 2015/yang/try.sh + formatting/typo checks
This commit is contained in:
1 parent
07c10027f7
commit
8d020bac96
3 files changed
+93
-23
No files matched your search
+6
-23
@@ -8,35 +8,16 @@ make
|
|||||||
## To use:
|
## To use:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo Some text | ./prog\
|
echo Some text | ./prog
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### Try:
|
### Try:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
echo IOCCC 2015 | ./prog | tee output.c
|
./try.sh
|
||||||
make output
|
|
||||||
./output
|
|
||||||
|
|
||||||
echo IOCCC 2015 | ./prog_c11 | tee output.c
|
|
||||||
make output
|
|
||||||
./output
|
|
||||||
|
|
||||||
echo IOCCC 2015 | ./prog_c++98 | tee output.c
|
|
||||||
make output
|
|
||||||
./output
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Also try:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
./prog
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
Keep pressing enter to see more output. Send EOF to terminate.
|
|
||||||
|
|
||||||
|
|
||||||
## Judges' remarks:
|
## Judges' remarks:
|
||||||
|
|
||||||
@@ -54,7 +35,7 @@ so you need not worry about this.
|
|||||||
## Author's remarks:
|
## Author's remarks:
|
||||||
|
|
||||||
`Fuuko` is a [sea star](https://en.wikipedia.org/wiki/Starfish) generator. Feed
|
`Fuuko` is a [sea star](https://en.wikipedia.org/wiki/Starfish) generator. Feed
|
||||||
her some input through `stdin` to get lots of sea star patterns in `stdout`.
|
her some input through `stdin` to get lots of sea star patterns on `stdout`.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90
|
cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90
|
||||||
@@ -70,7 +51,7 @@ echo IOCCC | ./fuuko_c99 > output_c99.c
|
|||||||
```
|
```
|
||||||
|
|
||||||
Don't like [sea stars](https://en.wikipedia.org/wiki/Starfish)? Use a C++98
|
Don't like [sea stars](https://en.wikipedia.org/wiki/Starfish)? Use a C++98
|
||||||
compiler to get [dango](https://en.wikipedia.org/wiki/Dango) instead.
|
compiler to get a [dango](https://en.wikipedia.org/wiki/Dango) instead.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
g++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98
|
g++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98
|
||||||
@@ -102,6 +83,7 @@ filled with pointer dereferences (C stars).
|
|||||||
Next time people ask you for a few pointers on C, you can run their
|
Next time people ask you for a few pointers on C, you can run their
|
||||||
question through `Fuuko` and give them pointers all day long.
|
question through `Fuuko` and give them pointers all day long.
|
||||||
|
|
||||||
|
|
||||||
### Compatibility
|
### Compatibility
|
||||||
|
|
||||||
`Fuuko` has been tested under these environments:
|
`Fuuko` has been tested under these environments:
|
||||||
@@ -117,6 +99,7 @@ question through `Fuuko` and give them pointers all day long.
|
|||||||
- clang 3.4.1 on Linux
|
- clang 3.4.1 on Linux
|
||||||
- tcc 0.9.25 on JS/Linux (C99 only)
|
- tcc 0.9.25 on JS/Linux (C99 only)
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
The most obscure parts are in detecting the subtle differences in
|
The most obscure parts are in detecting the subtle differences in
|
||||||
|
|||||||
Executable
+85
@@ -0,0 +1,85 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - demonstrate IOCCC winner 2015/yang
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
echo IOCCC 2015 | ./prog | tee output.c | less -EXF
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog_c90 | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to show sea star (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
echo IOCCC 2015 | ./prog_c90 | tee output.c | less -EXF
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog_c99 | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to show sea star with eyes (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
echo IOCCC 2015 | ./prog_c99 | tee output.c | less -EXF
|
||||||
|
echo "Did you notice the 'rabbit' in there?" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to continue: "
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog_cpp98 | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to show dango (space = next page, q = quit): "
|
||||||
|
echo IOCCC 2015 | ./prog_cpp98 | tee output.c | less -EXF
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog_cpp11 | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to show circles/Swiss cheese (space = next page, q = quit): "
|
||||||
|
echo IOCCC 2015 | ./prog_cpp11 | tee output.c | less -EXF
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
echo 1>&2
|
||||||
|
echo "$ echo IOCCC 2015 | ./prog_c11 | tee output.c | less" 1>&2
|
||||||
|
read -r -n 1 -p "Press any key to show no extra pattern (space = next page, q = quit): "
|
||||||
|
echo 1>&2
|
||||||
|
echo IOCCC 2015 | ./prog_c11 | tee output.c | less -EXF
|
||||||
|
echo "$ make CC=\"${CC}\" output" 1>&2
|
||||||
|
make CC="${CC}" output 2>/dev/null
|
||||||
|
read -r -n 1 -p "Press any key to run: ./output: "
|
||||||
|
echo 1>&2
|
||||||
|
./output
|
||||||
|
|
||||||
|
read -r -n 1 -p "Press enter key repeatedly to get more output (send EOF to quit): "
|
||||||
|
./prog
|
||||||
|
exit 0
|
||||||
@@ -3811,6 +3811,8 @@ files from compiling properly, trying instead to compile already compiled code.
|
|||||||
He also added explicit linking of libm (`-lm`) for systems that do not do this
|
He also added explicit linking of libm (`-lm`) for systems that do not do this
|
||||||
(Linux seems to not but macOS does).
|
(Linux seems to not but macOS does).
|
||||||
|
|
||||||
|
He also added the [try.sh](2015/yang/try.sh) script.
|
||||||
|
|
||||||
|
|
||||||
# <a name="2018"></a>2018
|
# <a name="2018"></a>2018
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user