diff --git a/1998/bas1/README.md b/1998/bas1/README.md index a5593639c..edc15f82a 100644 --- a/1998/bas1/README.md +++ b/1998/bas1/README.md @@ -7,22 +7,8 @@ make all ## To use: -If `lpr` on your system can print PostScript: - ```sh -./bemazing | gunzip | lpr -``` - -else, while in X Window System, - -```sh -./bemazing | gunzip | gv - -``` - -or: - -```sh -./bemazing | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' - +./bas1.sh ``` diff --git a/1998/bas1/bas1.sh b/1998/bas1/bas1.sh new file mode 100755 index 000000000..a00ada507 --- /dev/null +++ b/1998/bas1/bas1.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# +# bas1.sh - run IOCCC winner 1998/bas1 +# + +# 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" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear + +echo "** Bemazing Modes ** + +(0) Use lpr (if lpr(1) can print PostScript) +(1) Use X11 (with gv(1)) +(2) Use X11 (with gs(1) and xv(1)) +" + +read -rp "Make a selection (0 - 2 or any other key to exit): " mode +echo 1>&2 + +case "${mode}" in + 0) ./bemazing | gunzip | lpr + ;; + 1) ./bemazing | gunzip | gv - + ;; + 2) ./bemazing | gunzip | gs -sDEVICE=pgmraw -sOutputFile='|xv -' - + ;; + *) exit 0 +esac diff --git a/2000/natori/README.md b/2000/natori/README.md index 0c0cc7e7c..ab66de871 100644 --- a/2000/natori/README.md +++ b/2000/natori/README.md @@ -22,6 +22,9 @@ version](#alternate-code) below. ./try.sh ``` +Try running this on different days, say a few days apart, and each time run it +several times in a row (or several times in a day). + Also try modifying the code so that it will show another Moon phase based on input or else just by the code itself. Bonus points if you can make it show all~ @@ -47,6 +50,9 @@ make alt ./natori.alt ``` +Try running this on different days, say a few days apart, and each time run it +several times in a row (or several times in a day). + What happens if you run it in the northern hemisphere? Are there any differences? @@ -54,6 +60,15 @@ Can you identify any Moon phases that result in the same output of both versions? Or are there any? +### Alternate try: + +```sh +./try.alt.sh +``` + +Like with [try.sh](try.sh), try using this multiple times. + + ## Judges' remarks: Here is a nice compact program that changes with the phase of the Moon. diff --git a/2000/natori/try.alt.sh b/2000/natori/try.alt.sh new file mode 100755 index 000000000..f5590e189 --- /dev/null +++ b/2000/natori/try.alt.sh @@ -0,0 +1,162 @@ +#!/usr/bin/env bash +# +# try.alt.sh - demonstrate IOCCC winner 2000/natori 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 + +NATORI="natori" +moon() +{ + read -r -n 1 -p "Press any key to randomly show the northern/southern hemisphere Moon: " + echo 1>&2 + for ((i=0;i<=10;i++)); do + RAND=$((RANDOM % 1000)) + if [[ "$RAND" -le 500 ]]; then + ./"$NATORI".alt + echo 1>&2 + else + ./"$NATORI" + echo 1>&2 + fi + done + + echo 1>&2 + RAND=$((RANDOM % 1000)) + if [[ "$RAND" -gt 500 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + fi + + echo 1>&2 + echo "We will now reverse the order." 1>&2 + echo 1>&2 + + if [[ "$RAND" -le 499 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + ./"$NATORI" + ./"$NATORI".alt + fi + + echo 1>&2 + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We recommend that you try holding space down." 1>&2 + echo 1>&2 + RAND=$((RANDOM % 1000)) + if [[ "$RAND" -gt 500 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ + ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ + ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF + fi + + echo 1>&2 + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We now recommend that you try holding enter down." 1>&2 + echo 1>&2 + if [[ "$RAND" -gt 500 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ + ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ + ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF + fi + echo 1>&2 + + echo "We will now reverse the order." 1>&2 + echo 1>&2 + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We recommend that you try holding space down." 1>&2 + echo 1>&2 + if [[ "$RAND" -le 499 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ + ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ + ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF + fi + + echo 1>&2 + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We now recommend that you try holding enter down." 1>&2 + echo 1>&2 + if [[ "$RAND" -le 499 ]]; then + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ + ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF + else + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ + ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF + fi + echo 1>&2 + + # Finally, for the try.alt.sh (alt code, southern hemisphere), force + # starting with southern hemisphere. + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We now recommend that you try holding enter down." 1>&2 + read -r -n 1 -p "Press any key to alternate between the southern/northern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI.alt"; ./"$NATORI" ; ./"$NATORI.alt" ; ./"$NATORI"; \ + ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF + + echo 1>&2 + +} + +# show the Moon phase in artistic ways! +moon diff --git a/2000/natori/try.sh b/2000/natori/try.sh index e3536cc23..e5b58237c 100755 --- a/2000/natori/try.sh +++ b/2000/natori/try.sh @@ -144,6 +144,17 @@ moon() ./"$NATORI.alt"; ./"$NATORI" ) | less -rEXF fi echo 1>&2 + + # Finally, for the try.sh (original entry, northern hemisphere), force + # starting with northern hemisphere. + echo "Will now use less(1): 'q' = quit, space = next page, enter = next line." 1>&2 + echo "We now recommend that you try holding enter down." 1>&2 + read -r -n 1 -p "Press any key to alternate between the northern/southern hemisphere Moon: " + echo 1>&2 + ( ./"$NATORI"; ./"$NATORI.alt" ; ./"$NATORI" ; ./"$NATORI.alt"; \ + ./"$NATORI"; ./"$NATORI.alt" ) | less -rEXF + + echo 1>&2 } # show the Moon phase in artistic ways! diff --git a/2004/arachnid/README.md b/2004/arachnid/README.md index d38a3ff2e..0696fefed 100644 --- a/2004/arachnid/README.md +++ b/2004/arachnid/README.md @@ -19,7 +19,7 @@ code](#alternate-code) below. ## Try: ```sh -./arachnid arachnid.info +./arachnid arachnid.txt ``` and then try: diff --git a/2004/gavare/README.md b/2004/gavare/README.md index 022e9bf89..9bd4a2f16 100644 --- a/2004/gavare/README.md +++ b/2004/gavare/README.md @@ -10,21 +10,34 @@ for more details. ## To use: -```sh -./gavare -``` - - -## Try: - ```sh ./gavare > ioccc_ray.ppm ``` +Open `ioccc_ray.ppm` with a viewer capable of viewing PPM files. Alternatively, +if you have ImageMagick installed, you can convert it to a jpeg: + +```sh +convert ioccc_ray.ppm ioccc_ray.jpg +``` + +and then view `ioccc_ray.jpg` in a graphics viewer, editor or web browser. + + +### Try: + +If you have `xv(1)` you can do: + +```sh +./gavare | xv - +``` + +to not worry about writing it to a file and just viewing the image it creates. + ## Alternate code: -The alt code, [gavare.alt.c](gavare.alt.c), allows you to change the size of the +The alt code [gavare.alt.c](gavare.alt.c) allows you to change the size of the image as well as the anti-alias setting, when compiling. The author also provided [on their web page for the @@ -32,7 +45,7 @@ entry](https://gavare.se/ioccc/ioccc_gavare.c.html) an unobfuscated version that was used during development, which we have included in the file [gavare.r3.c](gavare.r3.c). -Finally, there's a version, [gavare.alt2.c](gavare.alt2.c) that sets binary mode +Finally, the file [gavare.alt2.c](gavare.alt2.c) sets binary mode on `stdout` which theoretically should work in Windows. @@ -56,6 +69,9 @@ You might also wish to change the anti-alias setting: make clobber AA=2 alt ``` +You may of course combine the above two commands and give any combination you +wish. + This is not possible with the author's version but it is with the alt versions (Windows - see below - and otherwise). @@ -97,7 +113,7 @@ entry contains no reserved words (I don't count `main` as a reserved word, although the compiler gives it special meaning) and no preprocessor directives. -The program is a small +This program is a small [ray-tracer](https://en.wikipedia.org/wiki/Ray_tracing_(graphics)). The first line of the source code may be modified if you want the resulting image to be of some other resolution than the predefined. The `A` value is an anti-alias diff --git a/2004/hibachi/README.md b/2004/hibachi/README.md index 3653889a6..ef534561c 100644 --- a/2004/hibachi/README.md +++ b/2004/hibachi/README.md @@ -11,18 +11,11 @@ make cd build; ./hibachi-start.sh & ``` - -## Try: - -```sh -cd build; ./hibachi-start.sh & -``` - Then use your web browser to visit `http://localhost:8008/`. When you're finished make sure to kill `hibachi`. -NOTE: you must be in the `build` directory when running `hibachi` for this to -work. +NOTE: you must be in the `build` directory when running `hibachi-start.sh` for +this to work right. ## Judges' remarks: @@ -45,9 +38,9 @@ so the file does not exist here. `Hibachi` is a simple, small, and (probably) very secure web server. -There is a `hibachi.tgz` file that unpacks several support -files and a subdirectory tree containing the documentation and -examples. It can be viewed by: +There is a `hibachi.tgz` file (NOTE: this file was removed by the judges after +extraction) that unpacks several support files and a subdirectory tree +containing the documentation and examples. It can be viewed by: ```sh tar -zxf hibachi.tgz diff --git a/2004/hibachi/src/localhost/index.html b/2004/hibachi/src/localhost/index.html index 87113b225..d2d6a724e 100644 --- a/2004/hibachi/src/localhost/index.html +++ b/2004/hibachi/src/localhost/index.html @@ -49,7 +49,7 @@ Snert . Com - Software - Hibachi they're completely portable.
- - + epicurious.com food dictionary
@@ -60,20 +60,20 @@ Snert . Com - Software - HibachiHIBACHI is a simple, small, and secure web server with virtual host and CGI support. It is a limited implementation of RFC 2616 -and the CGI/1.1 Specification. +and the CGI/1.1 Specification. HIBACHI was written as an entry for the International Obfuscated C Code Contest and works -for any Unix variant including the Cygwin +for any Unix variant including the Cygwin environment for Windows.
HIBACHI supports dynamic web content through the use of the -Common Gateway Interface (CGI) specification. +Common Gateway Interface (CGI) specification. Just about any scripting or programming language can be used, such as a POSIX shell, -Perl, -PHP, -Python, and/or -Ruby. +Perl, +PHP, +Python, and/or +Ruby. Existing CGI scripts can be used with little or no modification. Hibachi executes all CGI scripts as though they were "nph" prefixed, which is to say that it is the script's responsibility to send the HTTP status line and necessary headers direct to the client. @@ -97,9 +97,10 @@ document tree is rooted at /usr/local/share/hibachi, then:
HIBACHI is ideal for special floppy-Linux distributions, like -Leka, which can be used for rescue, firewall, +Leka, which can be used for rescue, firewall, demo, or dedicated servers. In theory, with some modifications, -HIBACHI and a script interpreter, like PHP, could also be +HIBACHI and a script interpreter, like PHP, could also be bundled with CDROMS that require a means of presenting dynamic web pages.
@@ -109,22 +110,26 @@ bundled with CDROMS that require a means of presenting dynamic web pages.@@ -241,21 +246,21 @@ These CGI scripts perform some basic tests on the handling of GET and POST reque cookies, and the passing of environment variables to CGI scripts. These CGI scripts assume that /bin/sh is a POSIX compliant shell and the standard set of POSIX utilities are available. Should work for all Unix variants -and Cygwin. +and Cygwin.-http://64.81.251.233:8008/ +https://185.199.111.153 https://www.ioccc.org:8008/
|
- |
@@ -340,7 +345,7 @@ when Ruby is installed. | |
|
- |
5.8 @@ -348,12 +353,13 @@ when Ruby is installed. | |
|
- |
Windows 2000 SP4, Windows XP Pro SP1
- with Cygwin, gcc 2.95.3-5 + with Cygwin, gcc 2.95.3-5 |