diff --git a/1984/anonymous/README.md b/1984/anonymous/README.md
index bd17bfca2..d90dbe252 100644
--- a/1984/anonymous/README.md
+++ b/1984/anonymous/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./anonymous
```
@@ -22,7 +22,7 @@ as the alternate code. See below for the tattoo side-by-side with the code.
### Alternate build:
-```sh
+```
make alt
```
@@ -31,7 +31,7 @@ as the alternate code. See below for the tattoo side-by-side with the code.
NOTE: this version might not work on some systems like macOS.
-```sh
+```
./anonymous.alt
```
diff --git a/1984/anonymous/index.html b/1984/anonymous/index.html
index 1f28b0380..7aaf83028 100644
--- a/1984/anonymous/index.html
+++ b/1984/anonymous/index.html
@@ -141,19 +141,19 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./anonymous
+
./anonymous
Alternate code:
The original version of this entry was added, by request,
in order to show the code that was turned into the
tattoo,
as the alternate code. See below for the tattoo side-by-side with the code.
Alternate build:
-
make alt
+
make alt
Alternate use:
NOTE: this version might not work on some systems like macOS.
-
./anonymous.alt
+
./anonymous.alt
Judges’ remarks:
The author was too embarrassed that they could write such trash, so I
promised to protect their identity. I will say that the author of this
diff --git a/1984/decot/README.md b/1984/decot/README.md
index c1f1fdab9..37a9af299 100644
--- a/1984/decot/README.md
+++ b/1984/decot/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -22,7 +22,7 @@ For more detailed information see [1984 decot bugs](../../bugs.html#1984_decot).
## To use:
-```sh
+```
./decot
```
@@ -36,14 +36,14 @@ can use this version.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./decot.alt
```
@@ -61,13 +61,13 @@ the judges offer this one comment: understand remarks!
Some new (in 1984) compilers disliked line 15 of the original source, so we
changed it from:
-```c
+```
for(signal=0;*k * x * __FILE__ *i;) do {
```
to:
-```c
+```
for(signal=0;*k *x * __FILE__ *i;) do {
```
@@ -75,7 +75,7 @@ To see what we mean look at the [original source file](decot.orig.c). The
[alternate code](decot.alt.c) is the version that has this modification. The
fixed version has instead:
-```c
+```
for(signal=0;*k *= * __FILE__ *i;) do {
```
diff --git a/1984/decot/index.html b/1984/decot/index.html
index 5e3ae6c0b..728e9bc8a 100644
--- a/1984/decot/index.html
+++ b/1984/decot/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make all
+
make all
NOTE: there is an alternate version which will only work if
you have an old enough compiler or a compiler that supports -traditional-cpp.
The original code was fixed in 2023 to not require this.
@@ -150,15 +150,15 @@ The original code was fixed in 2023 to not require this.
This alternate code, the original, requires a compiler that supports
-traditional-cpp or an old enough compiler. If you have such a compiler you
can use this version.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./decot.alt
+
./decot.alt
Judges’ remarks:
This program prints out what looks like a fragment of C code.
Is this a bug or is this a feature? To help choose
@@ -166,13 +166,13 @@ the judges offer this one comment: understand remarks!
Historical remarks:
Some new (in 1984) compilers disliked line 15 of the original source, so we
changed it from:
-
for(signal=0;*k * x * __FILE__ *i;)do{
+
for(signal=0;*k * x * __FILE__ *i;) do {
to:
-
for(signal=0;*k *x * __FILE__ *i;)do{
+
for(signal=0;*k *x * __FILE__ *i;) do {
To see what we mean look at the original source file. The
alternate code is the version that has this modification. The
fixed version has instead:
-
for(signal=0;*k *=* __FILE__ *i;)do{
+
for(signal=0;*k *= * __FILE__ *i;) do {
Author’s remarks:
No remarks were provided by the author.
make all
```
## To use:
-```sh
+```
./laman
```
@@ -17,7 +17,7 @@
The program accepts ONE POSITIVE number. Seeing is believing, so try things
like:
-```sh
+```
./try.sh
./laman 4
@@ -33,14 +33,14 @@ This code should run you in circles.
Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed
them from:
-```c
+```
;++f)a[ b<<5|c] =d++,b+ =e;for( f=0;f
;++f)a[ b<<5|c] =d++,b+= e;for( f=0;fZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./laman<positive number>
+
./laman <positive number>
Try:
The program accepts ONE POSITIVE number. Seeing is believing, so try things
like:
-
./try.sh
-
-./laman 4
-./laman 9
-./laman 16
+
./try.sh
+
+ ./laman 4
+ ./laman 9
+ ./laman 16
This code should run you in circles.
Judges’ remarks:
Some new compilers (in 1984) dislike lines 6 and 10 of the source, so we changed
them from:
diff --git a/1984/mullender/README.md b/1984/mullender/README.md
index 577e0f7d2..cc8a359a9 100644
--- a/1984/mullender/README.md
+++ b/1984/mullender/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -24,7 +24,7 @@ For more detailed information see [1984 mullender bugs](../../bugs.html#1984_mul
## To use:
-```sh
+```
./mullender.alt [microseconds]
```
@@ -48,7 +48,7 @@ which is probably not as uncommon as you think :-).
## Try:
-```sh
+```
./mullender.alt
./mullender.alt 5000 # wait for 5000 microseconds and see what happens
@@ -72,14 +72,14 @@ machine dependent code was discouraged.
### Original build:
-```sh
+```
make all
```
### Original use:
-```sh
+```
./mullender
```
@@ -137,19 +137,19 @@ Repo](https://github.com/dspinellis/unix-history-repo/tree/Research-Release).
`gentab.c` can be built like:
-```sh
+```
make gentab
```
### gentab use:
-```sh
+```
./gentab file
```
### gentab try:
-```sh
+```
./gentab gentab > g.c
```
@@ -256,7 +256,7 @@ separate.
The [PDP](https://en.wikipedia.org/wiki/Programmed_Data_Processor) and
[VAX](https://en.wikipedia.org/wiki/VAX) codes implement the same algorithm:
-```c
+```
for (;;) {
write(1, " :-)\b\b\b\b", 9);
delay();
@@ -284,7 +284,7 @@ We started with writing the
We both knew [PDP-11](https://en.wikipedia.org/wiki/PDP-11) assembly so that was
no problem. The assembly code we came up with is as follows:
-```asm
+```
pdp:
mov pc,r4
tst -(r4)
@@ -331,7 +331,7 @@ VAX code in C and massaged the
program that we came up with is as follows:
-```asm
+```
vax: .word 0400 + (pdp - vax) / 2 - 1
1:
pushl $9
@@ -389,7 +389,7 @@ extracted the machine code from the object file.
> NOTE from judges: see [gentab.c](gentab.c) for a copy of this file that can be
compiled in modern systems.
-```c
+```
#include
#include
diff --git a/1984/mullender/index.html b/1984/mullender/index.html
index d3f526552..ee62ac1b4 100644
--- a/1984/mullender/index.html
+++ b/1984/mullender/index.html
@@ -144,7 +144,7 @@ Location: NL - Kingdom of the Netherlan
To build:
-
make alt
+
make alt
NOTE: the original code will not work on any system other than
VAX-11 and
PDP-11 and this is why we encourage you
@@ -155,7 +155,7 @@ the original version.
The default microseconds is 190000 as this is approximately how long it slept in
the original entry but it can be no lower than 5000 as any lower doesn’t work
@@ -169,13 +169,13 @@ overflow!
BTW: is there such a thing as too fast a CPU ? :-) Actually yes for certain code
which is probably not as uncommon as you think :-).
Try:
-
./mullender.alt
-
-./mullender.alt 5000 # wait for 5000 microseconds and see what happens
-
-./mullender.alt 20000 # wait for 20000 microseconds and see what happens
-
-./mullender.alt 100000 # wait for 100000 microseconds and see what happens
+
./mullender.alt
+
+ ./mullender.alt 5000 # wait for 5000 microseconds and see what happens
+
+ ./mullender.alt 20000 # wait for 20000 microseconds and see what happens
+
+ ./mullender.alt 100000 # wait for 100000 microseconds and see what happens
What happens if you hit enter after it reaches the end of the line? Why? What
happens after some time of waiting?
Original code:
@@ -184,9 +184,9 @@ happens after some time of waiting?
PDP-11. In the following years, 1985 on,
machine dependent code was discouraged.
Original build:
-
make all
+
make all
Original use:
-
./mullender
+
./mullender
Judges’ remarks:
Without question, this C program is the one of the most obfuscated C program
that has ever been received! Like all great contest entries, it resulted in a
@@ -225,11 +225,11 @@ in the fabulousgentab build:
This is not the code we originally wrote, but it is the code that we ultimately
used in the program. The string to be printed is shared by the
VAX and the
@@ -373,26 +373,26 @@ VAX assembly, we w
VAX code in C and massaged the
compiler output. The VAX assembly
program that we came up with is as follows:
As can be seen, there is a slight preference for decimal, and also a character
format is sometimes used, but only if the data is a printable ASCII character.
When we ran this program, we were almost completely satisfied with the result.
diff --git a/1985/applin/README.md b/1985/applin/README.md
index f6a386a10..9355efb8b 100644
--- a/1985/applin/README.md
+++ b/1985/applin/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./applin
```
diff --git a/1985/applin/index.html b/1985/applin/index.html
index ccc775f21..ec3aec2f6 100644
--- a/1985/applin/index.html
+++ b/1985/applin/index.html
@@ -144,9 +144,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
Try:
-
./applin
+
./applin
Judges’ remarks:
One liner programs are short but twisted. This “Hello, world!” version
certainly takes its time saying hello.
diff --git a/1985/august/README.md b/1985/august/README.md
index 5850c3904..1750590b3 100644
--- a/1985/august/README.md
+++ b/1985/august/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./august
```
## Try:
-```sh
+```
./try.sh
```
@@ -22,7 +22,7 @@ If you have the `primes(6)` tool (sometimes part of [BSD
Games](https://github.com/vattam/BSDGames)) you can see
what of the output in the first `N` (say `15` or `25`) lines are primes:
-```sh
+```
./primes.sh # 15
./primes.sh 25
```
diff --git a/1985/august/index.html b/1985/august/index.html
index d6559bff4..bb39411fd 100644
--- a/1985/august/index.html
+++ b/1985/august/index.html
@@ -141,16 +141,16 @@ Location: SE - Kingdom of Sweden (
To build:
-
make all
+
make all
To use:
-
./august
+
./august
Try:
-
./try.sh
+
./try.sh
If you have the primes(6) tool (sometimes part of BSD
Games) you can see
what of the output in the first N (say 15 or 25) lines are primes:
-
./primes.sh# 15
-./primes.sh 25
+
./primes.sh # 15
+ ./primes.sh 25
Note that try.sh will run this script anyway, telling you where to get
primes(6) if you don’t have it installed, but it will only run with the
default value of 15, rather than trying several different values.
diff --git a/1985/lycklama/README.md b/1985/lycklama/README.md
index c723ed3b7..594552f67 100644
--- a/1985/lycklama/README.md
+++ b/1985/lycklama/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make alt
```
## To use:
-```sh
+```
./lycklama.alt < some_file
```
@@ -24,13 +24,13 @@ call with a configurable time to sleep. The default is 500 microseconds but you
reconfigure it like:
-```sh
+```
make SLEEP=700 clobber alt
```
which would set it at 700. Then, whether you use the default value or not, try:
-```sh
+```
./try.alt.sh
```
@@ -45,21 +45,21 @@ modern systems.
### Original build:
-```sh
+```
make all
```
### Original use:
-```sh
+```
./lycklama < some_file
```
### Original try:
-```sh
+```
./lycklama < lycklama.c
./lycklama < lycklama.alt.c
./lycklama < lycklama.orig.c
diff --git a/1985/lycklama/index.html b/1985/lycklama/index.html
index 1d47354be..9d0d9b42a 100644
--- a/1985/lycklama/index.html
+++ b/1985/lycklama/index.html
@@ -141,9 +141,9 @@ Location: ZZ - Unknown location
To build:
-
make alt
+
make alt
To use:
-
./lycklama.alt< some_file
+
./lycklama.alt < some_file
To see why we recommend the alternate version instead of the original version,
see below and the Original code section.
Try:
@@ -152,23 +152,23 @@ original, slows down the output so that you can see what it looked like back in
This will be more enjoyable. It is slowed down by the usleep(3) library
call with a configurable time to sleep. The default is 500 microseconds but you can
reconfigure it like:
-
make SLEEP=700 clobber alt
+
make SLEEP=700 clobber alt
which would set it at 700. Then, whether you use the default value or not, try:
-
./try.alt.sh
+
./try.alt.sh
Original code:
As explained above, because modern systems run this entry way too fast to fully
appreciate what it does, we encourage you to first try the alternate version.
After this, however, you might wish to try the original version, fixed for
modern systems.
Run the program, redirecting a file into it, and notice how it redisplays it.
The program itself looks like tty noise.
diff --git a/1985/shapiro/README.md b/1985/shapiro/README.md
index 9f4ae46f0..a61165a9d 100644
--- a/1985/shapiro/README.md
+++ b/1985/shapiro/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,7 +10,7 @@ There is alternate code which allows one to change the size of the maze. See
### To run:
-```sh
+```
./shapiro
```
@@ -23,7 +23,7 @@ of the maze. The alt code allows one to easily do this.
### Alternate build:
-```sh
+```
make alt
```
@@ -32,7 +32,7 @@ of the maze. The alt code allows one to easily do this.
If you wish to change the value you can do it like:
-```sh
+```
make clobber SIZE=5 alt
```
@@ -41,7 +41,7 @@ error. If it's <= 0 || >= 5000 then it is set to 39, the default.
You might also wish to try:
-```sh
+```
./try.alt.sh
```
diff --git a/1985/shapiro/index.html b/1985/shapiro/index.html
index 363da534a..479884b71 100644
--- a/1985/shapiro/index.html
+++ b/1985/shapiro/index.html
@@ -141,23 +141,23 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is alternate code which allows one to change the size of the maze. See
Alternate code below.
To run:
-
./shapiro
+
./shapiro
Alternate code:
The code has a define C set to 39 but this can be modified to change the size
of the maze. The alt code allows one to easily do this.
Alternate build:
-
make alt
+
make alt
Alternate try:
If you wish to change the value you can do it like:
-
make clobber SIZE=5 alt
+
make clobber SIZE=5 alt
Note that if it is not a number then obviously there will be a compilation
error. If it’s <= 0 || >= 5000 then it is set to 39, the default.
You might also wish to try:
-
./try.alt.sh
+
./try.alt.sh
This script will compile the program five times with a random value and then
prompt you in an infinite loop for values to try, exiting only if non-digits are
in the input.
diff --git a/1985/sicherman/README.md b/1985/sicherman/README.md
index 13032d87f..31c45cf22 100644
--- a/1985/sicherman/README.md
+++ b/1985/sicherman/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@ more details on it.
## To use:
-```sh
+```
./sicherman < file
echo foo | ./sicherman
@@ -23,7 +23,7 @@ more details on it.
## Try:
-```sh
+```
./try.sh
```
@@ -43,7 +43,7 @@ audience.
Although this will be built if the original fails to compile you can do it
manually like:
-```sh
+```
make alt
```
@@ -52,14 +52,14 @@ In this case it will be built as `sicherman.alt`.
### Alternate use:
-```sh
+```
./sicherman.alt < file
```
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -80,7 +80,7 @@ on a line. Now enter the letters 'n' through 'z'. But to borrow a quote
from Richard Stallman: If you think you understand what this code
does, then you don't, so read it again! Explain why:
-```sh
+```
./sicherman < sicherman.c | ./sicherman | diff - ./sicherman.c
```
diff --git a/1985/sicherman/index.html b/1985/sicherman/index.html
index 75abc49b7..f981ecb2f 100644
--- a/1985/sicherman/index.html
+++ b/1985/sicherman/index.html
@@ -141,19 +141,19 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is another version that will be compiled in case the first fails. This
should happen automatically. See Alternate code below for
more details on it.
To use:
-
./sicherman< file
-
-echo foo |./sicherman
-
-./sicherman
-# type or paste some text, making sure to hit enter after each line typed
+
./sicherman < file
+
+ echo foo | ./sicherman
+
+ ./sicherman
+ # type or paste some text, making sure to hit enter after each line typed
Try:
-
./try.sh
+
./try.sh
Alternate code:
The sicherman.alt.c is a slight change in the fixed version
(fixed so it does not require -traditional-cpp) in that it has two args to
@@ -164,12 +164,12 @@ audience.
Alternate build:
Although this will be built if the original fails to compile you can do it
manually like:
-
make alt
+
make alt
In this case it will be built as sicherman.alt.
Alternate use:
-
./sicherman.alt< file
+
./sicherman.alt < file
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
This program abuses the C preprocessor so much that some cpps fail to strip
out all of the comments on the first pass! If you were able to understand
@@ -182,7 +182,7 @@ Like the program says, what’s that mean?
on a line. Now enter the letters ‘n’ through ‘z’. But to borrow a quote
from Richard Stallman: If you think you understand what this code
does, then you don’t, so read it again! Explain why:
-
results in diff reporting a difference on some machines.
Author’s remarks:
No remarks were provided by the author.
diff --git a/1986/applin/README.md b/1986/applin/README.md
index a313cf685..95c15bf30 100644
--- a/1986/applin/README.md
+++ b/1986/applin/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./applin
```
## Try:
-```sh
+```
./applin.c
```
diff --git a/1986/applin/index.html b/1986/applin/index.html
index 672d6ff64..c559b9adf 100644
--- a/1986/applin/index.html
+++ b/1986/applin/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./applin
+
./applin
Try:
-
./applin.c
+
./applin.c
Judges’ remarks:
The judges were so amused by this little program that we created an
award just for it. This program is portable to the C and Fortran 77
diff --git a/1986/august/README.md b/1986/august/README.md
index 83986a7f8..61fd004ca 100644
--- a/1986/august/README.md
+++ b/1986/august/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1986 august bugs](../../bugs.html#1986_august
## Try:
-```sh
+```
./august
```
diff --git a/1986/august/index.html b/1986/august/index.html
index 25549b3cc..b4793041d 100644
--- a/1986/august/index.html
+++ b/1986/august/index.html
@@ -141,13 +141,13 @@ Location: SE - Kingdom of Sweden (
This program computes a specific mathematical value. Simply compile
and give it an infinite amount of stack space and CPU time. Otherwise
diff --git a/1986/bright/README.md b/1986/bright/README.md
index af7816df7..210e99a2f 100644
--- a/1986/bright/README.md
+++ b/1986/bright/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./bright some_file
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1986/bright/index.html b/1986/bright/index.html
index 10a439b11..d6b75c24d 100644
--- a/1986/bright/index.html
+++ b/1986/bright/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./bright some_file
+
./bright some_file
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Compile this program and give a filename as an argument.
Mr. Bright exploits the C pre-processor, similar variables and
diff --git a/1986/hague/README.md b/1986/hague/README.md
index 87f8ce071..f900d03b6 100644
--- a/1986/hague/README.md
+++ b/1986/hague/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./hague 2>/dev/null
# enter some text
```
@@ -15,7 +15,7 @@
## Try:
-```sh
+```
./try.sh
```
diff --git a/1986/hague/index.html b/1986/hague/index.html
index 2a66c5d6a..476ef0bef 100644
--- a/1986/hague/index.html
+++ b/1986/hague/index.html
@@ -141,12 +141,12 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
To use:
-
./hague2>/dev/null
-# enter some text
+
./hague 2>/dev/null
+ # enter some text
Try:
-
./try.sh
+
./try.sh
Note that you can run the program without feeding it anything and then type in a
message and line by line it will show the right output. Notice also how certain
characters will print a ?.
diff --git a/1986/holloway/README.md b/1986/holloway/README.md
index 81368e750..5b6da9421 100644
--- a/1986/holloway/README.md
+++ b/1986/holloway/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./holloway
```
diff --git a/1986/holloway/index.html b/1986/holloway/index.html
index 87dee4a32..4ceca4564 100644
--- a/1986/holloway/index.html
+++ b/1986/holloway/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
Try:
-
./holloway
+
./holloway
Judges’ remarks:
Believe it or not, this is the old standard “Hello, world” program
performed in a very complex way. The judges and the author defy you
diff --git a/1986/marshall/README.md b/1986/marshall/README.md
index f991cc8c7..2f84c5feb 100644
--- a/1986/marshall/README.md
+++ b/1986/marshall/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ if nothing else.
## To use:
-```sh
+```
./marshall
```
@@ -36,14 +36,14 @@ instead offer the problematic code as an alternate version whereas
To see if your compiler has the problems noted:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./marshall.alt
```
diff --git a/1986/marshall/compilers.html b/1986/marshall/compilers.html
index 4c735585b..5a6aa4fb4 100644
--- a/1986/marshall/compilers.html
+++ b/1986/marshall/compilers.html
@@ -162,7 +162,7 @@ because of the call to _exit() (see below).
enable the optimiser clang will generate code that prints the string twice and
dumps core just like before! What about the call to _exit()?
The call was:
-
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);
+
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);
Changing it to not refer to these variables and just exit 1 and the problems
disappear!
macOS
@@ -172,9 +172,9 @@ it works fine but if it’s disabled it prints out the string and then enters an
infinite loop!
After we fix the infinite loop if we change the _exit() call in macOS and
disable the optimiser we might get something like:
-
$ ./marshall
-choo choo
-Segmentation fault: 11
+
$ ./marshall
+ choo choo
+ Segmentation fault: 11
Observe how it doesn’t print it twice. But of course it segfaults so it’s not
right either.
If the optimiser is enabled, however, we will see that it works fine before the
diff --git a/1986/marshall/compilers.md b/1986/marshall/compilers.md
index 91948df78..a732d52fe 100644
--- a/1986/marshall/compilers.md
+++ b/1986/marshall/compilers.md
@@ -54,7 +54,7 @@ dumps core just like before! What about the call to `_exit()`?
The call was:
-```c
+```
_exit(argv[(int)*argc-2/cc[1*(int)*argc]|-1<<4]);
```
@@ -72,7 +72,7 @@ infinite loop!
After we fix the infinite loop if we change the `_exit()` call in macOS and
disable the optimiser we might get something like:
-```sh
+```
$ ./marshall
choo choo
Segmentation fault: 11
diff --git a/1986/marshall/index.html b/1986/marshall/index.html
index 21f264bc0..84d1f2678 100644
--- a/1986/marshall/index.html
+++ b/1986/marshall/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make all
+
make all
NOTE: we FORCE disable the optimiser due to a funny problem with different
compilers and systems. See below and compilers.html for details.
There is an alternate version. The reason is a funny problem:
@@ -152,7 +152,7 @@ might work but the other one would not. We describe this in more detail in
compilers.html and we encourage you to read it for entertainment
if nothing else.
To use:
-
./marshall
+
./marshall
Alternate code:
Due to the different conflicting problems with gcc and clang, we
instead offer the problematic code as an alternate version whereas
@@ -160,9 +160,9 @@ instead offer the problematic code as an alternate version whereas
_exit() commented out, changing the value passed into _exit() to 1.
Alternate build:
To see if your compiler has the problems noted:
-
make alt
+
make alt
Alternate use:
-
./marshall.alt
+
./marshall.alt
Does it work in your system? That is does it not segfault, does it print it only
once and does it not enter an infinite loop? Or more generally does it print the
text exactly once and then exit?
diff --git a/1986/pawka/README.md b/1986/pawka/README.md
index 57239169c..a3caf8c20 100644
--- a/1986/pawka/README.md
+++ b/1986/pawka/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./pawka
```
diff --git a/1986/pawka/index.html b/1986/pawka/index.html
index 691347053..023814ba2 100644
--- a/1986/pawka/index.html
+++ b/1986/pawka/index.html
@@ -141,9 +141,9 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
Try:
-
./pawka
+
./pawka
Judges’ remarks:
The judges found this entry to be one of hardest to read without the
aid of /lib/cpp and a good editor. When run, the program asks if it
diff --git a/1986/stein/README.md b/1986/stein/README.md
index f0dc9deda..73121e459 100644
--- a/1986/stein/README.md
+++ b/1986/stein/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./stein $(printf "\015\015"); echo
```
@@ -24,7 +24,7 @@ The `\015` in the above `printf(1)` command produces a control-N.
One some machines, a control-M control-N arg is needed
to get the command to output cleanly:
-```sh
+```
./stein $(printf "\014\015"); echo
```
diff --git a/1986/stein/index.html b/1986/stein/index.html
index 7bc5b0d4f..3e3a12652 100644
--- a/1986/stein/index.html
+++ b/1986/stein/index.html
@@ -141,9 +141,9 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./stein$(printf"\015\015");echo
+
./stein $(printf "\015\015"); echo
Judges’ remarks:
NOTE: to avoid problems with news and mail, the single line was split
into 3 lines. Join all lines into a single line to recreate
@@ -151,7 +151,7 @@ the original file.
The \015 in the above printf(1) command produces a control-N.
One some machines, a control-M control-N arg is needed
to get the command to output cleanly:
-
./stein$(printf"\014\015");echo
+
./stein $(printf "\014\015"); echo
Your system may require another set of characters.
In time, you will figure out what it does. :-)
Author’s remarks:
diff --git a/1986/wall/README.md b/1986/wall/README.md
index e0f36c4fc..6db56f878 100644
--- a/1986/wall/README.md
+++ b/1986/wall/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./wall
```
diff --git a/1986/wall/index.html b/1986/wall/index.html
index b9ad8de4c..8ac1e6661 100644
--- a/1986/wall/index.html
+++ b/1986/wall/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./wall
+
./wall
Judges’ remarks:
The original version did not have a ‘;’ character in the first line.
This caused a number of System V C pre-preprocessors to gripe about a
diff --git a/1987/biggar/README.md b/1987/biggar/README.md
index 9d2f5c92c..4430ea795 100644
--- a/1987/biggar/README.md
+++ b/1987/biggar/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
some_command | ./biggar | od -c
./biggar < file | od -c
@@ -16,7 +16,7 @@
## Try:
-```sh
+```
./try.sh
```
diff --git a/1987/biggar/index.html b/1987/biggar/index.html
index 6dd42a983..275476c63 100644
--- a/1987/biggar/index.html
+++ b/1987/biggar/index.html
@@ -141,13 +141,13 @@ Location: ZZ - Unknown location
some_command | ./biggar | od -c
+
+ ./biggar < file | od -c
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
By changing the compile line you can make this program do anything you
want. This is a very efficient way to transfer source, though it
diff --git a/1987/heckbert/README.md b/1987/heckbert/README.md
index 68c95d321..ae61cea5a 100644
--- a/1987/heckbert/README.md
+++ b/1987/heckbert/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,7 +10,7 @@ To compile on a 16 bit machine, change 300000 to 30000.
## To use:
-```sh
+```
./heckbert col < file
```
@@ -19,7 +19,7 @@ where col is the number of columns to fold at and file is the file to fold.
## Try:
-```sh
+```
./try.sh
```
@@ -28,7 +28,7 @@ where col is the number of columns to fold at and file is the file to fold.
Folding at the wrong length may be equivalent to a "Spindle or Mutilate" operation. For example:
-```sh
+```
./heckbert 40 < heckbert.c > ph.c ; make ph ; ./ph 20 < heckbert.c > bar.c ; make bar
```
diff --git a/1987/heckbert/index.html b/1987/heckbert/index.html
index ee086d6ac..1a0308b9b 100644
--- a/1987/heckbert/index.html
+++ b/1987/heckbert/index.html
@@ -141,17 +141,17 @@ Location: US - United States of America
To build:
-
make all
+
make all
On System V systems, we had to compile with -Dindex=strchr.
To compile on a 16 bit machine, change 300000 to 30000.
To use:
-
./heckbert col < file
+
./heckbert col < file
where col is the number of columns to fold at and file is the file to fold.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Folding at the wrong length may be equivalent to a “Spindle or Mutilate” operation. For example:
diff --git a/1987/hines/README.md b/1987/hines/README.md
index 7276dc644..59e84f8dd 100644
--- a/1987/hines/README.md
+++ b/1987/hines/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./hines file.c
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1987/hines/index.html b/1987/hines/index.html
index 010c675e9..911d4dc53 100644
--- a/1987/hines/index.html
+++ b/1987/hines/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./hines file.c
+
./hines file.c
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This program was designed to maximize the bother function for
structured programmers. This program takes goto statements to their
diff --git a/1987/korn/README.md b/1987/korn/README.md
index ce7e30bfa..80d27d030 100644
--- a/1987/korn/README.md
+++ b/1987/korn/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./korn
```
@@ -29,14 +29,14 @@ Several points are important to understand this program:
2. What is the value of the symbol `"have"`? (hint: the value is NOT 4
characters, or `'h'`, or a string) Consider the fact that:
-```c
+```
char *x;
```
defines a pointer to a `char` (i.e. an address), and that the `=` assigns
things of compatible types. Since:
-```c
+```
x = "have";
```
@@ -44,13 +44,13 @@ is legal C, what type of value is `"have"`?
3. Note that the following expressions yield the same value:
-```c
+```
x[3] *(x+3) *(3+x)
```
since addition is commutative. What can be said about this value?
-```c
+```
3[x]
```
diff --git a/1987/korn/index.html b/1987/korn/index.html
index c1d9098cb..8ea8bd061 100644
--- a/1987/korn/index.html
+++ b/1987/korn/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./korn
+
./korn
Judges’ remarks:
The Judges believe that this is the best one line entry ever received.
Compile on a UNIX system, or at least one using a C implementation that
@@ -158,17 +158,17 @@ section right now and see if you are one of the few people who can.
What is the value of the symbol "have"? (hint: the value is NOT 4
characters, or 'h', or a string) Consider the fact that:
-
char*x;
+
char *x;
defines a pointer to a char (i.e. an address), and that the = assigns
things of compatible types. Since:
-
x ="have";
+
x = "have";
is legal C, what type of value is "have"?
Note that the following expressions yield the same value:
-
x[3]*(x+3)*(3+x)
+
x[3] *(x+3) *(3+x)
since addition is commutative. What can be said about this value?
-
3[x]
+
3[x]
David
Korn’s
/bin/ksh provides us with a greatly
diff --git a/1987/lievaart/README.md b/1987/lievaart/README.md
index 876c8f65c..4ae8714e6 100644
--- a/1987/lievaart/README.md
+++ b/1987/lievaart/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./lievaart
# enter a level and start playing as described below
```
@@ -17,7 +17,7 @@
To see what it would have looked like without the size restrictions:
-```sh
+```
./lievaart2
# enter a level and start playing as described below
```
diff --git a/1987/lievaart/index.html b/1987/lievaart/index.html
index e60b6cab0..359f1fad1 100644
--- a/1987/lievaart/index.html
+++ b/1987/lievaart/index.html
@@ -141,14 +141,14 @@ Location: NL - Kingdom of the Netherlan
To build:
-
make all
+
make all
To use:
-
./lievaart
-# enter a level and start playing as described below
+
./lievaart
+ # enter a level and start playing as described below
Try:
To see what it would have looked like without the size restrictions:
-
./lievaart2
-# enter a level and start playing as described below
+
./lievaart2
+ # enter a level and start playing as described below
Judges’ remarks:
We believe that you too will be amazed at just how much power Mr. Lievaart
packed into 1024 bytes!
diff --git a/1987/wall/README.md b/1987/wall/README.md
index 435c0fbba..df10a656e 100644
--- a/1987/wall/README.md
+++ b/1987/wall/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./wall
# enter some numbers
@@ -18,14 +18,14 @@
## Try:
-```sh
+```
./try.sh
```
You may of course run the commands manually and enter text as you wish. For
instance you might try one or both of:
-```sh
+```
./wall | bc
./wall | cat
diff --git a/1987/wall/index.html b/1987/wall/index.html
index 5d751686e..965c02ca8 100644
--- a/1987/wall/index.html
+++ b/1987/wall/index.html
@@ -141,20 +141,20 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./wall
-# enter some numbers
-
-./wall|some_command
-# enter some strings or numbers, depending on command
+
./wall
+ # enter some numbers
+
+ ./wall | some_command
+ # enter some strings or numbers, depending on command
Try:
-
./try.sh
+
./try.sh
You may of course run the commands manually and enter text as you wish. For
instance you might try one or both of:
-
./wall|bc
-
-./wall|cat
+
./wall | bc
+
+ ./wall | cat
and enter some input like:
x*x
2^x
diff --git a/1987/westley/README.md b/1987/westley/README.md
index ff0635f16..564ce1a22 100644
--- a/1987/westley/README.md
+++ b/1987/westley/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./westley
```
diff --git a/1987/westley/index.html b/1987/westley/index.html
index 518059f0b..71cfb7ed4 100644
--- a/1987/westley/index.html
+++ b/1987/westley/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./westley
+
./westley
Judges’ remarks:
putchar() must exist in the C library and not just as a macro.
If it fails to compile, bug your OS/compiler vendor.
diff --git a/1988/applin/README.md b/1988/applin/README.md
index c70dc626d..b0b04d5a5 100644
--- a/1988/applin/README.md
+++ b/1988/applin/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -12,7 +12,7 @@ program. See the [Alternate code](#alternate-code) section below for details.
## Try:
-```sh
+```
./applin
```
@@ -25,7 +25,7 @@ with this entry.
### Alternate build:
-```sh
+```
make alt
```
diff --git a/1988/applin/index.html b/1988/applin/index.html
index 9d3cb009e..920a7da82 100644
--- a/1988/applin/index.html
+++ b/1988/applin/index.html
@@ -141,18 +141,18 @@ Location: US - United States of America
To build:
-
make all
+
make all
A smaller version, originally called zsmall.c (and still exists as such, as
the source of the alt code), of applin.c, can be found in
applin.alt.c. Your machine may have an easier time with this
program. See the Alternate code section below for details.
Try:
-
./applin
+
./applin
Alternate code:
As noted above a smaller version can be used in case your cpp has a hard time
with this entry.
Alternate build:
-
make alt
+
make alt
Use applin.alt as you would applin above.
History about the smaller version:
Way back in 1988 ..
diff --git a/1988/dale/README.md b/1988/dale/README.md
index 5740e7d27..c543dc8dd 100644
--- a/1988/dale/README.md
+++ b/1988/dale/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,13 +18,13 @@ For more detailed information see [1988 dale bugs](../../bugs.html#1988_dale).
## Try:
-```sh
+```
./try.sh
```
Observe that three of the commands in the script are:
-```sh
+```
./dale these files are in this directory: *
./dale $(printf "the following files exist in this directory:\n%s\n" *)
./dale "$(printf "the following files exist in this directory:\n%s\n" *)"
diff --git a/1988/dale/index.html b/1988/dale/index.html
index 09c40a938..defc16f6d 100644
--- a/1988/dale/index.html
+++ b/1988/dale/index.html
@@ -141,17 +141,17 @@ Location: AU - Commonwealth of Australi
Observe that three of the commands in the script are:
-
./dale these files are in this directory: *
-./dale$(printf"the following files exist in this directory:\n%s\n"*)
-./dale"$(printf"the following files exist in this directory:\n%s\n"*)"
+
./dale these files are in this directory: *
+ ./dale $(printf "the following files exist in this directory:\n%s\n" *)
+ ./dale "$(printf "the following files exist in this directory:\n%s\n" *)"
As the script asks what do the last two do and why do they do it? Why do they
differ in format from the first command? Finally how can you get the more likely
desired behaviour?
diff --git a/1988/isaak/README.md b/1988/isaak/README.md
index 3b056c3ef..f4fb99ff8 100644
--- a/1988/isaak/README.md
+++ b/1988/isaak/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./isaak
```
@@ -21,7 +21,7 @@ code](#alternate-code) below.
The original version of this code is in [isaak.alt.c](isaak.alt.c).
The original entry starts with the line:
-```c
+```
main(){};
```
@@ -37,7 +37,7 @@ compile.
### Alternate build:
-```sh
+```
make alt
```
@@ -64,7 +64,7 @@ due to the fact that BSD style systems have an `sprintf(3)` that returns a `char
*`. Due to the above problems, we placed the output of this program in the
file: isaak.encode. To read this file do.
-```sh
+```
uudecode < isaak.encode
cat isaak.output
```
diff --git a/1988/isaak/index.html b/1988/isaak/index.html
index 5a21420fb..c82d0be24 100644
--- a/1988/isaak/index.html
+++ b/1988/isaak/index.html
@@ -141,16 +141,16 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There is an alternate version, the original, that can’t be compiled in modern
systems but can be if you have an old enough compiler. See Alternate
code below.
To use:
-
./isaak
+
./isaak
Alternate code:
The original version of this code is in isaak.alt.c.
The original entry starts with the line:
-
main(){};
+
main(){};
This works on some systems. Why? Note that #include <stdio.h> is given on
the last line. Why is this needed? Note the unusual calls to sprintf(3).
This version also relied on being able to define #define to something else and
@@ -158,7 +158,7 @@ using that macro for #define.
This version will not likely work on modern systems if you can even get it to
compile.
Alternate build:
-
make alt
+
make alt
Use isaak.alt as you would isaak above.
Judges’ remarks:
The program relies heavily on ASCII. Don’t even think of running it on
@@ -173,8 +173,8 @@ from a single macro (e.g., "O/**/O" creates either ++
NOTE: Most System V machines were not be able to execute this program correctly
due to the fact that BSD style systems have an sprintf(3) that returns a char *. Due to the above problems, we placed the output of this program in the
file: isaak.encode. To read this file do.
-
uudecode< isaak.encode
-cat isaak.output
+
uudecode < isaak.encode
+ cat isaak.output
Since this was fixed, this file is not strictly necessary. See the
isaak.alt.c for the original source.
FYI: We are likely to be more strict about portability in the future.
diff --git a/1988/litmaath/README.md b/1988/litmaath/README.md
index 82dd7ef80..a38ba4d0f 100644
--- a/1988/litmaath/README.md
+++ b/1988/litmaath/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./litmaath some text
```
@@ -17,7 +17,7 @@ code](#alternate-code) section below.
## Try:
-```sh
+```
./litmaath eschew obfuscation
```
@@ -31,7 +31,7 @@ a file.
### Alternate build:
-```sh
+```
make alt
```
@@ -40,7 +40,7 @@ Use `litmaath.alt` as you would `litmaath` above.
### Alternate try:
-```sh
+```
./litmaath.alt six was afraid of seven because seven eight nine
```
@@ -50,7 +50,7 @@ Use `litmaath.alt` as you would `litmaath` above.
Note the unusual structure:
-```c
+```
while ()
;
```
@@ -66,7 +66,7 @@ could make the body of the `while` loop an `fprintf` with interesting
variables like:
-```c
+```
fprintf(stderr,
"argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
(long) argv, (long) *argv, *argv && **argv ? **argv : '@',
diff --git a/1988/litmaath/index.html b/1988/litmaath/index.html
index f72d5f603..e59ba43a1 100644
--- a/1988/litmaath/index.html
+++ b/1988/litmaath/index.html
@@ -141,26 +141,26 @@ Location: CH - Swiss Confederation
To build:
-
make
+
make
To use:
-
./litmaath some text
+
./litmaath some text
There is an alternate version provided. See the Alternate
code section below.
Try:
-
./litmaath eschew obfuscation
+
./litmaath eschew obfuscation
Alternate code:
This alternate code, added to help understand the entry and for fun, is code
that we suggested at the time of the entry publication but which we never put in
a file.
Alternate build:
-
make alt
+
make alt
Use litmaath.alt as you would litmaath above.
Alternate try:
-
./litmaath.alt six was afraid of seven because seven eight nine
+
./litmaath.alt six was afraid of seven because seven eight nine
Judges’ remarks:
Note the unusual structure:
-
while(<condition>)
-;
+
while (<condition>)
+ ;
Did you notice that the body is empty?
Furthermore, it’s interesting to note that only two variables are
used to achieve everything.
@@ -168,10 +168,10 @@ used to achieve everything.
two small strings as arguments, and follow the program closely. One
could make the body of the while loop an fprintf with interesting
variables like:
diff --git a/1988/phillipps/README.md b/1988/phillipps/README.md
index 110c42351..4e8a9bbbc 100644
--- a/1988/phillipps/README.md
+++ b/1988/phillipps/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
diff --git a/1988/phillipps/index.html b/1988/phillipps/index.html
index a6ab162d4..0110ee207 100644
--- a/1988/phillipps/index.html
+++ b/1988/phillipps/index.html
@@ -141,7 +141,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
Judges’ remarks:
Compile and run without parameters.
The program is smaller than even the ‘compressed’ form of its output,
diff --git a/1988/reddy/README.md b/1988/reddy/README.md
index 885f75ae5..25cd1004e 100644
--- a/1988/reddy/README.md
+++ b/1988/reddy/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./reddy
char *(*(fun[16])();
char *(*(*(*(*(*fun[32])))))();
@@ -15,7 +15,7 @@
What happens if you input, and what you do about it?
-```c
+```
char *(*(*(*(*(*fun[32])))))());
```
diff --git a/1988/reddy/index.html b/1988/reddy/index.html
index 7aa165538..05596c7e5 100644
--- a/1988/reddy/index.html
+++ b/1988/reddy/index.html
@@ -141,13 +141,13 @@ Location: ZZ - Unknown location
What happens if you input, and what you do about it?
-
char*(*(*(*(*(*fun[32])))))());
+
char *(*(*(*(*(*fun[32])))))());
Judges’ remarks:
This is a somewhat restricted version of a useful program that has been
posted to Usenet. What is unusual is what it is able to do so much
diff --git a/1988/robison/README.md b/1988/robison/README.md
index f22e77bb2..36dd9a375 100644
--- a/1988/robison/README.md
+++ b/1988/robison/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./robison 80 10
./robison 40 16
```
The first and second parameters are optional. You might also try:
-```sh
+```
./robison 80 2 # <--- can you find the bug?
./robison 80 -246
```
@@ -24,7 +24,7 @@ The first and second parameters are optional. You might also try:
The following might make an interesting benchmark:
-```sh
+```
./robison 100
```
diff --git a/1988/robison/index.html b/1988/robison/index.html
index 687eb1735..965a79fc6 100644
--- a/1988/robison/index.html
+++ b/1988/robison/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
To build:
-
make all
+
make all
Try:
-
./robison 80 10
-./robison 40 16
+
./robison 80 10
+ ./robison 40 16
The first and second parameters are optional. You might also try:
-
./robison 80 2 # <--- can you find the bug?
-./robison 80 -246
+
./robison 80 2 # <--- can you find the bug?
+ ./robison 80 -246
Judges’ remarks:
The following might make an interesting benchmark:
-
./robison 100
+
./robison 100
[Amdahl 5890-300E with System V cc: 8.40 seconds]
We suggest that you C pre-process and perhaps C-beautify this program.
All is not what it may appear to be in this program. Why does a whi1e
diff --git a/1988/spinellis/README.md b/1988/spinellis/README.md
index 31e87cf2c..aa12f1b32 100644
--- a/1988/spinellis/README.md
+++ b/1988/spinellis/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make clobber all
```
@@ -12,7 +12,7 @@ code](#alternate-code) section below.
## To use:
-```sh
+```
./spinellis
```
@@ -21,7 +21,7 @@ EOF (typically ctrl-d).
Now run again:
-```sh
+```
./spinellis
```
@@ -33,7 +33,7 @@ For clang or compilers that won't read from `/dev/tty`, we provide this version.
### Alternate build:
-```sh
+```
make clobber alt
```
@@ -42,7 +42,7 @@ and follow the instructions.
### Alternate use:
-```sh
+```
./spinellis.alt
```
@@ -51,7 +51,7 @@ EOF (typically ctrl-d).
Now run again:
-```sh
+```
./spinellis.alt
```
diff --git a/1988/spinellis/index.html b/1988/spinellis/index.html
index dad63885a..6f91e41f9 100644
--- a/1988/spinellis/index.html
+++ b/1988/spinellis/index.html
@@ -141,27 +141,27 @@ Location: GR - Hellenic Republic (
To build:
-
make clobber all
+
make clobber all
and follow the instructions this will give you.
If your compiler will not read from /dev/tty see the Alternate
code section below.
To use:
-
./spinellis
+
./spinellis
Type in or copy paste some C code, perhaps from input.txt, and send
EOF (typically ctrl-d).
Now run again:
-
./spinellis
+
./spinellis
Alternate code:
For clang or compilers that won’t read from /dev/tty, we provide this version.
Alternate build:
-
make clobber alt
+
make clobber alt
and follow the instructions.
Alternate use:
-
./spinellis.alt
+
./spinellis.alt
Type in or copy paste some C code, perhaps from input.txt, and send
EOF (typically ctrl-d).
Now run again:
-
./spinellis.alt
+
./spinellis.alt
Judges’ remarks:
We enjoyed this entry this year; however in the future programs must be able to
be compiled from within a Makefile without the need of human intervention.
diff --git a/1988/westley/README.md b/1988/westley/README.md
index a554eaacb..800abe233 100644
--- a/1988/westley/README.md
+++ b/1988/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,13 +11,13 @@ might wish to do so.
## Try:
-```sh
+```
./westley
```
Also try:
-```sh
+```
./try.sh
```
@@ -31,7 +31,7 @@ This version is the original which might not work as you expect nowadays.
### Alternate build:
-```sh
+```
make alt
```
@@ -41,7 +41,7 @@ This version is the original which might not work as you expect nowadays.
To see if your compiler has the problem described in the Judges' remarks below,
try:
-```sh
+```
./westley.alt
```
@@ -52,7 +52,7 @@ Does it show the same output as `westley`?
Your compiler must parse
-```c
+```
#define _ -a
-_
```
@@ -62,7 +62,7 @@ conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:
-```c
+```
#define _ F-->00||F-OO--;
```
@@ -71,7 +71,7 @@ code is the original.
You might enjoy looking at the output of:
-```sh
+```
cc -E westley.alt.c
```
diff --git a/1988/westley/index.html b/1988/westley/index.html
index fbac68a51..4dc3e8537 100644
--- a/1988/westley/index.html
+++ b/1988/westley/index.html
@@ -141,37 +141,37 @@ Location: US - United States of America
To build:
-
make all
+
make all
NOTE: this version is a fixed version for modern C compilers. See the Alternate
code section below for how to use the original and why one
might wish to do so.
Try:
-
./westley
+
./westley
Also try:
-
./try.sh
+
./try.sh
to show the code with followed by the result so you can truly see the magic.
Alternate code:
This version is the original which might not work as you expect nowadays.
Alternate build:
-
make alt
+
make alt
Alternate use:
To see if your compiler has the problem described in the Judges’ remarks below,
try:
-
./westley.alt
+
./westley.alt
Does it show the same output as westley?
Judges’ remarks:
Your compiler must parse
-
#define _ -a
--_
+
#define _ -a
+ -_
as --a and not -(-a) or some other tokenized form. Some strictly
conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:
-
#define _ F-->00||F-OO--;
+
#define _ F-->00||F-OO--;
This is what the modified code in westley.c does whereas the alt
code is the original.
You might enjoy looking at the output of:
-
cc-E westley.alt.c
+
cc -E westley.alt.c
Author’s remarks:
No remarks were provided by the author.
make all
```
@@ -18,14 +18,14 @@ For more detailed information see [1989 fubar bugs](../../bugs.html#1989_fubar).
## To use:
-```sh
+```
./fubar
```
## Try:
-```sh
+```
./try.sh # run on 1 - 7
./fubar.sh 2 # run via script
diff --git a/1989/fubar/index.html b/1989/fubar/index.html
index f2b7bfc49..123a44675 100644
--- a/1989/fubar/index.html
+++ b/1989/fubar/index.html
@@ -141,18 +141,18 @@ Location: US - United States of America
./try.sh# run on 1 - 7
-
-./fubar.sh 2 # run via script
-./fubar 2 # run directly
+
./try.sh # run on 1 - 7
+
+ ./fubar.sh 2 # run via script
+ ./fubar 2 # run directly
Judges’ remarks:
Run this with a single digit argument (or wait a long time and risk an infinite
loop as described in the 1989 fubar bugs file).
diff --git a/1989/jar.1/README.md b/1989/jar.1/README.md
index 067ad9990..e00bf6723 100644
--- a/1989/jar.1/README.md
+++ b/1989/jar.1/README.md
@@ -2,7 +2,7 @@
NOTE: this will run the program itself.
-```sh
+```
make clobber all
```
@@ -12,7 +12,7 @@ See the [Alternate code](#alternate-code) section below for more details.
## To use:
-```sh
+```
./jar.1
```
@@ -26,14 +26,14 @@ This alternate code, which prints something slightly different, is provided as w
NOTE: this will run the program itself.
-```sh
+```
make clobber alt
```
### Alternate use:
-```sh
+```
./jar.1.alt
```
@@ -43,7 +43,7 @@ NOTE: this will run the program itself.
On many systems the compiler will not allow you to send the object file to
`/dev/tty`. The author suggested:
-```sh
+```
cc -c -o /dev/tty jar.1.c
```
diff --git a/1989/jar.1/index.html b/1989/jar.1/index.html
index 928cc4b99..026643f68 100644
--- a/1989/jar.1/index.html
+++ b/1989/jar.1/index.html
@@ -142,22 +142,22 @@ Location: SE - Kingdom of Sweden (
To build:
NOTE: this will run the program itself.
-
make clobber all
+
make clobber all
There is an alternate version with a slight difference that you may wish to try.
See the Alternate code section below for more details.
To use:
-
./jar.1
+
./jar.1
Alternate code:
This alternate code, which prints something slightly different, is provided as well.
Alternate build:
NOTE: this will run the program itself.
-
make clobber alt
+
make clobber alt
Alternate use:
-
./jar.1.alt
+
./jar.1.alt
Judges’ remarks:
On many systems the compiler will not allow you to send the object file to
/dev/tty. The author suggested:
-
cc-c-o /dev/tty jar.1.c
+
cc -c -o /dev/tty jar.1.c
As a last resort the jar.1.sh script provided simulates
writing the raw binary of the .o file to the terminal.
Abuse of the rules winning entry usually result in a change of the rules.
diff --git a/1989/jar.2/README.md b/1989/jar.2/README.md
index d4b0ee2dc..09e031dc5 100644
--- a/1989/jar.2/README.md
+++ b/1989/jar.2/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./jar.2
[enter some lisp]
@@ -19,7 +19,7 @@ NOTE: this entry will likely segfault on invalid input.
## Try:
-```sh
+```
./try.sh
./try.sh chocolate_cake.lisp
@@ -65,7 +65,7 @@ lisp expressions (followed by CR), the program evaluates them and
prints out the return values. End execution by typing an end-of-file
character.
-```lisp
+```
(+ 2.5 3.1)
(defun fib (n)
(if (< n 2)
diff --git a/1989/jar.2/index.html b/1989/jar.2/index.html
index 2964b0b78..8a40f5b60 100644
--- a/1989/jar.2/index.html
+++ b/1989/jar.2/index.html
@@ -147,19 +147,19 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./jar.2
-[enter some lisp]
-
-./jar.2< some_lisp_file
+
./jar.2
+ [enter some lisp]
+
+ ./jar.2 < some_lisp_file
NOTE: this entry will likely segfault on invalid input.
This is the most useful program submitted this year. It is a
rather large subset of lisp. It has no error recovery, and
@@ -192,24 +192,24 @@ The program implements a conventional lisp listener, i.e. you type in
lisp expressions (followed by CR), the program evaluates them and
prints out the return values. End execution by typing an end-of-file
character.
-
(+2.53.1)
- (defun fib (n)
- (if (< n 2)
-1
- (+ (fib (- n 2)) (fib (- n 1)))))
- (fib 10)
- (defun! (x) (if (equal x 0) 1 (* x (! (- x 1)))))
- (! 7)
- (defun fn1 (fn) (+ (fn 12) (fn 34)))
- (defun fn2 (a b) (+ a b))
- (fn1 (function+))
- (fn1 (function fn2))
- (fn1 (function (lambda (z1 z2) (+ z1 z2))))
- (quote a)
- (cons (quote (a b)) (quote (c d e)))
- (cons (quote (f)) ())
- (car (quote (a b c)))
- (cdr (cdr (quote (g h i))))
+
(+ 2.5 3.1)
+ (defun fib (n)
+ (if (< n 2)
+ 1
+ (+ (fib (- n 2)) (fib (- n 1)))))
+ (fib 10)
+ (defun ! (x) (if (equal x 0) 1 (* x (! (- x 1)))))
+ (! 7)
+ (defun fn1 (fn) (+ (fn 1 2) (fn 3 4)))
+ (defun fn2 (a b) (+ a b))
+ (fn1 (function +))
+ (fn1 (function fn2))
+ (fn1 (function (lambda (z1 z2) (+ z1 z2))))
+ (quote a)
+ (cons (quote (a b)) (quote (c d e)))
+ (cons (quote (f)) ())
+ (car (quote (a b c)))
+ (cdr (cdr (quote (g h i))))
Please do not leave any whitespace before the first parenthesis when
you type your input, or any other unnecessary whitespace. Please try to
avoid any undefined variables or functions, wrong number of arguments
diff --git a/1989/ovdluhe/README.md b/1989/ovdluhe/README.md
index f69c14cc6..0192e7207 100644
--- a/1989/ovdluhe/README.md
+++ b/1989/ovdluhe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@ To get this to compile with a modern CPP, we had to replace `#D` with `#define`.
Run the program this way:
-```sh
+```
./ovdluhe < textfile
```
@@ -21,7 +21,7 @@ by chance or is killed.
## Try:
-```sh
+```
./try.sh ; sleep 2 ; ./try.sh
```
@@ -34,7 +34,7 @@ it's a `#define` it's easy to set up.
### Alternate build:
-```sh
+```
make P=9 clobber alt
```
@@ -46,14 +46,14 @@ program to fail and a negative value will cause a compilation error.
### Alternate use:
-```sh
+```
./ovdluhe.alt
```
### Alternate try:
-```sh
+```
./try.alt.sh
P=5 ./try.alt.sh
diff --git a/1989/ovdluhe/index.html b/1989/ovdluhe/index.html
index 45bc66698..71f36ce47 100644
--- a/1989/ovdluhe/index.html
+++ b/1989/ovdluhe/index.html
@@ -141,30 +141,30 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To get this to compile with a modern CPP, we had to replace #D with #define.
To use:
Run the program this way:
-
./ovdluhe< textfile
+
./ovdluhe < textfile
The program stops when it reaches the end of the template buffer
by chance or is killed.
Try:
-
./try.sh;sleep 2 ;./try.sh
+
./try.sh ; sleep 2 ; ./try.sh
Alternate code:
The author suggested that one varies the definition of P from 2 through 10. As
it’s a #define it’s easy to set up.
Alternate build:
-
make P=9 clobber alt
+
make P=9 clobber alt
You do not have to define P but if you do you can replace the value with
whatever you wish, as long as it’s a positive int (or evaluates to a positive
int like the default (A<<AP) does). Too high a value will likely cause the
program to fail and a negative value will cause a compilation error.
Alternate use:
-
./ovdluhe.alt
+
./ovdluhe.alt
Alternate try:
-
./try.alt.sh
-
-P=5 ./try.alt.sh
+
./try.alt.sh
+
+ P=5 ./try.alt.sh
NOTE: if you specify too high a value for P the program might fail. If you
specify a value < 0 it will fail to compile.
Judges’ remarks:
diff --git a/1989/paul/README.md b/1989/paul/README.md
index c091e6b26..cc69b975d 100644
--- a/1989/paul/README.md
+++ b/1989/paul/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,7 +10,7 @@ out. See [alternate code](#alternate-code) below for more details.
## Try:
-```sh
+```
./paul
```
@@ -28,14 +28,14 @@ could easily be added.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./paul.alt
```
diff --git a/1989/paul/index.html b/1989/paul/index.html
index 76ee0b93d..e375b98ad 100644
--- a/1989/paul/index.html
+++ b/1989/paul/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is an alternate version with a trace routine that the author had commented
out. See alternate code below for more details.
Try:
-
./paul
+
./paul
Alternate code:
This version was described by the author like:
@@ -156,9 +156,9 @@ and forth as the program runs. A much better debugger or trace
could easily be added.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./paul.alt
+
./paul.alt
Judges’ remarks:
The author’s comments is a detailed program explanation and spoiler. If you
want a real challenge, don’t read any further and try to understand the program
diff --git a/1989/robison/README.md b/1989/robison/README.md
index fbe613620..90e9ef7da 100644
--- a/1989/robison/README.md
+++ b/1989/robison/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1989 robison bugs](../../bugs.html#1989_robis
## To use:
-```sh
+```
./robison
# enter valid expressions
```
@@ -26,7 +26,7 @@ For more detailed information see [1989 robison bugs](../../bugs.html#1989_robis
## Try:
-```sh
+```
./robison
11x10
# enter other expressions
diff --git a/1989/robison/index.html b/1989/robison/index.html
index d52e769fd..cde482e6b 100644
--- a/1989/robison/index.html
+++ b/1989/robison/index.html
@@ -141,22 +141,22 @@ Location: US - United States of America
./robison
-11x10
-# enter other expressions
-
-./try.sh
-
-echo 100 / 100 |./robison# <-- what happens here ?
+
./robison
+ 11x10
+ # enter other expressions
+
+ ./try.sh
+
+ echo 100 / 100 | ./robison # <-- what happens here ?
NOTE: This program will very likely crash or break into tiny bits :-) if you
feed it numbers with non-binary digits. This, as you might notice if you try one
of the above commands, can happen with other input as well. If you wish to
diff --git a/1989/roemer/README.md b/1989/roemer/README.md
index 0e0924b83..5991a2fa5 100644
--- a/1989/roemer/README.md
+++ b/1989/roemer/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./roemer
```
diff --git a/1989/roemer/index.html b/1989/roemer/index.html
index 899137470..14d88b633 100644
--- a/1989/roemer/index.html
+++ b/1989/roemer/index.html
@@ -141,9 +141,9 @@ Location: NL - Kingdom of the Netherlan
To build:
-
make all
+
make all
Try:
-
./roemer
+
./roemer
Judges’ remarks:
Do you know what this program does? If you do, look again, there is more here
than meets the PI.
diff --git a/1989/tromp/README.md b/1989/tromp/README.md
index e9dec993d..397440e90 100644
--- a/1989/tromp/README.md
+++ b/1989/tromp/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./tromp [drops_per_sec [cmd_string]]
```
## Try:
-```sh
+```
./tromp 5
./tromp 10 "hkl jq"
@@ -53,7 +53,7 @@ the judges' additional remarks in the author's remarks, for more details.
### Alternate build:
-```sh
+```
make alt
```
@@ -138,7 +138,7 @@ at the start and `-raw` at the end. This further reduces the size of
the program, but has the possible disadvantage that the program
can only by stopped by 'q' or by the `kill -9' command.
-```c
+```
long h[4];t(){h[3]-=h[3]/3000;setitimer(0,h,0);}c,d,l,v[]={(int)t,0,2},w,s,I,K
=0,i=276,j,k,q[276],Q[276],*n=q,*m,x=17,f[]={7,-13,-12,1,8,-11,-12,-1,9,-1,1,
12,3,-13,-12,-1,12,-1,11,1,15,-1,13,1,18,-1,1,2,0,-12,-1,11,1,-12,1,13,10,-12,
diff --git a/1989/tromp/index.html b/1989/tromp/index.html
index f7e6a5b5c..609ee6377 100644
--- a/1989/tromp/index.html
+++ b/1989/tromp/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./tromp [drops_per_sec [cmd_string]]
+
./tromp [drops_per_sec [cmd_string]]
Try:
-
./tromp 5
-
-./tromp 10 "hkl jq"
+
./tromp 5
+
+ ./tromp 10 "hkl jq"
The second command, ./tromp 10 "hkl jq", will set up the keys kind of like
vim:
@@ -171,7 +171,7 @@ loser :-)
The author provided an alternate version of the code with some improvements. See
the judges’ additional remarks in the author’s remarks, for more details.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use tromp.alt as you would tromp above.
NOTE: testing more than one user updating the high score file, one of the
@@ -231,25 +231,25 @@ temporary file.
at the start and -raw at the end. This further reduces the size of
the program, but has the possible disadvantage that the program
can only by stopped by ‘q’ or by the `kill -9’ command.
NOTE: the alternate version was fixed for modern systems in 2023.
make all
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1989/vanb/index.html b/1989/vanb/index.html
index 17b8c2be0..b1918885e 100644
--- a/1989/vanb/index.html
+++ b/1989/vanb/index.html
@@ -141,9 +141,9 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This program computes all proper subsets of the set of
arguments passed to it. Each subset is printed with one
diff --git a/1989/westley/README.md b/1989/westley/README.md
index 73389b49d..a9867c8d6 100644
--- a/1989/westley/README.md
+++ b/1989/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -20,26 +20,26 @@ For more detailed information see [1989 westley bugs](../../bugs.html#1989_westl
Try compiling and running the 4 resulting programs like:
-```sh
+```
./compile.sh
```
If you need to specify an alternate compiler path, say because your default
compiler is clang (or in the case of macOS gcc is clang) you can do so like:
-```sh
+```
CC=/opt/local/bin/gcc-mp-12 ./compile.sh
```
If you wish to delay the script or remove the delay you can do so like:
-```sh
+```
DELAY=2 ./compile.sh
```
Finally try:
-```sh
+```
./westley
# input some lines of text, sending EOF (usually ctrl-d) to end
@@ -70,7 +70,7 @@ different algorithm for each version (hereafter referred to as
When compiling these versions, one needs to define `trgpune`
in the compile line (which the Makefile now has). Example:
-```sh
+```
cc -Dtrgpune=putchar ver3.c -o ver3
```
@@ -109,13 +109,13 @@ function `vs()` to define in the ROT13 version. But a function
called `vs()` turns into a function called `if()` in the original,
so it can't be done. Therefore, I do:
-```c
+```
expr1 && expr2 && (expr3=etc);
```
which is the same as:
-```c
+```
if (expr1 && expr2) expr3=etc;
```
@@ -124,7 +124,7 @@ expressions if they aren't in an assignment or conditional
statement. This might warrant a warning, since other compilers
may do this. I found MANY compilers botched:
-```c
+```
expr1 && (expr2,expr3);
```
@@ -146,7 +146,7 @@ such statements to make it more portable.
Normally (!), a reversible C program is done thus:
-```c
+```
/**/ forward code /*/ edoc drawkcab /**/
```
@@ -154,7 +154,7 @@ If your compiler nests comments, it will get this wrong.
However, I have made some bits of the code palindromic,
(or different, but reversible) so it is more like:
-```c
+```
/**/forward/*//**/ palindromic /**//*/drawkcab/**/
```
diff --git a/1989/westley/index.html b/1989/westley/index.html
index c864ec738..ba0a1326f 100644
--- a/1989/westley/index.html
+++ b/1989/westley/index.html
@@ -141,24 +141,24 @@ Location: US - United States of America
Try compiling and running the 4 resulting programs like:
-
./compile.sh
+
./compile.sh
If you need to specify an alternate compiler path, say because your default
compiler is clang (or in the case of macOS gcc is clang) you can do so like:
-
CC=/opt/local/bin/gcc-mp-12 ./compile.sh
+
CC=/opt/local/bin/gcc-mp-12 ./compile.sh
If you wish to delay the script or remove the delay you can do so like:
-
DELAY=2 ./compile.sh
+
DELAY=2 ./compile.sh
Finally try:
-
./westley
-# input some lines of text, sending EOF (usually ctrl-d) to end
-
-./try.sh# demo of some input
+
./westley
+ # input some lines of text, sending EOF (usually ctrl-d) to end
+
+ ./try.sh # demo of some input
Judges’ remarks:
There is a secret way to get ONE of the versions to print out
“Hello, world!\n”. Can you find how to do it?
@@ -175,7 +175,7 @@ different algorithm for each version (hereafter referred to as
(ROT13 and reversed)).
When compiling these versions, one needs to define trgpune
in the compile line (which the Makefile now has). Example:
-
cc-Dtrgpune=putchar ver3.c -o ver3
+
cc -Dtrgpune=putchar ver3.c -o ver3
trgpune is the ROT13 of getchar(), so getchar() and putchar()
are exchanged in the ROT13 counterpart. It is easy to see that
this is unavoidable. I must have a #define for a library
@@ -207,14 +207,14 @@ first argument (argc) must be at least one).
function vs() to define in the ROT13 version. But a function
called vs() turns into a function called if() in the original,
so it can’t be done. Therefore, I do:
-
expr1 && expr2 &&(expr3=etc);
+
expr1 && expr2 && (expr3=etc);
which is the same as:
-
if(expr1 && expr2) expr3=etc;
+
if (expr1 && expr2) expr3=etc;
A/UX on the Macintosh doesn’t get this right; it evaluates ALL
expressions if they aren’t in an assignment or conditional
statement. This might warrant a warning, since other compilers
may do this. I found MANY compilers botched:
-
expr1 &&(expr2,expr3);
+
expr1 && (expr2,expr3);
expr2 was OFTEN evaluated even if expr1 was false. I removed
such statements to make it more portable.
Variable names worth noting
@@ -224,11 +224,11 @@ such statements to make it more portable.
tang and gnat are both ROT13 and palindrome pairs!
–
Normally (!), a reversible C program is done thus:
-
/**/ forward code /*/ edoc drawkcab /**/
+
/**/ forward code /*/ edoc drawkcab /**/
If your compiler nests comments, it will get this wrong.
However, I have made some bits of the code palindromic,
(or different, but reversible) so it is more like:
This alternate code is for the very fewusers
@@ -165,7 +165,7 @@ the " #Q" string was not changed as that showed worse looking outpu
of improved output though admittedly we have no way to test the compilers in
question. YMMV.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use baruch.alt as you would baruch.
Judges’ remarks:
diff --git a/1990/cmills/README.md b/1990/cmills/README.md
index 4a24c37ba..d581abe43 100644
--- a/1990/cmills/README.md
+++ b/1990/cmills/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./cmills [starting_cash]
```
## Try:
-```sh
+```
./cmills 5000
```
diff --git a/1990/cmills/index.html b/1990/cmills/index.html
index 0beba9f6b..e270b6664 100644
--- a/1990/cmills/index.html
+++ b/1990/cmills/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./cmills[starting_cash]
+
./cmills [starting_cash]
Try:
-
./cmills 5000
+
./cmills 5000
Judges’ remarks:
The Makefile uses several -D defines. The following is is a list of the macros
that may be changed:
diff --git a/1990/dds/README.md b/1990/dds/README.md
index c402de7b6..f060670a2 100644
--- a/1990/dds/README.md
+++ b/1990/dds/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dds
```
@@ -16,7 +16,7 @@
Give the following lines as input:
-```basic
+```
OLD LANDER.BAS
RUN
```
diff --git a/1990/dds/index.html b/1990/dds/index.html
index adf7e1d09..44789db16 100644
--- a/1990/dds/index.html
+++ b/1990/dds/index.html
@@ -141,12 +141,12 @@ Location: GR - Hellenic Republic (
To build:
-
make all
+
make all
To use:
-
./dds
+
./dds
Try:
Give the following lines as input:
-
OLD LANDER.BAS
+
OLD LANDER.BAS
RUN
NOTE: this entry is probably one of the only times CAPS LOCK might be worth
having (though still not useful enough to enable :-) ) as all input has to be
diff --git a/1990/dg/README.md b/1990/dg/README.md
index 5315a3576..1712f36d2 100644
--- a/1990/dg/README.md
+++ b/1990/dg/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
echo foo bar | ./dg
```
## Try:
-```sh
+```
./try.sh
```
@@ -24,13 +24,13 @@
Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line:
-```c
+```
b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
```
sometimes has to be changed to:
-```c
+```
b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
```
@@ -56,7 +56,7 @@ As for the rot13 algorithm, it relies on `index(3)` to find if the
character is in the set `A-Za-z`. `l[]` is an array that gets filled
with:
-```c
+```
"nopqrstuvwxyzzzzabcdefghijklmmmmNOPQRSTUVWXYZZZZABCDEFGHIJKLMMMM"
```
diff --git a/1990/dg/index.html b/1990/dg/index.html
index 5d9f466cb..2888a1ba3 100644
--- a/1990/dg/index.html
+++ b/1990/dg/index.html
@@ -141,17 +141,17 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
echo foo bar |./dg
+
echo foo bar | ./dg
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line:
If index(3) says the char is in the alphabet, then XOR the offset
with 16 to translate, and output, otherwise pass it unchanged.
make all
```
@@ -9,7 +9,7 @@
To test the official C entry, one might try:
-```sh
+```
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
```
@@ -19,7 +19,7 @@ sentence.
#### Also try:
-```sh
+```
./try.sh
```
@@ -39,14 +39,14 @@ it to 1530 bytes) which implements the complete shark utility. The script,
The sender must have `compress` and `btoa`. To send, try:
-```sh
+```
./shark.sh jaw.* README.md > receive
```
The resulting file, `receive`, unpacks the input files
even if the receiver lacks `uncompress` and `btoa`:
-```sh
+```
mkdir -p test
cd test
sh ../receive
@@ -168,7 +168,7 @@ Construct `sharkmail`, to auto-split `sharkives` into mailable segments and mail
them. Here's a simple one, which could be extended to enable auto-reassembly
with one shell cmd at the far end.
-```sh
+```
#!/bin/sh
m=$1; shift
shark $* | split -800 - /tmp/shark$$
diff --git a/1990/jaw/index.html b/1990/jaw/index.html
index 8a3d4810a..1604bad73 100644
--- a/1990/jaw/index.html
+++ b/1990/jaw/index.html
@@ -147,14 +147,14 @@ Location: ZZ - Unknown location
which should apply the identity transformation to a minimal holoalphabetic
sentence.
Also try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The program, in its base form, implements two useful utilities:
@@ -165,14 +165,14 @@ sentence.
it to 1530 bytes) which implements the complete shark utility. The script,
shark.sh, contains a jaw.c embedded within it!
The sender must have compress and btoa. To send, try:
-
./shark.sh jaw.* README.md > receive
+
./shark.sh jaw.* README.md > receive
The resulting file, receive, unpacks the input files
even if the receiver lacks uncompress and btoa:
-
mkdir-p test
-cd test
-sh ../receive
-cmp ../jaw.c jaw.c
-cmp ../README.md README.md
+
mkdir -p test
+ cd test
+ sh ../receive
+ cmp ../jaw.c jaw.c
+ cmp ../README.md README.md
NOTE: a limitation is that the script should be in the parent directory of the
directory it is run from.
Authors’ remarks:
@@ -262,17 +262,17 @@ left, and source-to-source transformations galore.
Construct sharkmail, to auto-split sharkives into mailable segments and mail
them. Here’s a simple one, which could be extended to enable auto-reassembly
with one shell cmd at the far end.
-
#!/bin/sh
-m=$1;shift
-shark$*|split-800- /tmp/shark$$
-n=`ls /tmp/shark$$*|wc-l|sed's/ *//'`
-p=0
-for f in`ls /tmp/shark$$*`
-do
-p=`expr$p + 1`
-mail-s"bundle ($p of $n) from '`whoami`'"$m<$f
-done
-rm /tmp/shark$$*
+
#!/bin/sh
+ m=$1; shift
+ shark $* | split -800 - /tmp/shark$$
+ n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
+ p=0
+ for f in `ls /tmp/shark$$*`
+ do
+ p=`expr $p + 1`
+ mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
+ done
+ rm /tmp/shark$$*
Shark history:
May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
diff --git a/1990/pjr/README.md b/1990/pjr/README.md
index ad33dc46f..40225e8d5 100644
--- a/1990/pjr/README.md
+++ b/1990/pjr/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@ that can be used if your compiler is incapable of compiling `X=g()...` in
## To use:
-```sh
+```
./pjr
```
@@ -22,7 +22,7 @@ Note that some compilers will be unable to compile the expression `X=g()...` in
`main()` due to lack of temporary stack space. One might want to try replacing
`main()` with:
-```c
+```
main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}
```
@@ -34,14 +34,14 @@ well.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./pjr.alt
```
@@ -74,7 +74,7 @@ opposite:
To encode a new string input the string as it is meant to come out:
-```c
+```
X=s().v().o().o().l().S().d().l().i().o().w().N();
```
diff --git a/1990/pjr/index.html b/1990/pjr/index.html
index 9f71c4ade..8002f4f60 100644
--- a/1990/pjr/index.html
+++ b/1990/pjr/index.html
@@ -141,24 +141,24 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
There is an alternate version that does something different
that can be used if your compiler is incapable of compiling X=g()... in
main(). It can be used for another purpose too.
To use:
-
./pjr
+
./pjr
Alternate code:
Note that some compilers will be unable to compile the expression X=g()... in
main() due to lack of temporary stack space. One might want to try replacing
main() with:
Note: S() represents a space and N() a newline. This will now
produce…
hello world
diff --git a/1990/scjones/README.md b/1990/scjones/README.md
index 1f7e87e08..00b8b344c 100644
--- a/1990/scjones/README.md
+++ b/1990/scjones/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./scjones
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1990/scjones/index.html b/1990/scjones/index.html
index e204458a0..ecc59df96 100644
--- a/1990/scjones/index.html
+++ b/1990/scjones/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./scjones
+
./scjones
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The addition of trigraphs has made it easier to make programs hard to read. It
was a dark and stormy night for C when the ANSI C committee added trigraphs to
diff --git a/1990/stig/README.md b/1990/stig/README.md
index edf4c363e..761e50c8e 100644
--- a/1990/stig/README.md
+++ b/1990/stig/README.md
@@ -1,19 +1,19 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
make all
```
NOTE: that's not a typo or mistake but one can also do:
-```sh
+```
./o
```
diff --git a/1990/stig/index.html b/1990/stig/index.html
index f627d087b..de90e048a 100644
--- a/1990/stig/index.html
+++ b/1990/stig/index.html
@@ -141,11 +141,11 @@ Location: NO - Kingdom of Norway (
To build:
-
make all
+
make all
To use:
-
make all
+
make all
NOTE: that’s not a typo or mistake but one can also do:
-
./o
+
./o
Judges’ remarks:
We changed the alias that the author’s suggested alias from a
C-shell alias to a Bourne-like shell alias.
diff --git a/1990/tbr/README.md b/1990/tbr/README.md
index 3831a1eab..57ea68c95 100644
--- a/1990/tbr/README.md
+++ b/1990/tbr/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -25,7 +25,7 @@ In 2023 it was noticed that in some systems like macOS there was confusing
output due to a warning at runtime that was interspersed with the output of the
program. For instance it would show:
-```sh
+```
./tbr
$ warning: this program uses gets(), which is unsafe.
```
@@ -40,7 +40,7 @@ below, in the [alternate version](#alternate-code) section.
## To use:
-```sh
+```
./tbr
$ enter some shell commands
```
@@ -54,7 +54,7 @@ just `exit` or `logout`? Hint: see the authors' remarks.
## Try:
-```sh
+```
./tbr
$ ls -l tbr tbr.c
@@ -79,7 +79,7 @@ documented, are not considered bugs as such in the context of the contest.
The authors supplied us with a slightly smaller unformatted version
of the program which we include below:
-```c
+```
#define D ,close(
char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
@@ -99,14 +99,14 @@ equivalent like the authors intended.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./tbr.alt
```
@@ -165,13 +165,13 @@ argument is stolen every time a `>` or `<` is encountered. The
shell flags an error if no arguments are on the stack. Thus, for
example:
-```sh
+```
cat > foo > bar
```
cats to `foo`, since it was pushed last, but
-```sh
+```
cat > > foo bar
```
diff --git a/1990/tbr/index.html b/1990/tbr/index.html
index 0f7c09f5a..b1516f095 100644
--- a/1990/tbr/index.html
+++ b/1990/tbr/index.html
@@ -144,7 +144,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
The authors provided another version of this program. See the alternate
version section below.
Bugs and (Mis)features:
@@ -155,31 +155,31 @@ version section below.
In 2023 it was noticed that in some systems like macOS there was confusing
output due to a warning at runtime that was interspersed with the output of the
program. For instance it would show:
-
./tbr
-$ warning: this program uses gets(), which is unsafe.
+
./tbr
+ $ warning: this program uses gets(), which is unsafe.
which kind of hid the prompt. Thus the entry was changed to use fgets(3) which
is referred to later in this file.
Also exit(3) returns void but the entry was using it in a binary expression so
this entry would not compile in modern systems. This fix is also referred to
below, in the alternate version section.
To use:
-
./tbr
-$ enter some shell commands
+
./tbr
+ $ enter some shell commands
NOTE: globs do not work with this entry. Why?
NOTE: exit does not work and neither does logout. To exit try sending ctrl-d
or ctrl-c (or kill it from another terminal :-) ). But why does it not work with
just exit or logout? Hint: see the authors’ remarks.
Try:
-
./tbr
-$ ls -l tbr tbr.c
-
-# notice how the following does not work:
-ls tbr*
-
-# try figuring out how this entry works in an editor:
-vi tbr.c
-
-# then figure out how to exit vi :-)
+
./tbr
+ $ ls -l tbr tbr.c
+
+ # notice how the following does not work:
+ ls tbr*
+
+ # try figuring out how this entry works in an editor:
+ vi tbr.c
+
+ # then figure out how to exit vi :-)
What happens if you try using cd - to return to previous directory? What about
cd with no args?
The authors include a section called BUGS that, because they were
@@ -187,23 +187,23 @@ documented, are not considered bugs as such in the context of the contest.
Alternate code:
The authors supplied us with a slightly smaller unformatted version
of the program which we include below:
-
#define D ,close(
-char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
-32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
- r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
-*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
-++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
- r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
-0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
-1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;}
- e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;}
+
#define D ,close(
+ char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
+ 32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
+ r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
+ *u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
+ ++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
+ r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
+ 0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
+ 1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;}
+ e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;}
and in the alternate source. It has the exit() returns void fix
as well as the gets() to fgets() fix applied to it to make it functionally
equivalent like the authors intended.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./tbr.alt
+
./tbr.alt
Judges’ remarks:
This program touches on a well known Unix utility, the 6th edition Bourne Shell
(/bin/sh), whose original source was considered to be extremely obfuscated by
@@ -245,9 +245,9 @@ is parsed; a pointer to the stack of arguments is assigned and an
argument is stolen every time a > or < is encountered. The
shell flags an error if no arguments are on the stack. Thus, for
example:
-
cat> foo > bar
+
cat > foo > bar
cats to foo, since it was pushed last, but
-
cat>> foo bar
+
cat > > foo bar
cats to bar, since bar was pushed under foo (remember we’re
parsing right-left).
Depending on your flavor of Unix, cd without an argument will
diff --git a/1990/theorem/README.md b/1990/theorem/README.md
index 9d0c76dab..55707dce4 100644
--- a/1990/theorem/README.md
+++ b/1990/theorem/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1990 theorem bugs](../../bugs.html#1990_theor
## To use:
-```sh
+```
./theorem expression x1 x2 h y1
```
@@ -35,7 +35,7 @@ where:
## Try:
-```sh
+```
./try.sh
```
@@ -62,7 +62,7 @@ left to right. (i.e., parenthesis aren't supported).
Try running the program with the following args:
-```sh
+```
./theorem y 0 1 0.1 1
./theorem 1/x 1 2 0.1 0
./theorem 'x^2/y+x' 0 1 0.1 6
@@ -71,14 +71,14 @@ Try running the program with the following args:
But wait, there is more! You also get, free of charge, a
reversing filter! Try:
-```sh
+```
./theorem -r 0 0 0 0 < theorem.c > sorter.c
```
Still not impressed? The author throws in for free, a
sort program! Try:
-```sh
+```
make sorter
ls | ./sorter
```
@@ -87,14 +87,14 @@ This program is safe for home use as well. The author has
included a safety feature in case you misplace the original
program source:
-```sh
+```
./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c
```
And finally, as a special offer to users of this entry,
the author provides a Fibonacci sequence generator! Try:
-```sh
+```
./sorter 0 0 0 0 < theorem.c > fibonacci.c
make fibonacci
./fibonacci 1 1
diff --git a/1990/theorem/index.html b/1990/theorem/index.html
index 3aea42e67..f6eb0e6bf 100644
--- a/1990/theorem/index.html
+++ b/1990/theorem/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
expression - function f(x,y) (see below)
x1 - start of interval
@@ -155,7 +155,7 @@ Location: US - United States of America
h - step size
y1 - initial value (y(x1) == y1)
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The program’s source implements four functions, all from the
same source file!
@@ -169,26 +169,26 @@ operators:
integer powers. Also note that all expressions are evaluated strictly
left to right. (i.e., parenthesis aren’t supported).
NOTE: if the two args passed to fibonacci and theorem_bkp add to 0 it will
print 0 over and over again in an infinite loop. In this case it should not be
fixed (another condition where this occurred was fixed in 2023 as it affected
diff --git a/1990/westley/README.md b/1990/westley/README.md
index 75e8aa9a8..8ffd2c0f2 100644
--- a/1990/westley/README.md
+++ b/1990/westley/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./westley
```
@@ -16,7 +16,7 @@ The number should be greater than 0.
## Try:
-```sh
+```
./try.sh
```
@@ -30,14 +30,14 @@ The alternate code is provided to show how C changed.
If you have an old enough compiler try and to see how C has changed over the years:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./westley.alt
```
diff --git a/1990/westley/index.html b/1990/westley/index.html
index 4d4132ef9..1da1b630d 100644
--- a/1990/westley/index.html
+++ b/1990/westley/index.html
@@ -141,19 +141,19 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./westley<number>
+
./westley <number>
The number should be greater than 0.
Try:
-
./try.sh
+
./try.sh
Alternate code:
The alternate code is provided to show how C changed.
Alternate build:
If you have an old enough compiler try and to see how C has changed over the years:
-
make alt
+
make alt
Alternate use:
-
./westley.alt<number>
+
./westley.alt <number>
Judges’ remarks:
If you would rather “Daisy” someone other than Westley, rename
the program as needed. :-)
diff --git a/1991/README.md b/1991/README.md
index 4e9f2d2f2..c8812208f 100644
--- a/1991/README.md
+++ b/1991/README.md
@@ -35,7 +35,7 @@ been eliminated, and will likely be considered in future years.
A number of entries made use of the following C pre-processor feature:
-```c
+```
#define X define
#X foo bar
```
diff --git a/1991/ant/README.md b/1991/ant/README.md
index 77c5497e6..12f231e7c 100644
--- a/1991/ant/README.md
+++ b/1991/ant/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,7 +10,7 @@ familiar to vi(m) users.
## To use:
-```sh
+```
./ant some_file
```
@@ -20,12 +20,12 @@ program exit without doing anything.
## Try:
-```sh
+```
make hill
./ant hill
```
-```sh
+```
make mole
./ant mole
```
@@ -46,7 +46,7 @@ rest was unchanged.
### Alternate build:
-```sh
+```
make alt
```
diff --git a/1991/ant/index.html b/1991/ant/index.html
index 1fa9c75ff..e57894264 100644
--- a/1991/ant/index.html
+++ b/1991/ant/index.html
@@ -141,18 +141,18 @@ Location: CA - Canada
To build:
-
make all
+
make all
There is an alternate version that might feel a bit more
familiar to vi(m) users.
To use:
-
./ant some_file
+
./ant some_file
NOTE: the file must already exist and not specifying any arg will make the
program exit without doing anything.
Try:
-
make hill
-./ant hill
-
make mole
-./ant mole
+
make hill
+ ./ant hill
+
make mole
+ ./ant mole
Alternate code:
This version changes the commands slightly so that to go to the first column you
should enter 0, to go to the last column you should enter $, to quit you
@@ -163,7 +163,7 @@ ESC (\x1b).
These will make it slightly less unwieldy for those familiar with vi(m); the
rest was unchanged.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use ant.alt as you would ant above with the changes in the input keys. See
the author’s remarks for the remaining keys.
diff --git a/1991/brnstnd/README.md b/1991/brnstnd/README.md
index 531b48c37..b6dba7ac1 100644
--- a/1991/brnstnd/README.md
+++ b/1991/brnstnd/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## Try:
-```sh
+```
./try.sh
./sorta < sorta.itailrec
diff --git a/1991/brnstnd/index.html b/1991/brnstnd/index.html
index 7752f6fe8..93c82c6bd 100644
--- a/1991/brnstnd/index.html
+++ b/1991/brnstnd/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
The author wished to win the “most useful program” award and documented this in
diff --git a/1991/buzzard/README.md b/1991/buzzard/README.md
index 3a4e5bb1b..3d65edf07 100644
--- a/1991/buzzard/README.md
+++ b/1991/buzzard/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -21,7 +21,7 @@ For more detailed information see [1991 buzzard bugs](../../bugs.html#1991_buzza
## To use:
-```sh
+```
./buzzard
```
@@ -37,14 +37,14 @@ code directly so the keys are not made a `-D` at the compiler.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./buzzard.alt
```
@@ -89,7 +89,7 @@ so make sure to convert tabs to spaces before using it.
Usage:
-```sh
+```
./buzzard [filename [escape-char [start-x start-yNNN
```
diff --git a/1991/buzzard/index.html b/1991/buzzard/index.html
index edd36ac16..12a8b4bec 100644
--- a/1991/buzzard/index.html
+++ b/1991/buzzard/index.html
@@ -141,7 +141,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There is an alternate version which might feel more at home
for vi(m) users in navigation.
Bugs and (Mis)features:
@@ -149,7 +149,7 @@ for vi(m) users in navigation.
This version changes the keys f for forward, l for left and r for right by
default to k for forward, l for right and h for left, which is more
@@ -157,9 +157,9 @@ natural for those who use vi(m). Also one can just hit q followed b
quit the maze. It is problematic to reconfigure the keys except by modifying the
code directly so the keys are not made a -D at the compiler.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./buzzard.alt
+
./buzzard.alt
Judges’ remarks:
You will be A-mazed.
You are invited to try to cheat, … if you can figure out how! :-)
@@ -186,7 +186,7 @@ separate physical rows in the maze; a space indicates a corridor,
and any other character is a wall. Tabs are also considered walls,
so make sure to convert tabs to spaces before using it.
Filename is the name of the file containing the maze. This
defaults to buzzard.c or rather __FILE__.
Escape-char is the character in the maze that represents the exit.
diff --git a/1991/cdupont/README.md b/1991/cdupont/README.md
index 4851deaec..531da5248 100644
--- a/1991/cdupont/README.md
+++ b/1991/cdupont/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./cdupont
```
@@ -16,7 +16,7 @@
Why is the following label necessary?
-```c
+```
sorryfor_this_unused_but_very_needed_label:
```
diff --git a/1991/cdupont/index.html b/1991/cdupont/index.html
index 94287df76..89348b275 100644
--- a/1991/cdupont/index.html
+++ b/1991/cdupont/index.html
@@ -141,12 +141,12 @@ Location: FR - French Republic (
To build:
-
make all
+
make all
To use:
-
./cdupont
+
./cdupont
Judges’ remarks:
Why is the following label necessary?
-
sorryfor_this_unused_but_very_needed_label:
+
sorryfor_this_unused_but_very_needed_label:
Notice that if you C beautify (cb) or pre-process this program, it
will no longer work correctly, if at all. (go ahead, try it… :-))
NOTE: One should remove the final trailing newline to obtain the
diff --git a/1991/davidguy/README.md b/1991/davidguy/README.md
index a98707dac..f206f507c 100644
--- a/1991/davidguy/README.md
+++ b/1991/davidguy/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./davidguy ip_address:server.screen
```
@@ -16,7 +16,7 @@ where `ip_address` in an IP address of an X server.
## Try:
-```sh
+```
./davidguy 127.0.0.1:0.0
```
@@ -24,7 +24,7 @@ Of course, you may need to supply a more reasonable address. :-)
## Also try:
-```sh
+```
cp -f davidguy guydavid
./guydavid 127.0.0.1:0.0
```
diff --git a/1991/davidguy/index.html b/1991/davidguy/index.html
index f9024da23..bf344e5ef 100644
--- a/1991/davidguy/index.html
+++ b/1991/davidguy/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./davidguy ip_address:server.screen
+
./davidguy ip_address:server.screen
where ip_address in an IP address of an X server.
Try:
-
./davidguy 127.0.0.1:0.0
+
./davidguy 127.0.0.1:0.0
Of course, you may need to supply a more reasonable address. :-)
diff --git a/1991/dds/README.md b/1991/dds/README.md
index 82d624e16..73a57d3c8 100644
--- a/1991/dds/README.md
+++ b/1991/dds/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dds basic_program
./a.out 2>/dev/null
```
@@ -17,7 +17,7 @@
The author suggests trying:
-```sh
+```
./dds LANDER.BAS
./a.out
```
@@ -27,7 +27,7 @@ produced? How does `a.c` relate to [LANDER.BAS](LANDER.BAS)?
What happens if you give the program a C program like itself? Try:
-```sh
+```
./dds dds.c
```
diff --git a/1991/dds/index.html b/1991/dds/index.html
index f1f746b79..f47062b5c 100644
--- a/1991/dds/index.html
+++ b/1991/dds/index.html
@@ -141,18 +141,18 @@ Location: GR - Hellenic Republic (
To build:
-
make all
+
make all
To use:
-
./dds basic_program
-./a.out2>/dev/null
+
./dds basic_program
+ ./a.out 2>/dev/null
Try:
The author suggests trying:
-
./dds LANDER.BAS
-./a.out
+
./dds LANDER.BAS
+ ./a.out
Notice that a file a.c has been generated. Can you tell how a.c was
produced? How does a.c relate to LANDER.BAS?
What happens if you give the program a C program like itself? Try:
-
./dds dds.c
+
./dds dds.c
You’ll get errors yes but what does the generated file look like? What about
other types of files?
Judges’ remarks:
diff --git a/1991/fine/README.md b/1991/fine/README.md
index 4df99404b..a70c6c98a 100644
--- a/1991/fine/README.md
+++ b/1991/fine/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
echo text | ./fine
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1991/fine/index.html b/1991/fine/index.html
index 866869bd3..91a6221f2 100644
--- a/1991/fine/index.html
+++ b/1991/fine/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
would deny awards to more deserving entries. These categories have not
been eliminated, and will likely be considered in future years.
A number of entries made use of the following C pre-processor feature:
-
#define X define
-#X foo bar
+
#define X define
+ #X foo bar
This is not permitted under ANSI C. Some ANSI C compilers do allow this. In
the future, we do not want programs to use this feature. Because this request
was not stated in the 1991 rules, we did not reject entries of this
diff --git a/1991/rince/README.md b/1991/rince/README.md
index dcd8535c9..f315d8e7a 100644
--- a/1991/rince/README.md
+++ b/1991/rince/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@ that's fewer than the original program.
## To use:
-```sh
+```
./rince
```
@@ -30,7 +30,7 @@ The author set the maximum number of moves to 484.
### Alternate build:
-```sh
+```
make alt
```
@@ -41,7 +41,7 @@ configurable maximum number of moves allowed, defaulting to the entry's max,
To reconfigure the maximum number of moves to 700:
-```sh
+```
make clobber MAXMOVES=700 alt
```
@@ -50,13 +50,13 @@ To reconfigure the maximum number of moves to 700:
To run the first alt version:
-```sh
+```
./rince.alt
```
To run the second alt version:
-```sh
+```
./rince.alt2
```
diff --git a/1991/rince/index.html b/1991/rince/index.html
index 70be75eb9..7d3698de0 100644
--- a/1991/rince/index.html
+++ b/1991/rince/index.html
@@ -141,12 +141,12 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
There are two alternate versions which allow one to not be
restricted in movements or to change the maximum number of movements, even if
that’s fewer than the original program.
To use:
-
./rince
+
./rince
Alternate code:
The first alternate version, rince.alt.c, disables a maximum move
count so that anyone with enough patience and time can complete the puzzle,
@@ -156,18 +156,18 @@ reconfigure at compilation the maximum number of moves, even if that is lowering
the count.
The author set the maximum number of moves to 484.
Alternate build:
-
make alt
+
make alt
This will build both alt versions where the first one, rince.alt, has no
restrictions in the number of movements and the second one, rince.alt2, has a
configurable maximum number of moves allowed, defaulting to the entry’s max,
484.
To reconfigure the maximum number of moves to 700:
-
make clobber MAXMOVES=700 alt
+
make clobber MAXMOVES=700 alt
Alternate use:
To run the first alt version:
-
./rince.alt
+
./rince.alt
To run the second alt version:
-
./rince.alt2
+
./rince.alt2
Can you figure out how to make the two alternate versions equivalent in
functionality without modifying the code? That is can you make the second alt
version end up allowing any number of movements?
diff --git a/1991/westley/README.md b/1991/westley/README.md
index 59a2a630c..93bce8dbe 100644
--- a/1991/westley/README.md
+++ b/1991/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -27,7 +27,7 @@ for the interested. See the [try](#try) section if you just want to play.
Make and then run as follows:
-```sh
+```
./westley [move_location] | tee nextmove.c
```
@@ -43,7 +43,7 @@ a move on a tic-tac-toe board:
If you omit `move_location`, then the computer moves first. For your
next move, recompile `nextmove.c` and play it again:
-```sh
+```
make nextmove
./nextmove move_location | tee nextmove.c
```
@@ -54,7 +54,7 @@ next move, recompile `nextmove.c` and play it again:
We have provided the shell script, [ttt](ttt.sh), to make it easier to play the
game:
-```sh
+```
make ttt
./ttt [first_move] # <- omit first arg to have it move first
./ttt next_move
@@ -64,14 +64,14 @@ The shell script determines when the game is over, and automatically replaces
`merlyn.c` (copied from [westley.c](westley.c) with an improved version after a
loss). The [ttt](ttt.sh) script has two other modes:
-```sh
+```
./ttt quitgame # cancel any game in progress, revert to merlyn.c
./ttt clobber # remove all game files, revert to original source
```
For example here is a potentially losing game:
-```sh
+```
./ttt 1
./ttt 4
./ttt 6
@@ -80,7 +80,7 @@ For example here is a potentially losing game:
The final might look like:
-```c
+```
a(X){/*/X=- a(X){/*/X=-
X -1;F;X=- -1;F;X=-
-1;F;}/*/ -1;F;}/*/
@@ -123,7 +123,7 @@ can lose if you cheat. That's supposed to happen. Can you win any other time?
### Alternate build:
-```sh
+```
make alt
```
@@ -194,7 +194,7 @@ function as `a()`, `b()`, or `c()`. After each function is called, the global
variables `X` and `O` contain bitmasks of where all the `X`s and `O`s are placed.
The statement:
-```c
+```
X=- -1;
```
diff --git a/1991/westley/index.html b/1991/westley/index.html
index fa01995fd..3be92e0d9 100644
--- a/1991/westley/index.html
+++ b/1991/westley/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
NOTE: we have provided a script to perform the below procedure which we include
for the interested. See the try section if you just want to play.
Make and then run as follows:
-
./westley[move_location]|tee nextmove.c
+
./westley [move_location] | tee nextmove.c
where the move_location is a digit from 1 to 9 that represents
a move on a tic-tac-toe board:
1 2 3
@@ -160,59 +160,59 @@ a move on a tic-tac-toe board:
7 8 9
If you omit move_location, then the computer moves first. For your
next move, recompile nextmove.c and play it again:
-
make nextmove
-./nextmove move_location |tee nextmove.c
+
make nextmove
+ ./nextmove move_location | tee nextmove.c
Try:
We have provided the shell script, ttt, to make it easier to play the
game:
-
make ttt
-./ttt[first_move]# <- omit first arg to have it move first
-./ttt next_move
+
make ttt
+ ./ttt [first_move] # <- omit first arg to have it move first
+ ./ttt next_move
The shell script determines when the game is over, and automatically replaces
merlyn.c (copied from westley.c with an improved version after a
loss). The ttt script has two other modes:
-
./ttt quitgame # cancel any game in progress, revert to merlyn.c
-./ttt clobber # remove all game files, revert to original source
+
./ttt quitgame # cancel any game in progress, revert to merlyn.c
+ ./ttt clobber # remove all game files, revert to original source
Redirects stderr to /dev/null by default. If you need errors or warnings use
-e.
Alternate code:
This version is based on the author’s remarks. It is not supposed to lose but it
can lose if you cheat. That’s supposed to happen. Can you win any other time?
Alternate build:
-
make alt
+
make alt
Alternate use:
Rather than use ttt try the script ttt.alt instead.
Judges’ remarks:
@@ -259,7 +259,7 @@ longer loses games.
function as a(), b(), or c(). After each function is called, the global
variables X and O contain bitmasks of where all the Xs and Os are placed.
The statement:
-
X=-<char>-1;
+
X=- <char> -1;
evaluates to 1, -1, or -2 when X is 1 and <char> is one of "X",
"0", or " ". The function S(&X) sets the appropriate bits in (global
vars) X and O and resets the value of &X to 1. This is how the current
diff --git a/1992/adrian/README.md b/1992/adrian/README.md
index 1c88a8f4f..458e89c06 100644
--- a/1992/adrian/README.md
+++ b/1992/adrian/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -19,13 +19,13 @@ For more detailed information see [1992 adrian bugs](../../bugs.html#1992_adrian
## Try:
-```sh
+```
./try.sh
```
For the slow minded, try:
-```sh
+```
./adsleep 32767
```
@@ -134,7 +134,7 @@ character list.
With the automaton specification in `filename`, invoke the program by
typing
-```sh
+```
./adrian filename
```
@@ -151,7 +151,7 @@ occurs if your automaton has more than 257 states.
Running:
-```sh
+```
./adrian from < your_mailbox
```
@@ -169,7 +169,7 @@ the regular expression:
I suggest using `adrian.c` as input, and storing the output in `adwc.c`:
-```sh
+```
./adrian < adrian.c > adwc.c
```
@@ -181,13 +181,13 @@ in the input file.
Another possibly interesting automaton can be created by slightly
adjusting the `adrian.c` file. Change the first line to read
-```c
+```
/* . echo| . */
```
and repeat the process above
-```sh
+```
./adrian adecho.c
```
@@ -204,7 +204,7 @@ employed.
Two other adjustments to the first line also yield useful results. By
changing it to
-```c
+```
/* . head; . */
```
@@ -221,7 +221,7 @@ specified (again this was changed to `__FILE__`).
By setting the first line to
-```c
+```
/* . basename . */
```
@@ -240,7 +240,7 @@ The resulting base name is printed to stdout.
Lastly, by setting the first line to
-```c
+```
/* . sleep . */
```
diff --git a/1992/adrian/index.html b/1992/adrian/index.html
index 1f7d7b014..a1bcf6898 100644
--- a/1992/adrian/index.html
+++ b/1992/adrian/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: known bug - please help us fix
STATUS: INABIAF - please **DO NOT** fix
Once you get past the obfuscation, you have an opportunity to learn
about regular expressions and state machines.
@@ -214,7 +214,7 @@ character list.
[q5]
With the automaton specification in filename, invoke the program by
typing
-
./adrian filename
+
./adrian filename
It will read the file and print out all the lines which the automaton
accepts. If the file cannot be opened, a system error message will
be printed. If the input contains errors, then an error message along
@@ -225,7 +225,7 @@ being processed is printed. Error no_destination occurs if you spec
set of characters, but no destination state, and error too_many_states
occurs if your automaton has more than 257 states.
Running:
-
./adrian from < your_mailbox
+
./adrian from < your_mailbox
will perform a function similar to that of the unix from command.
If no filename is specified on the command line, then __FILE__ is used as the
specification for the automaton. (Originally this was "adgrep.c" but the file
@@ -234,23 +234,23 @@ changed to __FILE__.) In this case, the program will search for mat
the regular expression:
^.[^|C][^w[Q]*(Q|[w[]c).*|^.[C|]$
I suggest using adrian.c as input, and storing the output in adwc.c:
-
./adrian< adrian.c > adwc.c
+
./adrian < adrian.c > adwc.c
Compiling the new file, adwc.c, yields a clone of the unix wc command. It
runs on one file, defaulting to "adrian.c" if no file is given (again, this
was changed to be __FILE__) and displays the number of lines, words, and bytes
in the input file.
Another possibly interesting automaton can be created by slightly
adjusting the adrian.c file. Change the first line to read
-
/* . echo| . */
+
/* . echo| . */
and repeat the process above
-
./adrian<adrian.c > adecho.c
+
./adrian <adrian.c > adecho.c
The new file now contains all lines which match
^.[^5|m^]*[m^]([e=p,;]|[^e=+p,;].*)$
Compile and run. This is an echo(1) clone. Note the efficient algorithm
employed.
Two other adjustments to the first line also yield useful results. By
changing it to
-
/* . head; . */
+
/* . head; . */
you can search for matches to
^.[^W]*W..*$
By some freak happenstance, lines of adrian.c which match this regular
@@ -258,7 +258,7 @@ expression form a unix head(1) command. It prints the first ten lin
the file specified on the command line or adrian.c if no file is
specified (again this was changed to __FILE__).
By setting the first line to
-
/* . basename . */
+
/* . basename . */
a clone of the unix basename(1) command can be unearthed. The automaton will
search for
^.[^j]*jr.*$
@@ -268,7 +268,7 @@ filename, and the second, an extension. All leading pathname components
are removed from the filename, and the extension is removed if present.
The resulting base name is printed to stdout.
Lastly, by setting the first line to
-
/* . sleep . */
+
/* . sleep . */
you can search for
^.[^(~][^s]*sl.*$
Filtering adrian.c through this search yields a clone of the sleep(1)
diff --git a/1992/albert/README.md b/1992/albert/README.md
index f3cb6bbeb..035ac3196 100644
--- a/1992/albert/README.md
+++ b/1992/albert/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -21,14 +21,14 @@ For more detailed information see [1992 albert bugs](../../bugs.html#1992_albert
## To use:
-```sh
+```
./albert number
```
## Try:
-```sh
+```
./try.sh
```
@@ -64,7 +64,7 @@ The [albert.alt.c](albert.c) file is the fixed file, whereas the
To compile this alternate version:
-```sh
+```
make alt
```
@@ -76,7 +76,7 @@ Use `albert.alt` as you would `albert` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -106,7 +106,7 @@ if you want to factor Fermat's 4th number. Then just run it.
Or you may type `./albert `
A nice one is also (30 ones):
-```sh
+```
./albert 111111111111111111111111111111
```
@@ -114,7 +114,7 @@ Apart from the foregoing there are no special execution instructions.
To customize the program into a factorizer of a fixed number, use
-```sh
+```
cc albert.c -o 4294967297
```
diff --git a/1992/albert/index.html b/1992/albert/index.html
index aa7e5bc51..9f11173f6 100644
--- a/1992/albert/index.html
+++ b/1992/albert/index.html
@@ -141,16 +141,16 @@ Location: NL - Kingdom of the Netherlan
An alternate version of this entry, albert.alt.c, is provided.
Leo Broukhis, before he was an IOCCC judge, sent the IOCCC
@@ -173,11 +173,11 @@ judges this Email message:
albert.c is the file before applying Leo Broukhis’ fix.
Alternate build:
To compile this alternate version:
-
make alt
+
make alt
Alternate use:
Use albert.alt as you would albert above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
We were impressed with the speed at which it was able to factor
arbitrarily large numbers consisting of factors that fit into
@@ -194,10 +194,10 @@ multiplication, until the candidate factor no longer fits in a signed long.
if you want to factor Fermat’s 4th number. Then just run it.
Or you may type ./albert <some-number>
A nice one is also (30 ones):
-
./albert 111111111111111111111111111111
+
./albert 111111111111111111111111111111
Apart from the foregoing there are no special execution instructions.
To customize the program into a factorizer of a fixed number, use
-
cc albert.c -o 4294967297
+
cc albert.c -o 4294967297
or some such.
There are no data files used, and it is not possible to feed input
via stdin.
diff --git a/1992/ant/README.md b/1992/ant/README.md
index 63e0c3238..38e47788f 100644
--- a/1992/ant/README.md
+++ b/1992/ant/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./ant Makefile
./ant Makefile rule
@@ -18,7 +18,7 @@ where `Makefile` is a Makefile to use and `rule` is an optional rule to use.
## Try:
-```sh
+```
./try.sh
```
diff --git a/1992/ant/index.html b/1992/ant/index.html
index 51a29f2a0..55e7049ca 100644
--- a/1992/ant/index.html
+++ b/1992/ant/index.html
@@ -141,14 +141,14 @@ Location: CA - Canada
To build:
-
make all
+
make all
To use:
-
./ant Makefile
-
-./ant Makefile rule
+
./ant Makefile
+
+ ./ant Makefile rule
where Makefile is a Makefile to use and rule is an optional rule to use.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Like much of POSIX, obfuscation has its place. Your task is to
figure out where.
diff --git a/1992/buzzard.1/README.md b/1992/buzzard.1/README.md
index 0c141c346..03c59c42d 100644
--- a/1992/buzzard.1/README.md
+++ b/1992/buzzard.1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./buzzard.1 num num
```
## Try:
-```sh
+```
./try.sh
```
@@ -23,7 +23,7 @@
To see good C Preprocessor buzzard.1, try:
-```sh
+```
make babble.cppcb
cat babble.cppcb
```
@@ -54,19 +54,19 @@ short strings.
`buzzard.1` is a simple mathematical program. It expects two numeric
arguments.
-```sh
+```
./buzzard.1 0
```
will print out the factorial of ``.
-```sh
+```
./buzzard.1
```
will print out the largest common factor of `num1` and `num2`.
-```sh
+```
./buzzard.1 1
```
@@ -171,21 +171,21 @@ programs is the conditional (given that we have loops).
Since all you can do in the given operation output set is
assignment, we implement "conditional assignment":
-```c
+```
if (x) y = z;
```
To implement this, we constrain `x` to be either 0 or 1, and
simply compute:
-```c
+```
y = (z * x) + (y * (1-x));
```
This is more obscured by factoring out common terms and restricting
ourselves to two operand operations:
-```c
+```
temp = z; (temp == z)
temp -= y; (temp == z-y)
temp *= x; (temp == (z-y)*x)
@@ -199,7 +199,7 @@ Next we imagine we have a [pc](https://en.wikipedia.org/wiki/Program_counter).
we're not currently coming up on statement pc. To handle this, we simply make
every operation conditional on the pc having the correct value:
-```c
+```
if (pc == some_constant) y = z;
```
diff --git a/1992/buzzard.1/index.html b/1992/buzzard.1/index.html
index 12c033952..d207a6bbb 100644
--- a/1992/buzzard.1/index.html
+++ b/1992/buzzard.1/index.html
@@ -141,15 +141,15 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./buzzard.1 num num
+
./buzzard.1 num num
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
To see good C Preprocessor buzzard.1, try:
-
make babble.cppcb
-cat babble.cppcb
+
make babble.cppcb
+ cat babble.cppcb
Notice how many statements it takes to do anything useful?
Author’s remarks:
What you shouldn’t think about buzzard.1:
@@ -162,11 +162,11 @@ short strings.
What it does
buzzard.1 is a simple mathematical program. It expects two numeric
arguments.
-
./buzzard.1 0 <num>
+
./buzzard.1 0 <num>
will print out the factorial of <num>.
-
./buzzard.1<num1><num2>
+
./buzzard.1 <num1> <num2>
will print out the largest common factor of num1 and num2.
-
./buzzard.1 1 <num2>
+
./buzzard.1 1 <num2>
will print out a factor of num2 if it’s composite, or else
it will print a string informing you that num2 is prime.
If the first argument is less than 0, it prints out an
@@ -244,23 +244,23 @@ BCD, so it can be output by the hexadecimal output statement.
programs is the conditional (given that we have loops).
Since all you can do in the given operation output set is
assignment, we implement “conditional assignment”:
-
if(x) y = z;
+
if (x) y = z;
To implement this, we constrain x to be either 0 or 1, and
simply compute:
-
y =(z * x)+(y *(1-x));
+
y = (z * x) + (y * (1-x));
This is more obscured by factoring out common terms and restricting
ourselves to two operand operations:
Next we imagine we have a pc.
“I’m supposed to execute statement pc next”, says our emulator. But suppose
we’re not currently coming up on statement pc. To handle this, we simply make
every operation conditional on the pc having the correct value:
-
if(pc == some_constant) y = z;
+
if (pc == some_constant) y = z;
To combine this with other operations, we simply multiply by our
(pc == some_constant) flag right after the above temp *= x.
To evaluate pc == some_constant requires one more trick. We assume that
diff --git a/1992/buzzard.2/README.md b/1992/buzzard.2/README.md
index e0bf9e803..50a722c48 100644
--- a/1992/buzzard.2/README.md
+++ b/1992/buzzard.2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -13,13 +13,13 @@ code](#alternate-code) below for details.
First, you must make sure that `first` is made first (even though `make all`
should make first first :-) ):
-```sh
+```
make first
```
Second:
-```sh
+```
# get help:
echo help | cat third help.th - | ./first
@@ -29,7 +29,7 @@ Second:
Third:
-```sh
+```
cat third help.th - | ./first
```
@@ -50,7 +50,7 @@ Fourth:
## Try:
-```sh
+```
./try.sh
```
@@ -63,7 +63,7 @@ fix that the author notes in their remarks.
### Alternate build:
-```sh
+```
make alt
```
@@ -75,7 +75,7 @@ Use `buzzard.2.alt` as you would `buzzard.2` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -125,7 +125,7 @@ Do not expect to be able to do anything interesting with `first`.
To do something interesting, you need to feed `first` the file
[third](third) first. In unix, you can do
-```sh
+```
cat third help.th - | ./first
```
@@ -226,7 +226,7 @@ When you get the `Ok.` message from `third`, try out some sample
you in a normal way. It only prints `'Ok.'` after you define a word).
-```sh
+```
2 3 + . cr
```
diff --git a/1992/buzzard.2/index.html b/1992/buzzard.2/index.html
index a655e58b9..8d7df6ac0 100644
--- a/1992/buzzard.2/index.html
+++ b/1992/buzzard.2/index.html
@@ -141,37 +141,37 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There is an alternate version of this program. See Alternate
code below for details.
To use:
First, you must make sure that first is made first (even though make all
should make first first :-) ):
-
make first
+
make first
Second:
-
# get help:
-echo help |cat third help.th -|./first
-
-# try out a demo:
-cat third demo5.th |./first
+
# get help:
+ echo help | cat third help.th - | ./first
+
+ # try out a demo:
+ cat third demo5.th | ./first
Third:
-
cat third help.th -|./first
+
cat third help.th - | ./first
NOTE: Wait until ‘Ok’ is printed and the type:
2 3 + . cr
Yes you should really type the 2 letters: cr.
Fourth:
Sorry, this is third!
Try:
-
./try.sh
+
./try.sh
Alternate code:
This alternate version, buzzard.2.alt.c, does not contain a
fix that the author notes in their remarks.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use buzzard.2.alt as you would buzzard.2 above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Have fun!
Author’s remarks:
@@ -204,7 +204,7 @@ included, but it only works on ASCII systems.
Do not expect to be able to do anything interesting with first.
To do something interesting, you need to feed first the file
third first. In unix, you can do
-
cat third help.th -|./first
+
cat third help.th - | ./first
to do this. Hopefully most operating systems will provide a way to do this. It
may take some time for this to complete (I seem to remember it taking several
minutes on an 8086 PC); THIRD will prompt you when it is finished. The file
@@ -283,7 +283,7 @@ take a significant amount of time in THIRD.
FORTH code
(first has no way of knowing if keyboard input is waiting, so it can’t actually prompt
you in a normal way. It only prints 'Ok.' after you define a word).
-
2 3 + . cr
+
2 3 + . cr
(which adds 2 and 3, and print the result and a newline.)
THIRD responds:
5
diff --git a/1992/gson/README.md b/1992/gson/README.md
index 739147fb4..8f400bd4e 100644
--- a/1992/gson/README.md
+++ b/1992/gson/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -21,14 +21,14 @@ For more detailed information see [1992 gson bugs](../../bugs.html#1992_gson).
## To use:
-```sh
+```
./ag word word2 word3 < /path/to/dictionary
```
## Try:
-```sh
+```
./try.sh
```
@@ -45,7 +45,7 @@ following locations though the last one is more ironic:
Then using the proper dictionary file it does:
-```sh
+```
./ag free software foundation < /usr/share/dict/words
./ag obfuscated c contest < /usr/share/dict/words
./ag unix international < /usr/share/dict/words
@@ -73,7 +73,7 @@ weren't allowed to print!
The author provided an obfuscated script that can be used to construct
dictionaries which has been put in as [mkdict.sh](mkdict.sh). To use try:
-```sh
+```
cat README.md | ./mkdict.sh > words
```
@@ -103,7 +103,7 @@ have one already, you can make your own dictionary by concatenating a few
hundred of your favourite Usenet articles and piping them through the following
obfuscated shell script:
-```sh
+```
#!/bin/sh
z=a-z];tr [A-Z\] \[$z|sed s/[\^$z[\^$z*/_/g|tr _ \\012|grep ..|sort -u
```
@@ -258,7 +258,7 @@ those bits that should remain zero. For example, the following
program prints all those 16-bit integers that contain zeroes in all
even bit positions:
-```c
+```
main(){int i=0,s=0xAAAA;do{printf("%04x\t",i);}while(i=((i|~s)+1)&s);}
```
diff --git a/1992/gson/index.html b/1992/gson/index.html
index e08e32a8e..fea6c379f 100644
--- a/1992/gson/index.html
+++ b/1992/gson/index.html
@@ -141,7 +141,7 @@ Location: FI - Republic of Finland
To build:
-
make all
+
make all
NOTE: we DISABLE the optimiser because having it enabled causes some invocations
to crash in some systems.
Bugs and (Mis)features:
@@ -149,9 +149,9 @@ to crash in some systems.
STATUS: uses gets() - change to fgets() if possible
This script will determine (or try and determine) where your system dictionary
is located and assuming that it can find one it’ll use that. It checks the
following locations though the last one is more ironic:
@@ -160,13 +160,13 @@ following locations though the last one is more ironic:
/usr/ucblib/dict/words
/dev/null # <-- for machines with nothing to say
Then using the proper dictionary file it does:
-
./ag free software foundation < /usr/share/dict/words
-./ag obfuscated c contest < /usr/share/dict/words
-./ag unix international < /usr/share/dict/words
-./ag george bush < /usr/share/dict/words
-./ag bill clinton < /usr/share/dict/words
-./ag ross perot < /usr/share/dict/words
-./ag paul e tsongas < /usr/share/dict/words
+
./ag free software foundation < /usr/share/dict/words
+ ./ag obfuscated c contest < /usr/share/dict/words
+ ./ag unix international < /usr/share/dict/words
+ ./ag george bush < /usr/share/dict/words
+ ./ag bill clinton < /usr/share/dict/words
+ ./ag ross perot < /usr/share/dict/words
+ ./ag paul e tsongas < /usr/share/dict/words
where /usr/share/dict/words is the dictionary file.
Then it uses the mkdict.sh script to create a dictionary file out
of the files README.md, try.sh (itself) and
@@ -179,7 +179,7 @@ names listed above. Run this program to find the anagrams they
weren’t allowed to print!
The author provided an obfuscated script that can be used to construct
dictionaries which has been put in as mkdict.sh. To use try:
-
cat README.md |./mkdict.sh> words
+
cat README.md | ./mkdict.sh > words
Then try using the program as shown above with the file words.
Author’s remarks:
The name of the game:
@@ -195,8 +195,8 @@ natural language of your choice, one word on each line. If your machine doesn’
have one already, you can make your own dictionary by concatenating a few
hundred of your favourite Usenet articles and piping them through the following
obfuscated shell script:
-
Using articles from alt.folklore.computers is likely to make
a more professional-looking dictionary than rec.arts.erotica.
AG must be run with the dictionary file as standard input.
@@ -323,7 +323,7 @@ the carries generated in incrementing i propagate straight across
those bits that should remain zero. For example, the following
program prints all those 16-bit integers that contain zeroes in all
even bit positions:
-
AG uses a similar method but works in the opposite direction, finding
the next lower value with zeroes in given bit positions by propagating
borrows across those bits. Some additional adjustments are made
diff --git a/1992/imc/README.md b/1992/imc/README.md
index 22c1e17fb..c30322335 100644
--- a/1992/imc/README.md
+++ b/1992/imc/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
# text mode
./imc -text
@@ -19,7 +19,7 @@
To see a number of options and configurations:
-```sh
+```
./try.sh
```
@@ -164,7 +164,7 @@ standard error to indicate its progress (one dot per pixel line).
Here are a couple of good pictures to draw:
-```sh
+```
./imc -s 512,512 -f 600000 -l 512 -m 16 -c.00805,.74274 > screen1.ras
./imc -s512,512 -j-.523,-.535 > screen2.ras
```
diff --git a/1992/imc/index.html b/1992/imc/index.html
index 67ebe9137..5ef4e9435 100644
--- a/1992/imc/index.html
+++ b/1992/imc/index.html
@@ -141,15 +141,15 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
To use:
-
# text mode
-./imc-text
-
-./imc
+
# text mode
+ ./imc -text
+
+ ./imc
Try:
To see a number of options and configurations:
-
./try.sh
+
./try.sh
Judges’ remarks:
The program is more interesting to run on workstations that can make use of a
Sun raster file. Others can make use of the -text flag for character oriented
@@ -263,8 +263,8 @@ bits (e.g. 8).
standard error to indicate its progress (one dot per pixel line).
make alt
```
@@ -24,7 +24,7 @@ For more detailed information see [1992 kivinen bugs](../../bugs.html#1992_kivin
## To use:
-```sh
+```
./kivinen.alt
./kivinen.alt a
@@ -41,7 +41,7 @@ Also try changing the speed that the game moves. For instance if you wish to
change the `usleep(3)` value to `30000` from `20000`, try:
-```sh
+```
make clobber SLEEP=30000 alt # make it slower
make clobber SLEEP=10000 alt # make it faster
@@ -59,7 +59,7 @@ code.
### Original build:
-```sh
+```
make all
```
diff --git a/1992/kivinen/index.html b/1992/kivinen/index.html
index 5526b2e9e..f91fe832d 100644
--- a/1992/kivinen/index.html
+++ b/1992/kivinen/index.html
@@ -142,7 +142,7 @@ Location: FI - Republic of Finland To build:
If your machine support the X Window System, Version 11:
-
make alt
+
make alt
We recommend that you try the alt version first so you can get a better idea of
what this looked like back in 1992. See original code for the
original should you wish to see what we mean.
@@ -151,25 +151,25 @@ original should you wish to see what we mean.
./kivinen.alt
-
-./kivinen.alt a
-
-./kivinen.alt a b
+
./kivinen.alt
+
+ ./kivinen.alt a
+
+ ./kivinen.alt a b
See also the author’s remarks for other variations.
Try:
Also try changing the speed that the game moves. For instance if you wish to
change the usleep(3) value to 30000 from 20000, try:
-
make clobber SLEEP=30000 alt # make it slower
-
-make clobber SLEEP=10000 alt # make it faster
+
make clobber SLEEP=30000 alt # make it slower
+
+ make clobber SLEEP=10000 alt # make it faster
Then use the same syntax as above and described by the author.
Original code:
As noted above, the alt version is recommended because the code goes too fast in
modern systems. If you wish to see the original you may do so with the original
code.
Original build:
-
make all
+
make all
Original use:
Use kivinen as you would kivinen.alt.
Judges’ remarks:
diff --git a/1992/lush/README.md b/1992/lush/README.md
index 1a6ec7774..cb10e36c2 100644
--- a/1992/lush/README.md
+++ b/1992/lush/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1992 lush bugs](../../bugs.html#1992_lush).
## To use:
-```sh
+```
./lush.sh
```
diff --git a/1992/lush/index.html b/1992/lush/index.html
index 2f4af753b..d55bdc8e3 100644
--- a/1992/lush/index.html
+++ b/1992/lush/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: doesn't work with some compilers - please provide alternative code or fix for more compilers
The program uses error messages issued by the C Preprocessor to
generate its message to the world. One program’s error is another
diff --git a/1992/marangon/README.md b/1992/marangon/README.md
index 838912d95..883441bcf 100644
--- a/1992/marangon/README.md
+++ b/1992/marangon/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./marangon
```
diff --git a/1992/marangon/index.html b/1992/marangon/index.html
index dfb19efae..18e31bc4a 100644
--- a/1992/marangon/index.html
+++ b/1992/marangon/index.html
@@ -141,9 +141,9 @@ Location: IT - Italian Republic (<
To build:
-
make all
+
make all
To use:
-
./marangon
+
./marangon
Judges’ remarks:
The object is to refill the table with 5’s, by incrementing or decrementing
numbers as needed. It is the side effects that get you into trouble. If you
diff --git a/1992/nathan/README.md b/1992/nathan/README.md
index 446e47e55..0cf51e6a2 100644
--- a/1992/nathan/README.md
+++ b/1992/nathan/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./nathan
# enter some text
```
@@ -17,7 +17,7 @@
To see some other fun uses:
-```sh
+```
./try.sh
```
@@ -58,7 +58,7 @@ distribute some winning entries outside of the US.
Nathan Sidwell stated that he was willing to distribute the winning source. To
read HIS instructions of how to obtain his winning program one was able to run:
-```sh
+```
make nathan
./nathan
```
diff --git a/1992/nathan/index.html b/1992/nathan/index.html
index 0eb81e94a..c8e03cbe9 100644
--- a/1992/nathan/index.html
+++ b/1992/nathan/index.html
@@ -141,13 +141,13 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
To use:
-
./nathan
-# enter some text
+
./nathan
+ # enter some text
Try:
To see some other fun uses:
-
./try.sh
+
./try.sh
Judges’ remarks:
WARNING:
The judges make no claim as to the strength or security
@@ -173,8 +173,8 @@ fall under this restricted category, the judges originally were not able to
distribute some winning entries outside of the US.
Nathan Sidwell stated that he was willing to distribute the winning source. To
read HIS instructions of how to obtain his winning program one was able to run:
-
make nathan
-./nathan
+
make nathan
+ ./nathan
to learn how to get a copy of the code.
See the 1992/nathan.c file in the
archive/historic/archive-1992.tar.bz2
diff --git a/1992/vern/README.md b/1992/vern/README.md
index dc8b0b821..77e4eabd4 100644
--- a/1992/vern/README.md
+++ b/1992/vern/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1992 vern bugs](../../bugs.html#1992_vern).
## To use:
-```sh
+```
./vern 3 # <-- default is 2
```
@@ -42,7 +42,7 @@ suggested above. :-)
For a real quick game try:
-```sh
+```
./vern
65 55
@@ -124,7 +124,7 @@ wouldn't pass the character limit. A nice side effect is that the
initial source is gloriously difficult to peruse. In particular, the Makefile
does:
-```sh
+```
sed vern.tmp.c
```
diff --git a/1992/vern/index.html b/1992/vern/index.html
index c5572cfcc..7cf972984 100644
--- a/1992/vern/index.html
+++ b/1992/vern/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
You might start off by giving the following input:
63 43
@@ -158,10 +158,10 @@ Location: US - United States of America
The judges assume no responsibility for the obfuscated opening
suggested above. :-)
For a real quick game try:
-
./vern
-
-65 55
-66 46
+
./vern
+
+ 65 55
+ 66 46
NOTE: Move values must be restricted to the range 00 to 77.
NOTE: Because some mailers have problems with the original winning source,
a slightly modified version with shorter lines has been provided.
@@ -225,8 +225,8 @@ at build time into much-needed text. Without this hack the program
wouldn’t pass the character limit. A nice side effect is that the
initial source is gloriously difficult to peruse. In particular, the Makefile
does:
sed <vern.c 's/{ /(/g;s/} /)/g;s/; /#define /' | \
+ sed 's/} /=/g;s/{ /i/g' >vern.tmp.c
and compiles vern.tmp.c.
Second, the rather ho-hum step has been taking of naming each variable
with a one or two letter identifier to render it meaningless (and save
diff --git a/1992/westley/README.md b/1992/westley/README.md
index efda4b11d..2cd0f342e 100644
--- a/1992/westley/README.md
+++ b/1992/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -22,7 +22,7 @@ For more detailed information see [1992 westley bugs](../../bugs.html#1992_westl
If lost:
-```sh
+```
./whereami.sh lat long
```
@@ -36,7 +36,7 @@ should just use the `westley` and `westley.alt` programs directly.
## Try:
-```sh
+```
./try.sh
```
@@ -48,14 +48,14 @@ The author provided a version for the US which we added. To build:
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./whereami.alt.sh lat long
```
@@ -67,7 +67,7 @@ NOTE: this alternative version also needs a terminal with at least 80 columns.
The [try.sh](try.sh) script uses both the original entry and the alternate code
so one can try the same script for both:
-```sh
+```
./try.sh
```
@@ -76,7 +76,7 @@ so one can try the same script for both:
To find the approximate place where this entry was judged, type:
-```sh
+```
./whereami 37 -122 # NOTE: - means west of meridian
# or if you don't have curses installed:
@@ -164,7 +164,7 @@ is reasonably accurate.
For a domestic (US) version with higher resolution, try:
-```c
+```
main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;
n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"
[l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}
@@ -173,7 +173,7 @@ For a domestic (US) version with higher resolution, try:
The code will test the 80-column wrap and document itself if it is
joined together as one 160-character line and listed. You should see:
-```c
+```
main(l,a,n,d)...
[A M E R I C A]...
```
diff --git a/1992/westley/index.html b/1992/westley/index.html
index 66a9b2e32..09f647601 100644
--- a/1992/westley/index.html
+++ b/1992/westley/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: INABIAF - please **DO NOT** fix
@@ -149,31 +149,31 @@ Location: US - United States of America
Where lat and long correspond to your latitude and longitude.
NOTE: you MUST have a terminal that is at least 80 columns for this to show
properly. The whereami and whereami.alt code checks this but it is not
prohibitive if it cannot be compiled and linked (it uses curses); instead one
should just use the westley and westley.alt programs directly.
Try:
-
./try.sh
+
./try.sh
Alternate code:
The author provided a version for the US which we added. To build:
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./whereami.alt.sh lat long
+
./whereami.alt.sh lat long
NOTE: this alternative version also needs a terminal with at least 80 columns.
Alternate try:
The try.sh script uses both the original entry and the alternate code
so one can try the same script for both:
-
./try.sh
+
./try.sh
Judges’ remarks:
To find the approximate place where this entry was judged, type:
-
./whereami 37 -122# NOTE: - means west of meridian
-
-# or if you don't have curses installed:
-./westley 37 -122# NOTE: - means west of meridian
+
./whereami 37 -122 # NOTE: - means west of meridian
+
+ # or if you don't have curses installed:
+ ./westley 37 -122 # NOTE: - means west of meridian
Author’s remarks:
Run the program with your latitude & longitude as integer
arguments; it will produce a map made up of '!' with the given
@@ -243,13 +243,13 @@ is reasonably accurate.
Tokyo 36 140
For a domestic (US) version with higher resolution, try:
-
main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;
- n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"
-[l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}
+
main(l,a,n,d)char**a;{for(d=atoi(a[1])/2*80-atoi(a[2])-2043;
+ n="bnaBCOCXdBBHGYdAP[A M E R I C A].AqandkmavX|ELC}BOCd"
+ [l++-3];)for(;n-->64;)putchar(!d+++33^l&1);}
The code will test the 80-column wrap and document itself if it is
joined together as one 160-character line and listed. You should see:
-
main(l,a,n,d)...
-[A M E R I C A]...
+
main(l,a,n,d)...
+ [A M E R I C A]...
…going down the left edge if your terminal auto-wraps at 80 characters.
make all
```
@@ -18,14 +18,14 @@ For more detailed information see [1993 ant bugs](../../bugs.html#1993_ant).
## To use:
-```sh
+```
./ant 'ERE' [file ...]
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1993/ant/index.html b/1993/ant/index.html
index 9d5d04a66..7c3267373 100644
--- a/1993/ant/index.html
+++ b/1993/ant/index.html
@@ -141,15 +141,15 @@ Location: CA - Canada
See the author’s POSIX P1003.2-like documentation file ant.txt for
more information.
diff --git a/1993/cmills/README.md b/1993/cmills/README.md
index 3772c4e9c..7cbd1b02b 100644
--- a/1993/cmills/README.md
+++ b/1993/cmills/README.md
@@ -4,7 +4,7 @@ We recommend you try the alt version first so you can get a better idea of what
this entry was like back in 1993. See the [original code](#original-code)
section below to run the original.
-```sh
+```
make alt
```
@@ -16,7 +16,7 @@ requires X11?](../../faq.html#X11macos).
To configure how many microseconds to sleep before updates try:
-```sh
+```
make clobber SLEEP=200 alt
```
@@ -34,7 +34,7 @@ For more detailed information see [1993 cmills bugs](../../bugs.html#1993_cmills
## To use:
-```sh
+```
DISPLAY="your_X_server_display"
export DISPLAY
./cmills.alt [speed] # must be run on an X11 server
@@ -56,7 +56,7 @@ on but you can use the original without any delays if you wish.
### Original build:
-```sh
+```
make all
```
diff --git a/1993/cmills/index.html b/1993/cmills/index.html
index af19d1b30..350bc84d6 100644
--- a/1993/cmills/index.html
+++ b/1993/cmills/index.html
@@ -144,21 +144,21 @@ Location: US - United States of America
We recommend you try the alt version first so you can get a better idea of what
this entry was like back in 1993. See the original code
section below to run the original.
datafile is the initial pattern (default: dgibson.data1)
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
We have provided the shell script dgibson.sh to make it easier
to run this entry. Run this shell script several times to
diff --git a/1993/ejb/README.md b/1993/ejb/README.md
index dc1a48a9d..0a1f272f6 100644
--- a/1993/ejb/README.md
+++ b/1993/ejb/README.md
@@ -1,26 +1,26 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./ejb level
```
where:
-```sh
+```
level a value from -128 to 127
```
## Try:
-```sh
+```
./try.sh
```
@@ -45,7 +45,7 @@ We note that this also works under macOS just fine.
#### Output solution to Towers of Hanoi for five rings:
-```sh
+```
./ejb 5
```
@@ -54,7 +54,7 @@ text description of how to solve the puzzle.
#### Output solution to the Patience puzzle for six rings:
-```sh
+```
./ejb -6
```
diff --git a/1993/ejb/index.html b/1993/ejb/index.html
index 8a38327cf..7630150cc 100644
--- a/1993/ejb/index.html
+++ b/1993/ejb/index.html
@@ -141,13 +141,13 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./ejb level
+
./ejb level
where:
-
level a value from -128 to 127
+
level a value from -128 to 127
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
A negative argument plays the patience puzzle. An argument
greater than 0 plays the Tower of Hanoi puzzle. In either case
@@ -160,11 +160,11 @@ the argument 127 to this program and want to see it finish!
Author’s remarks:
What this program does
Output solution to Towers of Hanoi for five rings:
-
./ejb 5
+
./ejb 5
The format of the output for the Towers of Hanoi case is simply a
text description of how to solve the puzzle.
Output solution to the Patience puzzle for six rings:
-
./ejb-6
+
./ejb -6
For the patience puzzle, the output is a sequence binary codes representing
successive states of the puzzle. The rightmost digit represents the first ring.
A 1 means the ring is on the U; a 0 means it is off the U. The program
diff --git a/1993/jonth/README.md b/1993/jonth/README.md
index 2537681cc..62ffed00e 100644
--- a/1993/jonth/README.md
+++ b/1993/jonth/README.md
@@ -5,14 +5,14 @@ compile. macOS users running Mountain Lion and later will need to download and
install [XQuartz](https://www.xquartz.org) in order to compile and run this
entry.
-```sh
+```
make all
```
## To use:
-```sh
+```
./jonth # must be run on an X11 server
```
diff --git a/1993/jonth/index.html b/1993/jonth/index.html
index 8f7be10a1..f92f627fd 100644
--- a/1993/jonth/index.html
+++ b/1993/jonth/index.html
@@ -145,9 +145,9 @@ Location: NO - Kingdom of Norway (
compile. macOS users running Mountain Lion and later will need to download and
install XQuartz in order to compile and run this
entry.
-
make all
+
make all
To use:
-
./jonth# must be run on an X11 server
+
./jonth # must be run on an X11 server
Judges’ remarks:
Use h and l to shift objects left or right. Use k to
rotate and press SPACE to drop.
diff --git a/1993/leo/README.md b/1993/leo/README.md
index c16564900..df9439aa9 100644
--- a/1993/leo/README.md
+++ b/1993/leo/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -9,13 +9,13 @@
To have the computer guess:
-```sh
+```
./leo [colors]
```
To guess the computer's number:
-```sh
+```
./mind [colors]
```
diff --git a/1993/leo/index.html b/1993/leo/index.html
index c18fa4724..46c3a38f1 100644
--- a/1993/leo/index.html
+++ b/1993/leo/index.html
@@ -141,12 +141,12 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
To have the computer guess:
-
./leo[colors]
+
./leo [colors]
To guess the computer’s number:
-
./mind[colors]
+
./mind [colors]
where:
[colors] is the number of possible colors (1 to 15) (default: 6)
Judges’ remarks:
diff --git a/1993/lmfjyh/README.md b/1993/lmfjyh/README.md
index 1582f5346..127aa6f33 100644
--- a/1993/lmfjyh/README.md
+++ b/1993/lmfjyh/README.md
@@ -2,7 +2,7 @@
If you have gcc < 2.3.3 you can build this entry like:
-```sh
+```
make all
```
@@ -48,7 +48,7 @@ For more detailed information see [1993 lmfjyh bugs](../../bugs.html#1993_lmfjyh
If you have gcc < 2.3.3 (i.e. the entry can compile):
-```sh
+```
./lmfjyh
```
@@ -64,7 +64,7 @@ Nonetheless it will be compiled in case the original entry fails to compile.
Should you wish to build this version manually:
-```sh
+```
make alt
```
@@ -99,7 +99,7 @@ that should be familiar to all C-programmers.
#### Listing 1: A simple "Hello World" program
-```c
+```
main()
{
puts("Hello World!");
@@ -118,14 +118,14 @@ the file.
#### Listing 2: Compressed "Hello world"
-```c
+```
char*_=__FILE__;
```
#### Listing 3: Code embedded in the file name
-```c
+```
";main(){puts("Hello World!");}char*C=".c
```
diff --git a/1993/lmfjyh/index.html b/1993/lmfjyh/index.html
index 1627064a6..d87abf463 100644
--- a/1993/lmfjyh/index.html
+++ b/1993/lmfjyh/index.html
@@ -142,7 +142,7 @@ Location: FI - Republic of Finland To build:
If you have gcc < 2.3.3 you can build this entry like:
-
make all
+
make all
This will try to create a file whose actual filename is literally:
";main(){puts("Hello World!");}char*C=".c
When that file is compiled, it will greet the world in the
@@ -166,14 +166,14 @@ section below for more details.
If you have gcc < 2.3.3 (i.e. the entry can compile):
-
./lmfjyh
+
./lmfjyh
Alternate code:
This version does what the code did but in a way that will work with modern
compilers. We’d like to say there’s something special about it but there isn’t.
Nonetheless it will be compiled in case the original entry fails to compile.
Alternate build:
Should you wish to build this version manually:
-
make alt
+
make alt
Alternate use:
Use lmfjyh.alt as you would lmfjyh above. Note that other code could also be
done with the bug that the entry abuses but that would have to be manually
@@ -189,10 +189,10 @@ best with C-source code.
As an example, I have taken a simple “Hello world!” program
that should be familiar to all C-programmers.
Listing 1: A simple “Hello World” program
-
main()
-{
- puts("Hello World!");
-}
+
main()
+ {
+ puts("Hello World!");
+ }
Packing method
Normally a file name is used only to identify the file, but this new
revolutionary method introduces a totally new concept: THE FILE NAME IS THE
@@ -200,9 +200,9 @@ PROGRAM. There is no need to waste valuable disk space to store source
The program is embedded in the file name, only a minor portion of it is inside
the file.
Listing 2: Compressed “Hello world”
-
char*_=__FILE__;
+
char*_=__FILE__;
Listing 3: Code embedded in the file name
-
";main(){puts("Hello World!");}char*C=".c
+
";main(){puts("Hello World!");}char*C=".c
The sample program in listing 1 is 36 bytes long. By using the new
compression method, the example program may be squeezed to sixteen
bytes. In the example the compression ratio is 2:1. It is evident
diff --git a/1993/plummer/README.md b/1993/plummer/README.md
index af15d25ee..ba076c352 100644
--- a/1993/plummer/README.md
+++ b/1993/plummer/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -12,21 +12,21 @@ code](#original-code) below.
If you wish to speed the entry up, say to 500 microseconds between writes, try:
-```sh
+```
make clobber SLEEP=500 alt
```
Alternatively if you wish to slow it down, say to 1500 microseconds between
writes, try:
-```sh
+```
make clobber SLEEP=1500 alt
```
## To use:
-```sh
+```
./plummer.alt number arg
```
@@ -42,7 +42,7 @@ bypass](https://hitchhikers.fandom.com/wiki/Bypass).
## Try:
-```sh
+```
./try.alt.sh
./try.alt.sh 21701
@@ -70,7 +70,7 @@ course).
### Original build:
-```sh
+```
make all
```
@@ -82,7 +82,7 @@ Use `plummer` as you would `plummer.alt` above.
### Original try:
-```sh
+```
./try.sh
./try.sh 21701
diff --git a/1993/plummer/index.html b/1993/plummer/index.html
index 5bec962f0..f569432b8 100644
--- a/1993/plummer/index.html
+++ b/1993/plummer/index.html
@@ -141,19 +141,19 @@ Location: ZZ - Unknown location
To build:
-
make alt
+
make alt
We recommend that you try the alternate version first to get a better idea of
what this entry looked like back in 1993. The alternate version sleeps (via
usleep(3)) in between writes, defaulting at 1000 microseconds (but
reconfigurable). If you wish to see the original entry then see original
code below.
If you wish to speed the entry up, say to 500 microseconds between writes, try:
-
make clobber SLEEP=500 alt
+
make clobber SLEEP=500 alt
Alternatively if you wish to slow it down, say to 1500 microseconds between
writes, try:
This version, the original, does not sleep in between writes, and is thus much
faster (depending on the SLEEP parameter specified in the build of alt, of
course).
For extra credit: What happens when ‘number’ contains non-numeric
characters, and why?
diff --git a/1993/rince/README.md b/1993/rince/README.md
index d339f141e..2b51f33c6 100644
--- a/1993/rince/README.md
+++ b/1993/rince/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -22,7 +22,7 @@ For more detailed information see [bugs report with 1993/rince](../../bugs.html#
## To use:
-```sh
+```
./rince [cabbage]
```
@@ -37,13 +37,13 @@ Some people may want to slow down the game by increasing the
value 17 in the lines:
-```c
+```
struct timeval v= {0,1<<17} ;
```
and
-```c
+```
refresh(),c=select(k,&y,0,0,(v.tv_usec=1<<17,&v))?getch():0;
```
@@ -57,7 +57,7 @@ changed).
### Alternate build:
-```sh
+```
make SLEEP=18 clobber alt
```
@@ -107,7 +107,7 @@ with the curses library (typically `/lib/libcurses.a` for static libraries)
used. It has been suggested that the following gcc command may help:
-```sh
+```
gcc -fno-builtin -I/usr/include -o rince rince.c -lcurses -ltermcap
```
diff --git a/1993/rince/index.html b/1993/rince/index.html
index e6df5b651..87eaf2d76 100644
--- a/1993/rince/index.html
+++ b/1993/rince/index.html
@@ -141,7 +141,7 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
NOTE: there are two alternate versions of this program, both allowing one to
slow down the game and the second one with movements more familiar to vi users.
See the Alternate code section below.
@@ -150,22 +150,22 @@ See the Alternate code section below.
to another value like 18 or 19 which you can do with the alternate code.
In the case of rince.alt2.c the movement keys for the default
game are slightly different and will feel more familiar to vi users: h for
left, l for right (that was not changed) and k for fire (that was also not
changed).
Alternate build:
-
make SLEEP=18 clobber alt
+
make SLEEP=18 clobber alt
Replace 18 with whatever number you wish.
Alternate use:
Use rince.alt or rince.alt2 as you would rince above.
@@ -194,7 +194,7 @@ with it.
/usr/local/include/curses.h if not /usr/include/curses.h) is not compatible
with the curses library (typically /lib/libcurses.a for static libraries)
used. It has been suggested that the following gcc command may help:
-
This is a Cellular Automata Based, Beautifully Abysmal Game Environment (or
CABBAGE for short). To execute the program simply type ./rince gamefile,
diff --git a/1993/schnitzi/README.md b/1993/schnitzi/README.md
index 1f867a41e..630f5978b 100644
--- a/1993/schnitzi/README.md
+++ b/1993/schnitzi/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1993 schnitzi bugs](../../bugs.html#1993_schn
## To use:
-```sh
+```
./schnitzi file
```
@@ -33,14 +33,14 @@ in [1993 schnitzi bugs](../../bugs.html#1993_schnitzi).
## Try:
-```sh
+```
./schnitzi schnitzi.info
# ask some questions suggested by the author, noted below
```
We also suggest you ask the program the following questions:
-```sh
+```
Who is Mark Schnitzus?
Who was Jack the Ripper ?
@@ -51,7 +51,7 @@ intentional spelling error there.
Try feeding the program source to the program and ask both:
-```sh
+```
What is cat ?
What is cat?
```
diff --git a/1993/schnitzi/index.html b/1993/schnitzi/index.html
index 9a77fc975..a25e6b260 100644
--- a/1993/schnitzi/index.html
+++ b/1993/schnitzi/index.html
@@ -141,29 +141,29 @@ Location: ZZ - Unknown location
Certain input will cause the program to fail as described
in 1993 schnitzi bugs.
Try:
-
./schnitzi schnitzi.info
-# ask some questions suggested by the author, noted below
+
./schnitzi schnitzi.info
+ # ask some questions suggested by the author, noted below
We also suggest you ask the program the following questions:
-
Who is Mark Schnitzus?
-
-Who was Jack the Ripper ?
+
Who is Mark Schnitzus?
+
+ Who was Jack the Ripper ?
Notice how it still manages to answer the first question despite there being an
intentional spelling error there.
Try feeding the program source to the program and ask both:
-
What is cat ?
-What is cat?
+
What is cat ?
+ What is cat?
What happens if you ask it other questions with and without a space before the
??
Judges’ remarks:
diff --git a/1993/vanb/README.md b/1993/vanb/README.md
index d2cff7f79..3223518e2 100644
--- a/1993/vanb/README.md
+++ b/1993/vanb/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1993 vanb bugs](../../bugs.html#1993_vanb).
## To use:
-```sh
+```
./vanb 'exp'
```
@@ -28,7 +28,7 @@ hexadecimal and decimal numbers.
## Try:
-```sh
+```
./try.sh
```
@@ -133,7 +133,7 @@ Here's a version of the program before it got formatted into the VIII,
augmented with comments showing where each state begins. `N1` and `N2` are
notes:
-```c
+```
#define O5 main
O5(O2,O7,O3)char**O7;
{
@@ -180,14 +180,14 @@ printf, and sends the parser to state `012` (which is ``).
The `E` and `T` states work like this:
-```c
+```
int e(){ return eprime( t() ); }
```
The `E'` and `T'` states work like this:
-```c
+```
int eprime( int intermediate )
{
if( ch == '+' )
@@ -202,7 +202,7 @@ The `E'` and `T'` states work like this:
The `D`, `X` and `O` states work like this (they assume that they're initially
called with `0`):
-```c
+```
int octal( int intermediate )
{
if( ch>='0' && ch<='7' )
diff --git a/1993/vanb/index.html b/1993/vanb/index.html
index a257761e3..cb5050585 100644
--- a/1993/vanb/index.html
+++ b/1993/vanb/index.html
@@ -141,17 +141,17 @@ Location: ZZ - Unknown location
Note N1: It should never enter this state, unless the user invokes the
program with no parameters, in which case it just returns 0.
Note N2: Since the program is properly invoked with 1 parameter, this is
the first state it will go into. This state just invokes
printf, and sends the parser to state 012 (which is <E>).
make all
```
## To use:
-```sh
+```
./dodsond1
```
diff --git a/1994/dodsond1/index.html b/1994/dodsond1/index.html
index c23f4f268..b92be3032 100644
--- a/1994/dodsond1/index.html
+++ b/1994/dodsond1/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./dodsond1
+
./dodsond1
Try:
At the prompt, try entering E3.
Judges’ remarks:
diff --git a/1994/dodsond2/README.md b/1994/dodsond2/README.md
index 43153667b..1da32eb2a 100644
--- a/1994/dodsond2/README.md
+++ b/1994/dodsond2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -23,7 +23,7 @@ For more detailed information see [1994 dodsond2 bugs](../../bugs.html#1994_dods
## To use:
-```sh
+```
./dodsond2
```
@@ -39,21 +39,21 @@ from working in some cases.
### Alternate build:
-```sh
+```
make alt
```
The default number of arrows in this version is 3 but if you want to change it,
say to 5, try:
-```sh
+```
make clobber ARROWS=5 alt
```
### Alternate use:
-```sh
+```
./dodsond2.alt
```
diff --git a/1994/dodsond2/index.html b/1994/dodsond2/index.html
index 82601d42d..73034a0fb 100644
--- a/1994/dodsond2/index.html
+++ b/1994/dodsond2/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is an alternate version that allows you to cheat, giving you configurable
amount of arrows at the start of the game. See the Alternate
code section below.
This version allows you to choose how many arrows to start with, instead of the
default 0. If one tries specifying a value < 0 it will set it to 0.
Fun fact: this version helped uncover and fix a bug that prevented the entry
from working in some cases.
Alternate build:
-
make alt
+
make alt
The default number of arrows in this version is 3 but if you want to change it,
say to 5, try:
-
make clobber ARROWS=5 alt
+
make clobber ARROWS=5 alt
Alternate use:
-
./dodsond2.alt
+
./dodsond2.alt
Judges’ remarks:
Each year people find new ways to squeeze more and more out of the
contest rules. Next year, entries that use compression utilities
diff --git a/1994/horton/README.md b/1994/horton/README.md
index e1a424abb..8a38f2227 100644
--- a/1994/horton/README.md
+++ b/1994/horton/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./horton A B C D
```
@@ -16,7 +16,7 @@
## Try:
-```sh
+```
./try.sh
```
@@ -29,14 +29,14 @@ version.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./horton.alt A B C D
```
@@ -45,7 +45,7 @@ Where A, B, C and D are numbers like with `horton`.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -80,7 +80,7 @@ It's easily modified to graph *any* 96x160 bitmap on a dumb terminal.
See the [gtface](gtface.c) program for another example. Try:
-```sh
+```
make gtface
./gtface < gtface.data
```
diff --git a/1994/horton/index.html b/1994/horton/index.html
index 9ca118141..e6bdf67c1 100644
--- a/1994/horton/index.html
+++ b/1994/horton/index.html
@@ -141,22 +141,22 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./horton A B C D
+
./horton A B C D
A, B, C and D are numeric arguments.
Try:
-
./try.sh
+
./try.sh
Alternate code:
This confuses cb greatly. See horton.alt.c for an unobfuscated/enhanced
version.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./horton.alt A B C D
+
./horton.alt A B C D
Where A, B, C and D are numbers like with horton.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Try to figure out how this program prints, for a given slope, the
right character. And for extra credit, try to figure out which
@@ -176,8 +176,8 @@ cogs in the wheels of the grand plot to overthrow the cubics!
Oh, by the way, it uses a self-contained graphtab and frame buffer.
It’s easily modified to graph any 96x160 bitmap on a dumb terminal.
Trigraphs are natural obfuscators. Most C-beautifiers become C-uglifiers
because they don’t handle them correctly.
diff --git a/1994/schnitzi/README.md b/1994/schnitzi/README.md
index 1be00157b..06c925d81 100644
--- a/1994/schnitzi/README.md
+++ b/1994/schnitzi/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -23,14 +23,14 @@ For more detailed information see [1994 schnitzi bugs](../../bugs.html#1994_schn
## To use:
-```sh
+```
./schnitzi < textfile
```
## Try:
-```sh
+```
./try.sh
```
@@ -49,7 +49,7 @@ buffer size. This is due to a comment which is explained in more detail in
### Alternate build:
-```sh
+```
make alt
```
@@ -62,7 +62,7 @@ feeding the source code to it will not work right.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -71,7 +71,7 @@ feeding the source code to it will not work right.
Try:
-```sh
+```
./schnitzi < schnitzi.c
```
@@ -96,14 +96,14 @@ is run by redirecting a file into the executable on the command
line; for instance, for the file 'info', the program
would be run as follows:
-```sh
+```
./schnitzi < info
```
The program generates interesting results when its source file is
used as input:
-```sh
+```
./schnitzi < schnitzi.c
```
diff --git a/1994/schnitzi/index.html b/1994/schnitzi/index.html
index 037beefa6..2cab2a491 100644
--- a/1994/schnitzi/index.html
+++ b/1994/schnitzi/index.html
@@ -141,7 +141,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There are two alternate versions, one that has an increased buffer size and one
that uses fgets(); neither are completely functional.
See below section bugs and (mis)features for details and the alternate
@@ -151,9 +151,9 @@ code section for how to use.
STATUS: uses gets() - change to fgets() if possible
The first version, schnitzi.alt.c, uses fgets(3) but when fed its own code
it will generate code that still uses gets(3). What’s more is it will not
@@ -163,15 +163,15 @@ its own source code it will generate code that can compile but with the original
buffer size. This is due to a comment which is explained in more detail in
1994/schnitzi bugs.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use schnitzi.alt and schnitzi.alt2 as you would schnitzi above except that
feeding the source code to it will not work right.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Try:
-
./schnitzi< schnitzi.c
+
./schnitzi < schnitzi.c
Compare the output of the program with its source. Sure the output
is different, but there is more than meets the diff’s eye. Can you
find out why?
@@ -187,10 +187,10 @@ second row is written down the second column, etc. The program
is run by redirecting a file into the executable on the command
line; for instance, for the file ‘info’, the program
would be run as follows:
-
./schnitzi< info
+
./schnitzi < info
The program generates interesting results when its source file is
used as input:
-
./schnitzi< schnitzi.c
+
./schnitzi < schnitzi.c
The result of this command is a program which does the exact same
thing – in other words, both the program and the “flipped”
version of itself work identically (you’ll need to redirect the
diff --git a/1994/shapiro/README.md b/1994/shapiro/README.md
index 61080e408..f99824384 100644
--- a/1994/shapiro/README.md
+++ b/1994/shapiro/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -19,7 +19,7 @@ For more detailed information see [1994 shapiro bugs](../../bugs.html#1994_shapi
## To use:
-```sh
+```
./shapiro &
```
@@ -28,7 +28,7 @@ Now find the clock in the same terminal window (or console if at the console).
## Try:
-```sh
+```
./shapiro
^Z
bg
diff --git a/1994/shapiro/index.html b/1994/shapiro/index.html
index 120b38abc..be7496a8b 100644
--- a/1994/shapiro/index.html
+++ b/1994/shapiro/index.html
@@ -141,24 +141,24 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: missing file - please provide it
STATUS: INABIAF - please **DO NOT** fix
Notice what you see in the output of ps! Observe too what happens after you
bring it back to the foreground.
Judges’ remarks:
diff --git a/1994/smr/README.md b/1994/smr/README.md
index f9b7516f5..4c7feef23 100644
--- a/1994/smr/README.md
+++ b/1994/smr/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./smr
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1994/smr/index.html b/1994/smr/index.html
index 8b592cbf3..14ea1cd45 100644
--- a/1994/smr/index.html
+++ b/1994/smr/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./smr
+
./smr
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Nearly every year, one or more people would submit what they claimed
was the world’s smallest self reproducing program. While the sizes
diff --git a/1994/tvr/README.md b/1994/tvr/README.md
index d6988575b..19d356653 100644
--- a/1994/tvr/README.md
+++ b/1994/tvr/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -22,7 +22,7 @@ For more detailed information see [1994 tvr bugs](../../bugs.html#1994_tvr).
## To use:
-```sh
+```
./tvr mode screensize/2 < colormapfile
```
@@ -31,7 +31,7 @@ Mode may be a value from 0 to 12.
## Try:
-```sh
+```
./try.color.sh # for colour displays
./try.bw.sh # for Black & White displays
```
@@ -44,14 +44,14 @@ The author provided us a spoiler version that might be of interest to some.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./tvr.alt altmode screensize/2 < colormapfile
```
@@ -61,7 +61,7 @@ where `altmode` `1` - `4` correspond to mode `0` - `3` in the original entry and
### Alternate try:
-```sh
+```
./try.alt.color.sh # for colour displays
./try.alt.bw.sh # for Black & White displays
```
@@ -123,7 +123,7 @@ the fourth is a variation of that with more nice effects.
### Usage:
-```sh
+```
./tvr mode screensize/2 < colormapfile
```
diff --git a/1994/tvr/index.html b/1994/tvr/index.html
index 687fb808f..4c836d3d0 100644
--- a/1994/tvr/index.html
+++ b/1994/tvr/index.html
@@ -141,7 +141,7 @@ Location: FI - Republic of Finland
To build:
-
make all
+
make all
The author provided a spoiler version as alt code. See Alternate
code below.
./try.color.sh# for colour displays
-./try.bw.sh# for Black & White displays
+
./try.color.sh # for colour displays
+ ./try.bw.sh # for Black & White displays
Alternate code:
The author provided us a spoiler version that might be of interest to some.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./tvr.alt altmode screensize/2 < colormapfile
+
./tvr.alt altmode screensize/2 < colormapfile
where altmode1 - 4 correspond to mode 0 - 3 in the original entry and
altmode 0 calculates Mandelbrot/Julian sets correctly.
Alternate try:
-
./try.alt.color.sh# for colour displays
-./try.alt.bw.sh# for Black & White displays
+
./try.alt.color.sh # for colour displays
+ ./try.alt.bw.sh # for Black & White displays
Judges’ remarks:
This entry requires the use of X11. It will form two windows (hopefully your
window manager will ask you where to place these in your display) which you
@@ -208,7 +208,7 @@ noise.
second is a variation of that. The third makes nice 3D-look-a-like effects and
the fourth is a variation of that with more nice effects.
Usage:
-
./tvr mode screensize/2 < colormapfile
+
./tvr mode screensize/2 < colormapfile
The first parameter is the operating-mode of the program. There are 4 fractal
pairs and 3 display modes, making total of 12 modes. screensize is half of the
actual screenlength/width. I.e. if you use 128 as a second parameter, you will
diff --git a/1994/weisberg/README.md b/1994/weisberg/README.md
index ca72d9302..f12d8ab7b 100644
--- a/1994/weisberg/README.md
+++ b/1994/weisberg/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,20 +10,20 @@ code](#alternate-code) below for more details.
## To use:
-```sh
+```
./weisberg
```
## Try:
-```sh
+```
./try.sh
```
If you have `primes(1)` installed you might also wish to try:
-```sh
+```
./primes.sh number
```
@@ -40,14 +40,14 @@ something with you might try this version.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./weisberg.alt
```
diff --git a/1994/weisberg/index.html b/1994/weisberg/index.html
index 260404528..b2e0e7d54 100644
--- a/1994/weisberg/index.html
+++ b/1994/weisberg/index.html
@@ -141,15 +141,15 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There is an alternate version that uses more memory. See alternate
code below for more details.
To use:
-
./weisberg
+
./weisberg
Try:
-
./try.sh
+
./try.sh
If you have primes(1) installed you might also wish to try:
-
./primes.sh number
+
./primes.sh number
where number is a positive number, defaulting to 15. The try.sh
script will also do this.
Alternate code:
@@ -157,9 +157,9 @@ script will also do this.
have some 512 Megabytes of virtual memory lying around with to do
something with you might try this version.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./weisberg.alt
+
./weisberg.alt
Lesser systems will find this alternative version a good way to create
a core file. :-)
Judges’ remarks:
diff --git a/1994/westley/README.md b/1994/westley/README.md
index 07fec758a..7707e4bd4 100644
--- a/1994/westley/README.md
+++ b/1994/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -15,7 +15,7 @@ see [Original code](#original-code) below.
## To use:
-```sh
+```
./westley.alt
```
@@ -39,14 +39,14 @@ from start to finish.
For something more interesting try compiling it with different `cc -D` arguments
and then run the program each time. For example:
-```sh
+```
cc -Describe -Door westley.alt.c -o westley.alt && ./westley.alt
cc -Describe -Drain westley.alt.c -o westley.alt && ./westley.alt
```
To see the game from start to finish, try:
-```sh
+```
./try.alt.sh
```
@@ -65,7 +65,7 @@ reason that we recommend you try it first.
### Original build:
-```sh
+```
make all
```
@@ -95,14 +95,14 @@ error messages; there is no running the program.
For something more interesting try compiling it with different `cc -D`
arguments:
-```sh
+```
cc -Describe -Door westley.c
cc -Describe -Drain westley.c
```
To see the game from start to complete, try:
-```sh
+```
./try.sh
```
@@ -115,7 +115,7 @@ For spoilers see the end of the notes from the author below.
To use:
-```sh
+```
./try.sh
```
@@ -131,7 +131,7 @@ This program is a simple adventure game which uses only C preprocessor
error messages (for missing `#include` files) as output. To begin,
try to compile the program with no options:
-```sh
+```
cc westley.c
```
@@ -159,7 +159,7 @@ missing include file name, which functions as the game text.
To "do" things, all words must start with `-D`. For example, to
look at the door, do:
-```sh
+```
cc -Describe -Door prog.c
```
@@ -176,7 +176,7 @@ Here is a walk-through for the game, including a few dead-ends:
### SPOILER
-```sh
+```
cc -Describe -Door westley.c
cc -Describe -Drain westley.c
cc -Describe -Dwarf westley.c
diff --git a/1994/westley/index.html b/1994/westley/index.html
index e0d7aa76c..0603556f4 100644
--- a/1994/westley/index.html
+++ b/1994/westley/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make alt
+
make alt
We recommend that you try the alternate version first as the original entry
requires (for better display) 80 columns and 8 character tabs with wraparound.
The alt code uses the same logic as the original code except that the original
@@ -149,7 +149,7 @@ code used #includes of files that do not exist to generate the mess
compiler errors) whereas the alt code uses printf(3). For the original entry
see Original code below.
To use:
-
./westley.alt
+
./westley.alt
The purpose of the game is to escape the dungeon. Depending on the compiler line
you will get a different message when you run the program. One compiler line
will make you win the game (escape the dungeon) and others will show something
@@ -164,10 +164,10 @@ from start to finish.
Try:
For something more interesting try compiling it with different cc -D arguments
and then run the program each time. For example:
cc -Describe -Door westley.alt.c -o westley.alt && ./westley.alt
+ cc -Describe -Drain westley.alt.c -o westley.alt && ./westley.alt
To see the game from start to finish, try:
-
./try.alt.sh
+
./try.alt.sh
Original code:
The purpose of the game is to escape the dungeon via the compiler line
where you get messages as compiler errors. Depending on the compiler line you
@@ -177,7 +177,7 @@ game!
wraparound. The alternate code does not have this limitation and it is for this
reason that we recommend you try it first.
Original build:
-
make all
+
make all
There are a variety of different -D flags you can give to cc that change the
message you get. You might wish to look at the source code to get a
better idea or see below in the Original try section for
@@ -196,15 +196,15 @@ error messages; there is no running the program.
Original try:
For something more interesting try compiling it with different cc -D
arguments:
cc -Describe -Door westley.c
+ cc -Describe -Drain westley.c
To see the game from start to complete, try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Not all compiler errors are bad.
For spoilers see the end of the notes from the author below.
To use:
-
./try.sh
+
./try.sh
Author’s remarks:
This program, in accordance with the rules, compiles into a legal
C program without human intervention. However, it simply compiles
@@ -213,7 +213,7 @@ to actually compile the program.
This program is a simple adventure game which uses only C preprocessor
error messages (for missing #include files) as output. To begin,
try to compile the program with no options:
-
cc westley.c
+
cc westley.c
This will fail, producing an error message for a missing #include
file as the opening description. Your terminal should be set for
80 columns, 8 character tabs, and wraparound, as there is no way
@@ -232,7 +232,7 @@ to reliably output newlines. You should see something like this
missing include file name, which functions as the game text.
To “do” things, all words must start with -D. For example, to
look at the door, do:
-
cc-Describe-Door prog.c
+
cc -Describe -Door prog.c
…and you will get another error message telling you about the door.
(note: some compilers will stop after the first missing include file,
while others will continue to try compiling; the latter will repeat
@@ -241,24 +241,24 @@ with “verbose” turned on).
The goal of the game is to escape the dungeon.
Here is a walk-through for the game, including a few dead-ends:
SPOILER
-
cc-Describe-Door westley.c
-cc-Describe-Drain westley.c
-cc-Describe-Dwarf westley.c
-cc-Describe-Debris westley.c # or -Dungeon
-cc-Describe-Desk westley.c
-cc-Describe-Dime westley.c
-cc-Describe-Directory westley.c
-cc-Dial-DUNgeon0614 westley.c
-cc-Drink-Daiquiri westley.c
-cc-Drop-Daiquiri westley.c
-cc-Drop-Dwarf-Daiquiri westley.c # or -Drop -Down -Daiquiri
-cc-Describe-Document westley.c
-cc-Depress-Dotted-Dog westley.c
-cc-Depress-Dalmatian westley.c # also accepts "Dalmation" [sic]
-cc-Deposit-Dime westley.c
-cc-Drop-Donut westley.c
-cc-Drop-Donut-Down-Drain westley.c # or -Drop -Dwarf -Donut
-# (at this point, you win!)
+
cc -Describe -Door westley.c
+ cc -Describe -Drain westley.c
+ cc -Describe -Dwarf westley.c
+ cc -Describe -Debris westley.c # or -Dungeon
+ cc -Describe -Desk westley.c
+ cc -Describe -Dime westley.c
+ cc -Describe -Directory westley.c
+ cc -Dial -DUNgeon0614 westley.c
+ cc -Drink -Daiquiri westley.c
+ cc -Drop -Daiquiri westley.c
+ cc -Drop -Dwarf -Daiquiri westley.c # or -Drop -Down -Daiquiri
+ cc -Describe -Document westley.c
+ cc -Depress -Dotted -Dog westley.c
+ cc -Depress -Dalmatian westley.c # also accepts "Dalmation" [sic]
+ cc -Deposit -Dime westley.c
+ cc -Drop -Donut westley.c
+ cc -Drop -Donut -Down -Drain westley.c # or -Drop -Dwarf -Donut
+ # (at this point, you win!)
Note that the game has no real state information; you can type these
commands in any order, at any time. Also note that word order is
unimportant.
diff --git a/1995/cdua/README.md b/1995/cdua/README.md
index 7ad1ff8b2..f8fb27678 100644
--- a/1995/cdua/README.md
+++ b/1995/cdua/README.md
@@ -4,7 +4,7 @@ We recommend that you try the alternate version first so you can see what this
entry looked like back in 1995 (with a configurable speed). See the [original
code](#original-code) section below for the original entry.
-```sh
+```
make alt
```
@@ -28,14 +28,14 @@ For more detailed information see [1995 cdua bugs](../../bugs.html#1995_cdua).
## To use:
-```sh
+```
./cdua.alt
```
## Try:
-```sh
+```
make SLEEP=1500 clobber alt
./cdua.alt # press enter and watch it go much faster!
@@ -43,7 +43,7 @@ For more detailed information see [1995 cdua bugs](../../bugs.html#1995_cdua).
You might also like to try:
-```sh
+```
make SLEEP=65000 clobber alt
./cdua.alt # press enter and watch it go much slower!
@@ -66,14 +66,14 @@ fast your computer is :-) or use both to see the difference, you can do so.
### Original build:
-```sh
+```
make all
```
### Original use:
-```sh
+```
./cdua
```
diff --git a/1995/cdua/index.html b/1995/cdua/index.html
index b33fd33d4..a37eb0891 100644
--- a/1995/cdua/index.html
+++ b/1995/cdua/index.html
@@ -144,7 +144,7 @@ Location: ZZ - Unknown locationWe recommend that you try the alternate version first so you can see what this
entry looked like back in 1995 (with a configurable speed). See the original
code section below for the original entry.
-
make alt
+
make alt
The alternate version uses usleep(3) with SLEEP (defined in the Makefile,
default 3000) microseconds to make it easier to see the maze being solved in
real time. You can redefine SLEEP at compile time to reconfigure it in case
@@ -155,15 +155,15 @@ making it 100000 (which is actually fun :-) ).
make SLEEP=1500 clobber alt
-
-./cdua.alt# press enter and watch it go much faster!
+
make SLEEP=1500 clobber alt
+
+ ./cdua.alt # press enter and watch it go much faster!
You might also like to try:
-
make SLEEP=65000 clobber alt
-
-./cdua.alt# press enter and watch it go much slower!
+
make SLEEP=65000 clobber alt
+
+ ./cdua.alt # press enter and watch it go much slower!
Do you see anything strange in this version when SLEEP is a high value like
65000? What happens if you use 100000? Is this strange output still there?
Why?
@@ -174,9 +174,9 @@ actually see it being solved in real time rather than have it go by in a flash.<
If you wish to use the original version, for instance if you wish to see how
fast your computer is :-) or use both to see the difference, you can do so.
Original build:
-
make all
+
make all
Original use:
-
./cdua
+
./cdua
Judges’ remarks:
This could be used as the basis of an a-maze-ing screen exerciser.
Author’s remarks:
diff --git a/1995/dodsond1/README.md b/1995/dodsond1/README.md
index c75017483..41a232325 100644
--- a/1995/dodsond1/README.md
+++ b/1995/dodsond1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dodsond1 < text_file
```
## Try:
-```sh
+```
./dodsond1 < README.md
```
@@ -32,7 +32,7 @@ You might consider giving the following input:
... which can be done like:
-```c
+```
./try.sh
```
diff --git a/1995/dodsond1/index.html b/1995/dodsond1/index.html
index 97f2fe640..50bb9f564 100644
--- a/1995/dodsond1/index.html
+++ b/1995/dodsond1/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./dodsond1< text_file
+
./dodsond1 < text_file
Try:
-
./dodsond1< README.md
+
./dodsond1 < README.md
Judges’ remarks:
You might consider giving the following input:
... a male (who) gets very, very frustrated sitting in a chair all
@@ -153,7 +153,7 @@ Location: US - United States of America
giraffes.
-- Adjunct Professor Newt Gingrich, Reinhardt College, 1/7/95
diff --git a/1995/dodsond2/README.md b/1995/dodsond2/README.md
index 34950eb55..730f6386a 100644
--- a/1995/dodsond2/README.md
+++ b/1995/dodsond2/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dodsond2
```
diff --git a/1995/dodsond2/index.html b/1995/dodsond2/index.html
index 094b8f746..a5c39633c 100644
--- a/1995/dodsond2/index.html
+++ b/1995/dodsond2/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./dodsond2
+
./dodsond2
Judges’ remarks:
An amazing entry!
The official chef enjoyed solving the maze, which she did on the first
diff --git a/1995/esde/README.md b/1995/esde/README.md
index bb1eb8aa4..d630bb55c 100644
--- a/1995/esde/README.md
+++ b/1995/esde/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./esde data-file word
```
@@ -16,7 +16,7 @@ where data-file contains lines of < 255 chars in length.
## Try:
-```sh
+```
./try.sh
```
diff --git a/1995/esde/index.html b/1995/esde/index.html
index 7c357ca0d..2ce424e1e 100644
--- a/1995/esde/index.html
+++ b/1995/esde/index.html
@@ -141,12 +141,12 @@ Location: PL - Republic of Poland
To build:
-
make all
+
make all
To use:
-
./esde data-file word
+
./esde data-file word
where data-file contains lines of < 255 chars in length.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
When reading the source be careful to distinguish between variable
names and library functions.
diff --git a/1995/garry/README.md b/1995/garry/README.md
index 383f07c20..2c87e7da6 100644
--- a/1995/garry/README.md
+++ b/1995/garry/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./garry output_file
```
## Try:
-```sh
+```
./try.sh
```
@@ -29,21 +29,21 @@ left intact) looked very much like a rat "dropping core". See
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./garry.alt output_file
```
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -63,13 +63,13 @@ environment variables.
The calling syntax is pretty simple, just use it with `stdio`-redirection
or inside pipelines, e.g.:
-```sh
+```
./garry converted_file
```
or
-```sh
+```
cat all_my_files/* | ./garry | lp
```
@@ -87,7 +87,7 @@ Unknown Env-variables or malformed expressions are ignored and kept intact.
Additionally, the filter replaces escaped octal values in the environment
variables by their binary representation, e.g.:
-```sh
+```
$ TEST="\110\145\154\154\157"
$ export TEST
$ echo '$TEST$' | ./garry
diff --git a/1995/garry/index.html b/1995/garry/index.html
index 910709ec9..d7386e146 100644
--- a/1995/garry/index.html
+++ b/1995/garry/index.html
@@ -141,22 +141,22 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
To use:
-
./garry<input_file >output_file
+
./garry <input_file >output_file
Try:
-
./try.sh
+
./try.sh
Alternate code:
While it may not have been the intention of the author, the
judges noted that the C pre-processed version (with the #includes
left intact) looked very much like a rat “dropping core”. See
garry.alt.c and judge for yourself!
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./garry.alt<input_file >output_file
+
./garry.alt <input_file >output_file
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
The author was kind enough to provide a less obfuscated version of
the source called garry.fmt.c.
@@ -166,9 +166,9 @@ incorporating the ability to create binary from escaped data in the
environment variables.
The calling syntax is pretty simple, just use it with stdio-redirection
or inside pipelines, e.g.:
-
./garry<file_to_convert >converted_file
+
./garry <file_to_convert >converted_file
or
-
cat all_my_files/*|./garry|lp
+
cat all_my_files/* | ./garry | lp
The syntax of the conversion of the input file is as follows: To include the
value of an environment variable in the output file, place the name of the
variable between $-signs in the input, e.g.:
@@ -177,10 +177,10 @@ variable between $-signs in the input, e.g.:
Unknown Env-variables or malformed expressions are ignored and kept intact.
Additionally, the filter replaces escaped octal values in the environment
variables by their binary representation, e.g.:
-
$ TEST="\110\145\154\154\157"
-$ export TEST
-$ echo '$TEST$'|./garry
-Hello
make all
```
## To use:
-```sh
+```
./heathbar num num
```
@@ -16,7 +16,7 @@ where num is a non-negative number.
## Try:
-```sh
+```
./try.sh
```
diff --git a/1995/heathbar/index.html b/1995/heathbar/index.html
index de46c9f2f..330790ffd 100644
--- a/1995/heathbar/index.html
+++ b/1995/heathbar/index.html
@@ -144,12 +144,12 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./heathbar num num
+
./heathbar num num
where num is a non-negative number.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The main reason we liked this entry was mainly because the main
effect of the source was self documenting! :-)
diff --git a/1995/leo/README.md b/1995/leo/README.md
index 7904614fa..d41fa0228 100644
--- a/1995/leo/README.md
+++ b/1995/leo/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1995 leo bugs](../../bugs.html#1995_leo).
## To use:
-```sh
+```
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
```
@@ -27,7 +27,7 @@ See the author's information below on these details.
## Try:
-```sh
+```
./try.sh
```
@@ -52,7 +52,7 @@ characters on the command line - anything that's not a number is a candidate.)
The usage is:
-```sh
+```
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
```
@@ -68,7 +68,7 @@ to be present if you want to enter `freq` (and you usually do).
Some options to try (besides the obvious):
-```sh
+```
./leo 1 | cat - /dev/tty | gs -
```
@@ -191,19 +191,19 @@ the opening for step 1 is not a single line but a cross:
To watch it repeatedly (as a screen saver), use:
-```sh
+```
./leo 2 | cat - /dev/tty | gs -
```
The command line:
-```sh
+```
./leo Variable 1 | cat - /dev/tty | gs -
```
draws the same as above. Try:
-```sh
+```
./leo Variable 1 1 | cat - /dev/tty | gs -
```
@@ -228,7 +228,7 @@ If `Variable` is used, the actual value of `cycle` doesn't matter,
as far as it is > 1. To figure out what difference
`cycle` makes when `Variable` is not used, try
-```sh
+```
./leo Variable 37 80 | cat - /dev/tty | gs -
```
diff --git a/1995/leo/index.html b/1995/leo/index.html
index 8a8398a1f..52b26955d 100644
--- a/1995/leo/index.html
+++ b/1995/leo/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
+
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
See the author’s information below on these details.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Press return after each image is drawn.
The variable names are element-ary. If you find this confusing,
@@ -163,7 +163,7 @@ the secret switches that the author doesn’t divulge ! (All switches are single
characters on the command line - anything that’s not a number is a candidate.)
Author’s remarks:
The usage is:
-
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
+
./leo [ deep ] [ right ] [ Variable ] [ cycle [ freq ] ]
where the first three are literal words, cycle is a positive integer (0 is
ignored), and freq is an integer (default = 0) that’s supposed to be in the
range 0..100 (bigger values are allowed, however). Invalid parameters and
@@ -173,7 +173,7 @@ equivalent to ./leo 0 0 0 1 Variable 70 right, etc.
If Variable is used, cycle is almost ignored (see below) but has
to be present if you want to enter freq (and you usually do).
Some options to try (besides the obvious):
-
./leo 1 |cat- /dev/tty |gs-
+
./leo 1 | cat - /dev/tty | gs -
This draws the basic pattern I invented in high school:
You take a big sheet of “arithmetic” paper and draw a line
of length 1 (between 2 crossings) at the center of the sheet:
@@ -253,11 +253,11 @@ the opening for step 1 is not a single line but a cross:
\./
/ \
To watch it repeatedly (as a screen saver), use:
-
./leo 2 |cat- /dev/tty |gs-
+
./leo 2 | cat - /dev/tty | gs -
The command line:
-
./leo Variable 1 |cat- /dev/tty |gs-
+
./leo Variable 1 | cat - /dev/tty | gs -
draws the same as above. Try:
-
./leo Variable 1 1 |cat- /dev/tty |gs-
+
./leo Variable 1 1 | cat - /dev/tty | gs -
What happened to the picture? Increase freq and watch the changes.
If cycle is more than 1, the program loops, allowing the user to
enjoy randomly changing patterns (the delay is 3 seconds),
@@ -272,7 +272,7 @@ if you want to pipe the output to a printer.
If Variable is used, the actual value of cycle doesn’t matter,
as far as it is > 1. To figure out what difference
cycle makes when Variable is not used, try
-
./leo Variable 37 80 |cat- /dev/tty |gs-
+
./leo Variable 37 80 | cat - /dev/tty | gs -
and other values of cycle; smaller values usually require
smaller values of freq for the patterns to be non-trivial.
The options deep and right make the patterns to be drawn in different
diff --git a/1995/makarios/README.md b/1995/makarios/README.md
index ff9a7aa51..764a049c8 100644
--- a/1995/makarios/README.md
+++ b/1995/makarios/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./makarios
```
diff --git a/1995/makarios/index.html b/1995/makarios/index.html
index a792f0d5d..437bc16f6 100644
--- a/1995/makarios/index.html
+++ b/1995/makarios/index.html
@@ -144,9 +144,9 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./makarios
+
./makarios
Judges’ remarks:
The judges were impressed that such a small program could do so much!
Can you figure out how it does it?
diff --git a/1995/savastio/README.md b/1995/savastio/README.md
index d503276dc..1535c4c45 100644
--- a/1995/savastio/README.md
+++ b/1995/savastio/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1995 savastio bugs](../../bugs.html#1995_sava
## To use:
-```sh
+```
./savastio
# enter a POSITIVE number such as 100
```
@@ -29,7 +29,7 @@ what happens if you give a non-number?
## Try:
-```sh
+```
./try.sh
```
diff --git a/1995/savastio/index.html b/1995/savastio/index.html
index 02070fc2e..fccf6413e 100644
--- a/1995/savastio/index.html
+++ b/1995/savastio/index.html
@@ -141,18 +141,18 @@ Location: ZZ - Unknown location
./savastio
+ # enter a POSITIVE number such as 100
NOTE: if you specify a negative number it will get stuck, showing no output. But
what happens if you give a non-number?
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
I know an l when I see a 1.
Author’s remarks:
diff --git a/1995/schnitzi/README.md b/1995/schnitzi/README.md
index 2875d4505..ce1dcc707 100644
--- a/1995/schnitzi/README.md
+++ b/1995/schnitzi/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./schnitzi num
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1995/schnitzi/index.html b/1995/schnitzi/index.html
index df4d4f0bc..4ec2890a1 100644
--- a/1995/schnitzi/index.html
+++ b/1995/schnitzi/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./schnitzi num
+
./schnitzi num
Try:
-
./try.sh
+
./try.sh
WARNING: the author warns to not use too high a number! If you wish to ignore
the warning it is an exercise to determine how high is too high. :-)
Judges’ remarks:
diff --git a/1995/spinellis/README.md b/1995/spinellis/README.md
index 4a5c104a9..b204ba18c 100644
--- a/1995/spinellis/README.md
+++ b/1995/spinellis/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./spinellis < spinellis.c
```
diff --git a/1995/spinellis/index.html b/1995/spinellis/index.html
index 3e90ac12c..d4aff492f 100644
--- a/1995/spinellis/index.html
+++ b/1995/spinellis/index.html
@@ -141,9 +141,9 @@ Location: GR - Hellenic Republic (
To build:
-
make all
+
make all
To use:
-
./spinellis< spinellis.c
+
./spinellis < spinellis.c
Judges’ remarks:
While the code does not abuse the rules, its output surely does!
P.S. Does the source have any spelling errors?
diff --git a/1995/vanschnitz/README.md b/1995/vanschnitz/README.md
index 6caee70fc..16b12e557 100644
--- a/1995/vanschnitz/README.md
+++ b/1995/vanschnitz/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -21,14 +21,14 @@ For more detailed information see [1995 vanschnitz bugs](../../bugs.html#1995_va
## To use:
-```sh
+```
./vanschnitz
```
## Try:
-```sh
+```
./try.sh
```
@@ -43,7 +43,7 @@ to first try and figure out the program without the spoiler.
### Alternate build:
-```sh
+```
make alt
```
@@ -84,7 +84,7 @@ line. For instance, to cause the compiler to solve the Towers
of Hanoi problem with four disks, you would compile the program
like this:
-```sh
+```
gcc hanoi.c -o hanoi -Dn=4
```
@@ -111,7 +111,7 @@ concatenated; a version that does not use this feature has been
included for people who can only run K&R). A good way to see
the resulting program (on a Unix system) is to do the command
-```sh
+```
gcc hanoi.c -E -Dn=5 | grep -v \# | grep -v ^\$
```
diff --git a/1995/vanschnitz/index.html b/1995/vanschnitz/index.html
index 43b5062d9..84128b98a 100644
--- a/1995/vanschnitz/index.html
+++ b/1995/vanschnitz/index.html
@@ -144,7 +144,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
The authors provided a spoiler version, originally uuencoded but uudecoded by us
in 2023. See Alternate code below.
Bugs and (Mis)features:
@@ -152,16 +152,16 @@ in 2023. See Alternate code below.
The authors provided a spoiler version of the program. Originally uuencoded we
have decoded it for the wider audience in vanschnitz.alt.c. The
uuencoded blob is still available in their remarks below. They encourage you
to first try and figure out the program without the spoiler.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use vanschnitz.alt as you would vanschnitz above.
Judges’ remarks:
@@ -187,7 +187,7 @@ for. This is done by defining the symbol n on the compile
line. For instance, to cause the compiler to solve the Towers
of Hanoi problem with four disks, you would compile the program
like this:
-
gcc hanoi.c -o hanoi -Dn=4
+
gcc hanoi.c -o hanoi -Dn=4
A default value of 5 will be used for n if you do not define
it on the command line. The value of n cannot be greater than
fifteen (the compiler we used to test has a limit on the #include
@@ -208,7 +208,7 @@ ANSI C feature in which adjacent character strings are
concatenated; a version that does not use this feature has been
included for people who can only run K&R). A good way to see
the resulting program (on a Unix system) is to do the command
-
gcc hanoi.c -E-Dn=5 |grep-v\#|grep-v ^\$
+
gcc hanoi.c -E -Dn=5 | grep -v \# | grep -v ^\$
For an odd number of disks, the program will provide a
solution wherein the disks end up on peg 2; for an even
number of disks, they will end on peg 3. This should
diff --git a/1996/august/README.md b/1996/august/README.md
index b709d7931..a941d549e 100644
--- a/1996/august/README.md
+++ b/1996/august/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1996 august bugs](../../bugs.html#1996_august
## To use:
-```sh
+```
cat august.c test.oc | ./august > test.oo
./august < test.oo
```
@@ -33,7 +33,7 @@ The above should print a `!` followed by a newline.
## Try:
-```sh
+```
./try.sh
```
@@ -43,33 +43,33 @@ The above should print a `!` followed by a newline.
This entry can feed on itself. If you C pre-process the source,
you can compile the interpreter:
-```sh
+```
make august.oc
```
We can now compile the interpreter as follows:
-```sh
+```
cat august.c august.oc | ./august > august.oo
```
and use the compiled interpreter to execute some previously
compiled code:
-```sh
+```
cat august.oo test.oo | ./august
```
And we can have the compiled interpreter interpret itself which
in turn compiles the test program:
-```sh
+```
cat august.oo august.oo fac.oo | ./august
```
And if you have lots of spare time, you can recurse one level deeper:
-```sh
+```
cat august.oo august.oo august.oo fac.oo | ./august
```
@@ -107,25 +107,25 @@ can go wrong. But this is what seasoned C programmers are used to.
Assume that the interpreter has been compiled (source in [august.c](august.c)
and binary in august) and that we have this in a file named `test.oc`:
-```c
+```
main() { putchar('!'); putchar('\n'); exit(0); }
```
We can then compile by
-```sh
+```
cat august.c test.oc | ./august > test.oo
```
And run the compiled program by
-```sh
+```
./august < test.oo
```
Or even simpler:
-```sh
+```
cat august.c test.oc | ./august | ./august
```
@@ -141,26 +141,26 @@ need to use an external one. To pre-process [august.c](august.c) use the
command from the Makefile, but add the `-E` flag and change 60000 to 40000,
i.e.:
-```sh
+```
cc -E -DZ=40000 .... august.c > august.oc
```
If `august.oc` contain some junk line starting with a `#` (most likely
it does) then remove it like:
-```sh
+```
sed -i'' '/^#/d' august.oc
```
OK, we can now compile the interpreter:
-```sh
+```
cat august.c august.oc | ./august > august.oo
```
And we can run it:
-```sh
+```
cat august.oo test.oo | ./august
```
@@ -168,13 +168,13 @@ Here we have the interpreter interpreting another interpreter that runs
the program. Did you think that was too fast? Just throw in another
level of interpretation:
-```sh
+```
cat august.oo august.oo test.oo | ./august
```
And another...
-```sh
+```
cat august.oo august.oo august.oo test.oo | ./august
```
diff --git a/1996/august/index.html b/1996/august/index.html
index 5b7301421..d95a707e8 100644
--- a/1996/august/index.html
+++ b/1996/august/index.html
@@ -141,34 +141,34 @@ Location: SE - Kingdom of Sweden (
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: doesn't work with some compilers - please provide alternative code or fix for more compilers
NOTE: some compilers will compile this code into infinite loops! If the above
cat line (or one of the ones later in the try section) does not execute in a
very short amount of time, then you may need to fix your compiler or use gcc.
The above should print a ! followed by a newline.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This entry can feed on itself. If you C pre-process the source,
you can compile the interpreter:
-
make august.oc
+
make august.oc
We can now compile the interpreter as follows:
-
cat august.c august.oc |./august> august.oo
+
cat august.c august.oc | ./august > august.oo
and use the compiled interpreter to execute some previously
compiled code:
-
cat august.oo test.oo |./august
+
cat august.oo test.oo | ./august
And we can have the compiled interpreter interpret itself which
in turn compiles the test program:
-
cat august.oo august.oo fac.oo |./august
+
cat august.oo august.oo fac.oo | ./august
And if you have lots of spare time, you can recurse one level deeper:
We (the judges) recommend that you spend some time studying this
entry as it surely will make the ‘best of the IOCCC’ list. It was
very well received by those who attended the IOCCC BOF.
@@ -194,13 +194,13 @@ of operators, and control constructs.
can go wrong. But this is what seasoned C programmers are used to.
Assume that the interpreter has been compiled (source in august.c
and binary in august) and that we have this in a file named test.oc:
The compiler for OC is naturally written in OC (where did you think the byte
code came from?). It is in the file parse.oc.
@@ -210,20 +210,20 @@ preprocessor (hey, what do you expect from a program that is this small), so we
need to use an external one. To pre-process august.c use the
command from the Makefile, but add the -E flag and change 60000 to 40000,
i.e.:
-
cc-E-DZ=40000 .... august.c > august.oc
+
cc -E -DZ=40000 .... august.c > august.oc
If august.oc contain some junk line starting with a # (most likely
it does) then remove it like:
-
sed-i'''/^#/d' august.oc
+
sed -i'' '/^#/d' august.oc
OK, we can now compile the interpreter:
-
cat august.c august.oc |./august> august.oo
+
cat august.c august.oc | ./august > august.oo
And we can run it:
-
cat august.oo test.oo |./august
+
cat august.oo test.oo | ./august
Here we have the interpreter interpreting another interpreter that runs
the program. Did you think that was too fast? Just throw in another
level of interpretation:
Fitting the byte code for the compiler into the initial comment
was a challenge. I had to strip the compiler/interpreter of
diff --git a/1996/dalbec/README.md b/1996/dalbec/README.md
index 37b0da52c..5796ed640 100644
--- a/1996/dalbec/README.md
+++ b/1996/dalbec/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dalbec
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1996/dalbec/index.html b/1996/dalbec/index.html
index 69f3e7b53..a3af9b6b3 100644
--- a/1996/dalbec/index.html
+++ b/1996/dalbec/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./dalbec
+
./dalbec
Try:
-
./try.sh
+
./try.sh
Why does the output end with 121?
Judges’ remarks:
The output is mis-leading … why does it also print 2047?
diff --git a/1996/eldby/README.md b/1996/eldby/README.md
index 1dba0efa0..36abe14e5 100644
--- a/1996/eldby/README.md
+++ b/1996/eldby/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -11,7 +11,7 @@ section.
## To use:
-```sh
+```
./eldby.alt
```
@@ -28,7 +28,7 @@ problematic for some people, can be configured to different speeds by way of the
value used in `usleep()`. The default is `35000` but you can easily change
it. To do so try:
-```sh
+```
make SLEEP=20000 clobber alt
./eldby.alt
```
@@ -41,7 +41,7 @@ This version is the original which has no sleep time in between updates.
### Original build:
-```sh
+```
make all
```
diff --git a/1996/eldby/index.html b/1996/eldby/index.html
index 46beec3db..526c4dadd 100644
--- a/1996/eldby/index.html
+++ b/1996/eldby/index.html
@@ -141,12 +141,12 @@ Location: ZZ - Unknown location
To build:
-
make alt
+
make alt
We recommend that you use the alt version to see what the entry looked like back
in 1996. For the original version see the original code
section.
To use:
-
./eldby.alt
+
./eldby.alt
To quit send intr (typically ctrl-c).
NOTE: to reset the sanity of your terminal after this program ends try reset.
Try:
@@ -155,12 +155,12 @@ happening with modern systems, and to not flash too quickly, which can be
problematic for some people, can be configured to different speeds by way of the
value used in usleep(). The default is 35000 but you can easily change
it. To do so try:
-
make SLEEP=20000 clobber alt
-./eldby.alt
+
make SLEEP=20000 clobber alt
+ ./eldby.alt
Original code:
This version is the original which has no sleep time in between updates.
Original build:
-
make all
+
make all
Original use:
Use ./eldby as you would ./eldby.alt above.
Judges’ remarks:
diff --git a/1996/gandalf/README.md b/1996/gandalf/README.md
index 85a89c9e0..c6aef9239 100644
--- a/1996/gandalf/README.md
+++ b/1996/gandalf/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,14 +18,14 @@ For more detailed information see [1996 gandalf bugs](../../bugs.html#1996_ganda
## To use:
-```sh
+```
./gandalf
```
## Try:
-```sh
+```
./try.sh
```
@@ -41,7 +41,7 @@ BTW: it is perilous to 'try' the patience of
For misleading C pre-processor output, try:
-```sh
+```
cc -E gandalf.c
```
diff --git a/1996/gandalf/index.html b/1996/gandalf/index.html
index 8feb9c57b..a96194304 100644
--- a/1996/gandalf/index.html
+++ b/1996/gandalf/index.html
@@ -141,15 +141,15 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: missing or dead link - please provide them
As the script asks, care to guess why these execute differently? Only the
compiler knows … ok maybe other things like the author, the judges and perhaps
you too?
@@ -157,7 +157,7 @@ you too?
Gandalf. Go ahead, ‘try’ it! :-)
Judges’ remarks:
For misleading C pre-processor output, try:
-
cc-E gandalf.c
+
cc -E gandalf.c
Author’s remarks:
The program requires an ASCII system.
make all
```
@@ -18,14 +18,14 @@ For more detailed information see [1996 huffman bugs](../../bugs.html#1996_huffm
## To use:
-```sh
+```
echo 'Huffman Decoding' | ./huffman
```
## Try:
-```sh
+```
./try.sh
```
@@ -39,7 +39,7 @@ And for a misleading hint, consider who won! :-)
And if you really can't see what is going on, here is an extra spoiler:
-```sh
+```
./huffman < huffman.c 2>/dev/null
```
diff --git a/1996/huffman/index.html b/1996/huffman/index.html
index 13e8d82f9..b9e84869b 100644
--- a/1996/huffman/index.html
+++ b/1996/huffman/index.html
@@ -141,21 +141,21 @@ Location: US - United States of America
To build:
-
make all
+
make all
Bugs and (Mis)features:
The current status of this entry is:
STATUS: uses gets() - change to fgets() if possible
If you are still confused and want to read a spoiler, check out
the source and it will be clear as mud!
And for a misleading hint, consider who won! :-)
And if you really can’t see what is going on, here is an extra spoiler:
-
./huffman< huffman.c 2>/dev/null
+
./huffman < huffman.c 2>/dev/null
This entry was very well received at the IOCCC BOF.
Author’s remarks:
This filter program is really not obfuscated code. It compiles cleanly
diff --git a/1996/jonth/README.md b/1996/jonth/README.md
index d9c600d97..d6ebb244e 100644
--- a/1996/jonth/README.md
+++ b/1996/jonth/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -24,7 +24,7 @@ For more detailed information see [1996 jonth bugs](../../bugs.html#1996_jonth).
## To use:
-```sh
+```
./jonth :0 :0
```
@@ -35,7 +35,7 @@ off the other so that you can properly play.
NOTE: if there is no X service open this will crash. If this is the case you
might try:
-```sh
+```
./jonth
```
@@ -49,7 +49,7 @@ These are supposed to happen. As is written in the
## Try:
-```sh
+```
./jonth host1:0 host2:0
```
diff --git a/1996/jonth/index.html b/1996/jonth/index.html
index 005565841..8c766457d 100644
--- a/1996/jonth/index.html
+++ b/1996/jonth/index.html
@@ -141,7 +141,7 @@ Location: NO - Kingdom of Norway (
To build:
-
make all
+
make all
NOTE: this entry requires X11/Xlib.h header file and the X11 library to
compile. macOS users running Mountain Lion and later will need to download and
install XQuartz in order to compile and run this
@@ -152,17 +152,17 @@ entry.
STATUS: missing or dead link - please provide them
NOTE: the two boards will be on top of each other so you will have to drag one
off the other so that you can properly play.
NOTE: if there is no X service open this will crash. If this is the case you
might try:
-
./jonth
+
./jonth
These are supposed to happen. As is written in the
The Jargon File:
That's not a bug, that's a feature.
Try:
-
./jonth host1:0 host2:0
+
./jonth host1:0 host2:0
Judges’ remarks:
For extra credit, figure out how you can cheat by taking over a square already
occupied by an opponent.
diff --git a/1996/rcm/README.md b/1996/rcm/README.md
index 02b10dc1d..44ef7702d 100644
--- a/1996/rcm/README.md
+++ b/1996/rcm/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./rcm < file.gz
```
@@ -18,7 +18,7 @@ where `file.gz` is some gzipped file.
For more information try:
-```sh
+```
./try.sh
```
@@ -27,7 +27,7 @@ For more information try:
For a good no-op try:
-```sh
+```
gzip -c < rcm.c | ./rcm
```
diff --git a/1996/rcm/index.html b/1996/rcm/index.html
index a45203fca..08e797f94 100644
--- a/1996/rcm/index.html
+++ b/1996/rcm/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
To build:
-
make all
+
make all
To use:
-
./rcm< file.gz
+
./rcm < file.gz
where file.gz is some gzipped file.
Try:
For more information try:
-
./try.sh
+
./try.sh
Judges’ remarks:
For a good no-op try:
-
gzip-c< rcm.c |./rcm
+
gzip -c < rcm.c | ./rcm
NOTE: this is done in the try.sh script as well, along with some other
commands including a way to do the above command but with more steps.
Author’s remarks:
diff --git a/1996/schweikh1/README.md b/1996/schweikh1/README.md
index 05a8a9e82..696e76757 100644
--- a/1996/schweikh1/README.md
+++ b/1996/schweikh1/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./schweikh1
```
@@ -17,7 +17,7 @@
To find the day that Easter falls on in the current year and to show all Easter
dates from 1582 to 2199:
-```sh
+```
./try.sh
```
diff --git a/1996/schweikh1/index.html b/1996/schweikh1/index.html
index ed3425230..9b9131e6d 100644
--- a/1996/schweikh1/index.html
+++ b/1996/schweikh1/index.html
@@ -141,13 +141,13 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
To use:
-
./schweikh1
+
./schweikh1
Try:
To find the day that Easter falls on in the current year and to show all Easter
dates from 1582 to 2199:
-
./try.sh
+
./try.sh
Judges’ remarks:
Look at the source. There is something very odd going on here.
Where does the real code come from if everything is a C pre-processor
diff --git a/1996/schweikh2/README.md b/1996/schweikh2/README.md
index 44f5eb44c..b37a4f2c5 100644
--- a/1996/schweikh2/README.md
+++ b/1996/schweikh2/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./schweikh2
```
@@ -24,19 +24,19 @@ The program accepts up to 4 parameters:
## Try:
-```sh
+```
./try.sh
```
What happens if you pass only three parameters like the below?
-```sh
+```
./schweikh2 15 1 0
```
The author also suggests:
-```sh
+```
while :; do grep -v '#' schweikh2.c; done
```
@@ -51,7 +51,7 @@ The original program, with only slight obfuscations, may be found
in [hunni.c](hunni.c). The perl script, [hunni.pl](hunni.pl), obfuscates it
appropriately. Try:
-```sh
+```
less hunni.c
perl ./hunni.pl < hunni.c
@@ -137,7 +137,7 @@ minutes (`gcc -O3`).
### Sample arguments:
-```sh
+```
./schweikh2 6
./schweikh2 7 0
./schweikh2 7 7 0
@@ -151,7 +151,7 @@ minutes (`gcc -O3`).
The diamond pattern can be continued without a break.
For a nice printout try this on your Bourne compatible shell:
-```sh
+```
while :; do grep -v '#' schweikh2.c; done
```
diff --git a/1996/schweikh2/index.html b/1996/schweikh2/index.html
index d7710cfd7..353a5695e 100644
--- a/1996/schweikh2/index.html
+++ b/1996/schweikh2/index.html
@@ -141,9 +141,9 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
To use:
-
./schweikh2
+
./schweikh2
The program accepts up to 4 parameters:
The number of operators in the expression [default: 9]
@@ -152,11 +152,11 @@ Location: DE - Federal Republic of Germ
The goal value or 0/0 [default: 42]
Try:
-
./try.sh
+
./try.sh
What happens if you pass only three parameters like the below?
-
./schweikh2 15 1 0
+
./schweikh2 15 1 0
The author also suggests:
-
while:;dogrep-v'#' schweikh2.c;done
+
while :; do grep -v '#' schweikh2.c; done
(and we do too) which works with sh, bash, ksh and zsh as well. Press
ctrl-c to stop it. Observe how the try.sh script does this once to
make it easier to see what is happening.
@@ -164,9 +164,9 @@ make it easier to see what is happening.
The original program, with only slight obfuscations, may be found
in hunni.c. The perl script, hunni.pl, obfuscates it
appropriately. Try:
-
less hunni.c
-
-perl ./hunni.pl < hunni.c
+
less hunni.c
+
+ perl ./hunni.pl < hunni.c
This entry was another crowd pleaser at the IOCCC BOF.
Author’s remarks:
Note: the source must be viewed with tabstop 8. To appreciate the
@@ -230,16 +230,16 @@ operators but you will probably wait quite some time for every of the
on a 50 MHz SPARC, 4^11 expressions are evaluated in about 3 cpu
minutes (gcc -O3).
The diamond pattern can be continued without a break.
For a nice printout try this on your Bourne compatible shell:
-
while:;dogrep-v'#' schweikh2.c;done
+
while :; do grep -v '#' schweikh2.c; done
make all
```
@@ -12,7 +12,7 @@ It may render your system unusable for a limited amount of time
or force you to reboot using the Big Red Button! This is **NOT** a joke.
You have been warned.
-```sh
+```
./schweikh3
```
@@ -27,7 +27,7 @@ systems.
But still it is a useful utility. To use try:
-```sh
+```
./schweikh3
```
@@ -57,7 +57,7 @@ You have to select maximum ANSI C conformance of your
compiler. The source fails to compile under a C++ compiler due to
the `new' identifier which is a C++ reserved word:
-```sh
+```
$ g++ schweikh3.c
schweikh3.c:9: parse error before `new'
schweikh3.c:16: parse error before `new'
@@ -71,7 +71,7 @@ the `new' identifier which is a C++ reserved word:
The source fails to compile on compilers that recognize the inline
keyword by default, e.g. gcc:
-```sh
+```
$ gcc schweikh3.c
schweikh3.c:46: parse error before `void'
schweikh3.c: In function `main':
diff --git a/1996/schweikh3/index.html b/1996/schweikh3/index.html
index 5d7ff5350..3f003a2b5 100644
--- a/1996/schweikh3/index.html
+++ b/1996/schweikh3/index.html
@@ -141,20 +141,20 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
To use:
WARNING: DO NOT RUN this program without reading this text down to the end!
It may render your system unusable for a limited amount of time
or force you to reboot using the Big Red Button! This is NOT a joke.
You have been warned.
-
./schweikh3
+
./schweikh3
Judges’ remarks:
The source fails to compile on compilers that recognize the inline
keyword by default. For gcc, you may need to use -ansi.
See the file schweikh3.info for example output from various
systems.
But still it is a useful utility. To use try:
-
./schweikh3
+
./schweikh3
and thanks for the virtual memories! :-)
Author’s remarks:
Why I think my entry is obfuscated
@@ -171,22 +171,22 @@ COBOL, F77, awk etc.
You have to select maximum ANSI C conformance of your
compiler. The source fails to compile under a C++ compiler due to
the `new’ identifier which is a C++ reserved word:
-
$ g++ schweikh3.c
-schweikh3.c:9: parse error before `new'
- schweikh3.c:16: parse error before `new'
-schweikh3.c:46: parse error before `void'
- schweikh3.c:65: parse error before `Lisp'
-schweikh3.c:68: parse error before `;'
- [...]
- schweikh3.c:91: confused by earlier errors, bailing out
+
$ g++ schweikh3.c
+ schweikh3.c:9: parse error before `new'
+ schweikh3.c:16: parse error before `new'
+ schweikh3.c:46: parse error before `void'
+ schweikh3.c:65: parse error before `Lisp'
+ schweikh3.c:68: parse error before `;'
+ [...]
+ schweikh3.c:91: confused by earlier errors, bailing out
The source fails to compile on compilers that recognize the inline
keyword by default, e.g. gcc:
-
$ gcc schweikh3.c
-schweikh3.c:46: parse error before `void'
- schweikh3.c: In function `main':
-schweikh3.c:91: parse error before `inline'
- schweikh3.c: At top level:
- schweikh3.c:97: parse error before `void'
+
$ gcc schweikh3.c
+ schweikh3.c:46: parse error before `void'
+ schweikh3.c: In function `main':
+ schweikh3.c:91: parse error before `inline'
+ schweikh3.c: At top level:
+ schweikh3.c:97: parse error before `void'
The -ansi option to gcc fixes this.
The source fails to compile on obsolete systems with obsolete
memory models due to the identifier far (to be honest: this is
diff --git a/1996/westley/README.md b/1996/westley/README.md
index c48c14320..fbbc52e47 100644
--- a/1996/westley/README.md
+++ b/1996/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -11,7 +11,7 @@
## To use:
-```sh
+```
./clock1.sh
./clock2.sh
./clock3.sh
@@ -20,7 +20,7 @@
## Try:
-```sh
+```
./try.sh
```
@@ -34,14 +34,14 @@ provided, to show the differences.
### Alternate build:
-```sh
+```
make alt
```
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -81,7 +81,7 @@ larger.
The code is simple; the arguments passed are:
-```sh
+```
./westley minute_map hour_map hand_symbol clock_image
```
diff --git a/1996/westley/index.html b/1996/westley/index.html
index 5b656d3ea..2e03a92e2 100644
--- a/1996/westley/index.html
+++ b/1996/westley/index.html
@@ -141,24 +141,24 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is another version which is the original entry. See alternate
version for details as to how to use and why it was made the
alt version.
To use:
-
./clock1.sh
-./clock2.sh
-./clock3.sh
+
./clock1.sh
+ ./clock2.sh
+ ./clock3.sh
Try:
-
./try.sh
+
./try.sh
Alternate code:
The original version had a display problem in modern systems which somewhat
affected the usability of the program. This alternate code, the original, is
provided, to show the differences.
Alternate build:
-
make alt
+
make alt
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Time and time again, Brian Westley seems to come up with a winning entry!
We are amazed at how much is being done with only one relatively
@@ -183,7 +183,7 @@ my sample scripts.
These assumptions are pretty reasonable. 2) can be eliminated but makes the code
larger.
The program merely takes the minute (0-59) and the hour (0-23)
values, looks up the offsets in minute_map and hour_map
and writes the hand_symbol for each into the clock_image
diff --git a/1998/banks/README.md b/1998/banks/README.md
index 2d21fe3f9..636defc25 100644
--- a/1998/banks/README.md
+++ b/1998/banks/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -34,14 +34,14 @@ macros to, depending on what controls you wish to redefine. For instance, to set
the throttle up and down to `u` and `d`:
-```sh
+```
make clobber IT=XK_u DT=XK_d all
```
because in the header file you can see that `XK_u` corresponds to `u` and `XK_d`
corresponds to `d`:
-```c
+```
#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */
#define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */
```
@@ -63,7 +63,7 @@ preselected alternative keys.
## To use:
-```sh
+```
cat horizon.sc pittsburgh.sc | ./banks
```
@@ -106,7 +106,7 @@ the right side for movement. These are hard coded, as noted.
To use the default settings for the alternate build:
-```sh
+```
make alt
```
@@ -231,7 +231,7 @@ Here is a brief description of the scenery files:
A few examples of how to input scenery:
-```sh
+```
cat horizon.sc pittsburgh.sc | ./banks
cat mountains.sc bb.sc | ./banks
cat mountains.sc river.sc pyramids.sc | ./banks
@@ -240,7 +240,7 @@ A few examples of how to input scenery:
You can simulate flying through a cloud bank as well:
-```sh
+```
./banks < /dev/null
```
diff --git a/1998/banks/index.html b/1998/banks/index.html
index 1c259125b..ab345e273 100644
--- a/1998/banks/index.html
+++ b/1998/banks/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make all
+
make all
If you do not have a page up or page down key you might wish to see the
Alternate code section below. You may redefine all the keys
and the time step with predefined macros, however, so one lacking page up / page
@@ -164,11 +164,11 @@ Instructions section.
to use. The name of the macro in the header file is what you need to set the
macros to, depending on what controls you wish to redefine. For instance, to set
the throttle up and down to u and d:
-
make clobber IT=XK_u DT=XK_d all
+
make clobber IT=XK_u DT=XK_d all
because in the header file you can see that XK_u corresponds to u and XK_d
corresponds to d:
-
#define XK_d 0x0064/* U+0064 LATIN SMALL LETTER D */
-#define XK_u 0x0075/* U+0075 LATIN SMALL LETTER U */
+
#define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */
+ #define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */
Note that the keysym.h file is not complete from X11; it’s just the
more likely candidates (and some that are probably unlikely :-) ).
The upper case letters would be XK_U and XK_D and you can search the header
@@ -181,7 +181,7 @@ instructions. Since you can use the original entry to redefine these this is not
a problem and is purely a convenience .. if only for those who are okay with the
preselected alternative keys.
To use:
-
cat horizon.sc pittsburgh.sc |./banks
+
cat horizon.sc pittsburgh.sc | ./banks
See the author’s remarks in scenery for more details on the scenery
files.
Try:
@@ -208,7 +208,7 @@ you should use the original entry as described in the to build section above.
To use the default settings for the alternate build:
-
make alt
+
make alt
You may change the other keys as described in the build instructions, above, but
this alt code can be seen as an alternative for those who don’t have or don’t
want to use page up and page down.
You can simulate flying through a cloud bank as well:
-
./banks< /dev/null
+
./banks < /dev/null
You will usually want at least a horizon, though.
The format of scenery files is simple, by the way. They’re just
a list of 3D coordinates, and the simulator simply draws line
diff --git a/1998/bas1/README.md b/1998/bas1/README.md
index b15a680da..377fb73d8 100644
--- a/1998/bas1/README.md
+++ b/1998/bas1/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./bas1.sh
```
diff --git a/1998/bas1/index.html b/1998/bas1/index.html
index d6dd0aaba..265dd030c 100644
--- a/1998/bas1/index.html
+++ b/1998/bas1/index.html
@@ -141,9 +141,9 @@ Location: NL - Kingdom of the Netherlan
Can you determine the relationship between the input and the resulting numeric
diff --git a/1998/chaos/README.md b/1998/chaos/README.md
index 427d7d8f6..3570f3747 100644
--- a/1998/chaos/README.md
+++ b/1998/chaos/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make chaos
```
@@ -8,21 +8,21 @@ NOTE: Some systems do not implement `halfdelay()` in their `libcurses`.
You might try compiling with -lncurses if you have that library.
Or you can build this entry without the `halfdelay()` call by:
-```sh
+```
make chaos_nohalf
```
## To use:
-```sh
+```
./chaos
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1998/chaos/index.html b/1998/chaos/index.html
index 0b3dfc548..0bf5dd6c7 100644
--- a/1998/chaos/index.html
+++ b/1998/chaos/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
To build:
-
make chaos
+
make chaos
NOTE: Some systems do not implement halfdelay() in their libcurses.
You might try compiling with -lncurses if you have that library.
Or you can build this entry without the halfdelay() call by:
-
make chaos_nohalf
+
make chaos_nohalf
To use:
-
./chaos
+
./chaos
Try:
-
./try.sh
+
./try.sh
This script will run the program on each data file. To quit the program hit q.
If not all files have been used it will go to the next one; otherwise the script
will be finished. To end the script early send intr/ctrl-c.
diff --git a/1998/df/README.md b/1998/df/README.md
index 7fc3dd43f..a9b3a5626 100644
--- a/1998/df/README.md
+++ b/1998/df/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./df
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/1998/df/index.html b/1998/df/index.html
index 0d0806f77..4aee89502 100644
--- a/1998/df/index.html
+++ b/1998/df/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./df
+
./df
Try:
-
./try.sh
+
./try.sh
This will run the program in a loop until you exit (q when prompted or
ctrl-c/intr).
Can you figure out a very simple pipeline to cheat?
diff --git a/1998/dlowe/README.md b/1998/dlowe/README.md
index f1e1bca73..421244af9 100644
--- a/1998/dlowe/README.md
+++ b/1998/dlowe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -10,7 +10,7 @@ below for more details.
## To use:
-```sh
+```
./dlowe < file > pootfile
./dlowe < file
@@ -30,7 +30,7 @@ For more detailed information see [1998 dlowe bugs](../../bugs.html#1998_dlowe).
## Try:
-```sh
+```
./dlowe < README.md
./dlowe < README.md > README.poot.md
```
@@ -39,7 +39,7 @@ Why is there different output?
Also try:
-```sh
+```
./try.sh
```
@@ -54,7 +54,7 @@ that program.
### Alternate build:
-```sh
+```
make alt
```
@@ -70,7 +70,7 @@ What's the difference between this and `dlowe`?
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -93,7 +93,7 @@ more consistent level of quality. :-)
A CGI script such as:
-```sh
+```
#!/bin/sh
# pootify - a sample CGI pootifier
#
@@ -131,7 +131,7 @@ should use the above one instead. You can use the script
[pootify.sh](pootify.sh), however, to download and generate html files that you
can look at locally in a browser or pipe through `less(1)`. For instance:
-```sh
+```
./pootify.sh URL=https://microsoft.com | less
./pootify.sh -r URL=https://microsoft.com > ms.html
@@ -143,7 +143,7 @@ it in a browser.
For an old example of it working as a CGI script see:
-```sh
+```
https://web.archive.org/web/20040326083431/http://www.pootpoot.com/poot/pootify/?URL=http%3A%2F%2Fwww.ioccc.org
```
diff --git a/1998/dlowe/index.html b/1998/dlowe/index.html
index 97c2f4093..8c09dd812 100644
--- a/1998/dlowe/index.html
+++ b/1998/dlowe/index.html
@@ -141,34 +141,34 @@ Location: US - United States of America
To build:
-
make all
+
make all
There is an alternate version available. See Alternate code
below for more details.
To use:
-
./dlowe< file > pootfile
-
-./dlowe< file
+
./dlowe < file > pootfile
+
+ ./dlowe < file
Bugs and (Mis)features:
The current status of this entry is:
STATUS: missing or dead link - please provide them
#!/bin/sh
-# pootify - a sample CGI pootifier
-#
-POOT="/usr/local/bin/dlowe"
-LYNX="/usr/local/bin/lynx"
-ECHO="/usr/bin/echo"
-EXPR="/usr/bin/expr"
-${ECHO}"Content-type: text/html"
-${ECHO}
-if[-z"${QUERY_STRING}"];then
-${ECHO}"QUERY_STRING not found"
-else
-URL=`${EXPR}"$QUERY_STRING" : '[Uu][Rr][Ll]=\(.*\)'`
-if[-z"${URL}"];then
-${ECHO}"No URL given in QUERY_STRING"
-elif[ X`${EXPR}"${URL}" : '[Ff][Ii][Ll][Ee]:'`!= X0 ];then
-${ECHO}"file: based URLs are not allowed"
-else
-${LYNX}-restrictions=all -source"${URL}"|${POOT}
-fi
-fi
+
#!/bin/sh
+ # pootify - a sample CGI pootifier
+ #
+ POOT="/usr/local/bin/dlowe"
+ LYNX="/usr/local/bin/lynx"
+ ECHO="/usr/bin/echo"
+ EXPR="/usr/bin/expr"
+ ${ECHO} "Content-type: text/html"
+ ${ECHO}
+ if [ -z "${QUERY_STRING}" ]; then
+ ${ECHO} "QUERY_STRING not found"
+ else
+ URL=`${EXPR} "$QUERY_STRING" : '[Uu][Rr][Ll]=\(.*\)'`
+ if [ -z "${URL}" ]; then
+ ${ECHO} "No URL given in QUERY_STRING"
+ elif [ X`${EXPR} "${URL}" : '[Ff][Ii][Ll][Ee]:'` != X0 ]; then
+ ${ECHO} "file: based URLs are not allowed"
+ else
+ ${LYNX} -restrictions=all -source "${URL}" | ${POOT}
+ fi
+ fi
can be used to pootify web pages. This has been added as
pootify.cgi.sh which forbids file:// based URLs and which
uses lynx(1) with the option referred to above. This will not, of course,
@@ -212,14 +212,14 @@ added bonus that one can use file:// URLs. If one wants a CGI scrip
should use the above one instead. You can use the script
pootify.sh, however, to download and generate html files that you
can look at locally in a browser or pipe through less(1). For instance:
where the first one would show the text as rendered but without links, images
etc. and the second one would write the html to ms.html so that you could open
it in a browser.
For an old example of it working as a CGI script see:
This program is a text filter, it reads stdin and outputs the
“corrected” text to stdout.
diff --git a/1998/dloweneil/README.md b/1998/dloweneil/README.md
index 84603bc6e..4cf455f44 100644
--- a/1998/dloweneil/README.md
+++ b/1998/dloweneil/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -22,7 +22,7 @@ For more detailed information see [1998 dloweneil bugs](../../bugs.html#1998_dlo
## To use:
-```sh
+```
./pootris [X size of board] [Y size of board]
```
@@ -45,14 +45,14 @@ clockwise `l` does as well. Instead of using `d` to drop the letter you can do
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./pootris.alt [X size of board] [Y size of board]
```
@@ -73,7 +73,7 @@ experience may mirror one of our experiences:
### Usage
-```sh
+```
./pootris [X size of board] [Y size of board]
```
diff --git a/1998/dloweneil/index.html b/1998/dloweneil/index.html
index 412878c48..0a74e6e9e 100644
--- a/1998/dloweneil/index.html
+++ b/1998/dloweneil/index.html
@@ -144,7 +144,7 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
There is an alternate version available that has a key configuration that will
be more familiar to vi(m) users and also allows one to quit. See alternate
code below.
@@ -153,7 +153,7 @@ code below.
STATUS: missing or dead link - please provide them
Pressing a moves the current letter position counterclockwise/anticlockwise
(a)round the border of the playing field.
Pressing s moves the current letter one position clockwise around the border
@@ -165,9 +165,9 @@ counterclockwise/anticlockwise h does as well; and in addition to <
clockwise l does as well. Instead of using d to drop the letter you can do
j or space. Finally to quit this version you can press q.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./pootris.alt [X size of board] [Y size of board]
+
./pootris.alt [X size of board] [Y size of board]
Judges’ remarks:
Read the authors’ remarks below to find out how to play. We believe that your
experience may mirror one of our experiences:
@@ -176,7 +176,7 @@ experience may mirror one of our experiences:
I spelled my first "poot". I was hooked ...
Author’s remarks:
Usage
-
./pootris [X size of board] [Y size of board]
+
./pootris [X size of board] [Y size of board]
Synopsis
The object of this game is to spell POOT as much as possible. There
is no time pressure. You’re given one letter at a time (sort of randomly
diff --git a/1998/dorssel/README.md b/1998/dorssel/README.md
index 7d5da726a..565f286b3 100644
--- a/1998/dorssel/README.md
+++ b/1998/dorssel/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./dorssel
# input some text
@@ -17,7 +17,7 @@
## Try:
-```sh
+```
./try.sh
```
@@ -48,7 +48,7 @@ altering the behavior ?
Try doing what the last part of the last command in [try.sh](try.sh) suggests.
As in, do the following:
-```sh
+```
echo ". -..- . .-. -.-. .. ... .
-.-. .... .- -. --. . - .... . .--. .-. --- --. .-. .- -- ... --- .. - -.. --- . ... -. --- - ... .... --- ..- -" | ./dorssel
```
@@ -91,7 +91,7 @@ invoke undefined behavior.
Try:
-```sh
+```
./dorssel < dorssel.c | ./dorssel
```
@@ -101,20 +101,20 @@ better job than most C beautifiers).
- Filter your text twice (as in the previous sample) to obtain a version of your
text that can be reversibly Morsified, i.e.
-```sh
+```
./dorssel < dorssel.c | ./dorssel | ./dorssel | ./dorssel
```
is the same as
-```sh
+```
./dorssel < dorssel.c | ./dorssel
```
- The file [dorssel.md](dorssel.md) contains all the information needed to
understand this program. For an obfuscated spoiler, try
-```sh
+```
./dorssel < dorssel.md
```
diff --git a/1998/dorssel/dorssel.html b/1998/dorssel/dorssel.html
index 3ba18fb14..6752e93bf 100644
--- a/1998/dorssel/dorssel.html
+++ b/1998/dorssel/dorssel.html
@@ -150,11 +150,11 @@ two bits would suffice, e.g.
That means bits 6 and 5 set to 00 is length 1, set to 01 is length 2, etc.
But this would mean that we would have to extract the length into a
counter before shifting out each symbol, such as
do {
+ putchar(encoding & 1 ? '-' : '.');
+ encoding >>= 1;
+ while (encoding > 1);
As you see, the encoded Morse sequence can be the counter itself. But
this is not very pleasant, as some Morse sequences will end up having
an ASCII value < 32, i.e. they will be control codes. This would make
@@ -179,21 +179,21 @@ following
Notice these encodings in the initialization string. Only the coding for
5 needs an escape (5 = ..... > 01111111 = '\177'). The way the length
is encoded still allows the encoding to be its own counter:
The last shift will always result in 00100010, hence the test for >35.
Note that the calculation for the next value of encoding is done at int
precision, so that the actual value of the char remains <= 127.
The character '-' (ASCII 45) and '.' (ASCII 46) are conveniently in
sequence, so the putchar can simply be
-
putchar(45+ encoding %2);
+
putchar(45 + encoding % 2);
I used the modulo operator this time, because + takes precedence over &.
The assignment can be incorporated into the while control test, and a
do-while loop with a body of a single expression statement can be written
as a while loop with a comma operator in the test:
Now, the decoding of Morse codes is just the reverse. We shift in 0s
and 1s as we scan the line. But: we have to scan from back to front
diff --git a/1998/dorssel/dorssel.md b/1998/dorssel/dorssel.md
index 202f74b6c..189745f1e 100644
--- a/1998/dorssel/dorssel.md
+++ b/1998/dorssel/dorssel.md
@@ -42,7 +42,7 @@ That means bits 6 and 5 set to 00 is length 1, set to 01 is length 2, etc.
But this would mean that we would have to extract the length into a
counter before shifting out each symbol, such as
-```c
+```
length = (encoding & 96) >> 5;
do {
putchar(encoding & 1 ? '-' : '.');
@@ -62,7 +62,7 @@ We can also use the remaining bits to *include* the counter
with 1 bit still to be chosen freely (let's assume it is 0). Now we can do
-```c
+```
do {
putchar(encoding & 1 ? '-' : '.');
encoding >>= 1;
@@ -87,7 +87,7 @@ Notice these encodings in the initialization string. Only the coding for
`5` needs an escape (`5 = ..... > 01111111 = '\177'`). The way the length
is encoded still allows the encoding to be its own counter:
-```c
+```
do {
putchar(encoding & 1 ? '-' : '.');
encoding = (encoding + 32) >> 1;
@@ -101,7 +101,7 @@ precision, so that the actual value of the `char` remains `<= 127`.
The character `'-'` (ASCII 45) and `'.'` (ASCII 46) are conveniently in
sequence, so the putchar can simply be
-```c
+```
putchar(45 + encoding % 2);
```
@@ -110,7 +110,7 @@ The assignment can be incorporated into the `while` control test, and a
`do-while` loop with a body of a single expression statement can be written
as a `while` loop with a comma operator in the test:
-```c
+```
while(putchar(45 + encoding % 2), encoding = encoding + 32 >> 1);
```
diff --git a/1998/dorssel/index.html b/1998/dorssel/index.html
index 717e14647..dc4050613 100644
--- a/1998/dorssel/index.html
+++ b/1998/dorssel/index.html
@@ -141,14 +141,14 @@ Location: ZZ - Unknown location
To build:
-
make all
+
make all
To use:
-
./dorssel
-# input some text
-
-echo text |./dorssel
+
./dorssel
+ # input some text
+
+ echo text | ./dorssel
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
How does the program decide which way to convert?
What obsolescent feature are we talking about? (No, it’s not a
@@ -166,8 +166,8 @@ altering the behavior ?
Extra credit:
Try doing what the last part of the last command in try.sh suggests.
As in, do the following:
The file dorssel.md contains all the information needed to
understand this program. For an obfuscated spoiler, try
-
./dorssel< dorssel.md
+
./dorssel < dorssel.md
make all
```
@@ -10,7 +10,7 @@ this entry because of the system resources it requires.
## To use:
-```sh
+```
./fanf
```
@@ -19,7 +19,7 @@ this entry because of the system resources it requires.
Enter an expression on standard input. To try some we have selected:
-```sh
+```
./try.sh
```
@@ -47,7 +47,7 @@ can you begin to understand what it is doing?
Look at the first stage of the C pre-processing which was done like:
-```sh
+```
cc fanf.c -E > fanftmp1.c
```
diff --git a/1998/fanf/index.html b/1998/fanf/index.html
index 343ca2462..0b97d488a 100644
--- a/1998/fanf/index.html
+++ b/1998/fanf/index.html
@@ -141,14 +141,14 @@ Location: GB - United Kingdom of Great
To build:
-
make all
+
make all
NOTE: this may take a while. Some systems may have problems building
this entry because of the system resources it requires.
To use:
-
./fanf
+
./fanf
Try:
Enter an expression on standard input. To try some we have selected:
-
./try.sh
+
./try.sh
Judges’ remarks:
Historical aside:
At a time the code in fanf.c was that of fanf.orig.c
@@ -165,7 +165,7 @@ source.
fanftmp2.c C program. Take a look at that final C program again,
can you begin to understand what it is doing?
Look at the first stage of the C pre-processing which was done like:
-
cc fanf.c -E> fanftmp1.c
+
cc fanf.c -E > fanftmp1.c
Skip to the bottom of fanftmp1.c (after all of the C pre-processor header
stuff … look for a line of the form: # 38 "fanf.c" near the bottom)
and look at the resulting code. This code, when C pre-processed
diff --git a/1998/schnitzi/README.md b/1998/schnitzi/README.md
index f088cdb61..cbf0e96d1 100644
--- a/1998/schnitzi/README.md
+++ b/1998/schnitzi/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [1998 schnitzi bugs](../../bugs.html#1998_schn
## To use:
-```sh
+```
./schnitzi n > sort.c
make sort
./sort
@@ -32,14 +32,14 @@ where `n` and `x`, `y` and `z` are numbers.
## Try:
-```sh
+```
./try.sh
```
What happens if at the command line you don't specify `n` numbers that the
program expects? For instance try:
-```sh
+```
./schnitzi 5 > sort.c
make sort
@@ -99,7 +99,7 @@ a depth of one.
So what does it do? Give it an integer `(1 < n < 27)` on the command
line, such as
-```sh
+```
./schnitzi 5
```
@@ -109,7 +109,7 @@ them, however, using only `if/else` statements, without arrays or
looping. To see the resulting program run, redirect the output from
`schnitzi` into another file, like this
-```sh
+```
./schnitzi 4 > sort.c
```
diff --git a/1998/schnitzi/index.html b/1998/schnitzi/index.html
index a4c1b34a3..933ffa12f 100644
--- a/1998/schnitzi/index.html
+++ b/1998/schnitzi/index.html
@@ -141,28 +141,28 @@ Location: ZZ - Unknown location
./schnitzi n > sort.c
-make sort
-./sort
-# enter three numbers, space separated
-
-echo x y z |./sort
+
./schnitzi n > sort.c
+ make sort
+ ./sort
+ # enter three numbers, space separated
+
+ echo x y z | ./sort
where n and x, y and z are numbers.
Try:
-
./try.sh
+
./try.sh
What happens if at the command line you don’t specify n numbers that the
program expects? For instance try:
-
./schnitzi 5 > sort.c
-make sort
-
-# try running the next command four or five times:
-echo 2 5 3 1 |./sort
+
./schnitzi 5 > sort.c
+ make sort
+
+ # try running the next command four or five times:
+ echo 2 5 3 1 | ./sort
Why does this happen?
Judges’ remarks:
This is a beautiful program. How can a program with no conditional (except for
@@ -201,13 +201,13 @@ memory capacity, since the function call stack never goes beyond
a depth of one.
So what does it do? Give it an integer (1 < n < 27) on the command
line, such as
-
./schnitzi 5
+
./schnitzi 5
The output will itself be a lipographic program, one which expects input of
(in this case) five numbers and prints them out sorted. It sorts
them, however, using only if/else statements, without arrays or
looping. To see the resulting program run, redirect the output from
schnitzi into another file, like this
-
./schnitzi 4 > sort.c
+
./schnitzi 4 > sort.c
and then compile it.
Spoilers And Hints:
The big key to this program is figuring out what the names of the
diff --git a/1998/schweikh1/README.md b/1998/schweikh1/README.md
index 6497f2aae..c70e413e5 100644
--- a/1998/schweikh1/README.md
+++ b/1998/schweikh1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -12,7 +12,7 @@ includes some interesting details about the entry.
## To use:
-```sh
+```
./schweikh1
```
@@ -30,7 +30,7 @@ if you don't have a Mac as it has some interesting details about the entry.
### Alternate build:
-```sh
+```
make alt
```
@@ -126,7 +126,7 @@ macros can be defined, because you could write strictly conforming
programs that may fail to compile due to syntax errors: supposing that
`` defines `PIPE_BUF`, then the conforming
-```c
+```
#include
#include /* <- or where the bogus macro is defined */
#include
@@ -155,7 +155,7 @@ C compilers.
must resemble one of the canonical forms, `"foo.h"` or ``.
This lets us write things like
-```c
+```
#define HEADER "foo.h"
#include HEADER
```
@@ -164,7 +164,7 @@ C compilers.
torturing the preprocessor a little more, by using token pasting,
at least one compiler falls over.
-```c
+```
#define H(x)
#include H(dio) /* expands to */
```
@@ -187,7 +187,7 @@ C compilers.
ISO 6.8.4. ISO 6.1.4 defines string literals as s-char-sequences,
which may include octal escape sequences. Let's look at
-```c
+```
#include
#line 42 "foo\0bar"
int main (void) {
@@ -214,7 +214,7 @@ C compilers.
under his/her nose. Easy money from a bet! Make sure your guru has
no chance to use Standardese weasel words as an escape: can I have
-```c
+```
case :
case :
```
@@ -255,7 +255,7 @@ script to compute the character count according to the rules.
The advantages of an independent clean room approach...
-```perl
+```
#!/usr/bin/perl -w
$/ = "\0";
$_ = <>;
@@ -266,7 +266,7 @@ The advantages of an independent clean room approach...
To use, try:
-```sh
+```
perl ./charcount.pl schweikh1.c
```
diff --git a/1998/schweikh1/index.html b/1998/schweikh1/index.html
index 98548f7c8..a33680129 100644
--- a/1998/schweikh1/index.html
+++ b/1998/schweikh1/index.html
@@ -141,13 +141,13 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
There is an alternate version of this entry that will work with macOS. See the
Alternate code section below. We recommend you look at it
even if you don’t have a Mac, unless you want to figure it out yourself, as it
includes some interesting details about the entry.
@@ -220,17 +220,17 @@ macros are explicitly enumerated. In a compliant implementation no other
macros can be defined, because you could write strictly conforming
programs that may fail to compile due to syntax errors: supposing that
<stdio.h> defines PIPE_BUF, then the conforming
-
#include <assert.h>
-#include <stdio.h>/* <- or where the bogus macro is defined */
-#include <string.h>
-#define STR(x)#x
-#define XSTR(x) STR(x)
-int main (void)
-{
-int PIPE_BUF =0;
- assert (strcmp ("PIPE_BUF", XSTR (PIPE_BUF))==0);
-return0;
-}
+
#include <assert.h>
+ #include <stdio.h> /* <- or where the bogus macro is defined */
+ #include <string.h>
+ #define STR(x) #x
+ #define XSTR(x) STR(x)
+ int main (void)
+ {
+ int PIPE_BUF = 0;
+ assert (strcmp ("PIPE_BUF", XSTR (PIPE_BUF)) == 0);
+ return 0;
+ }
is expected to compile and meet the assertion. If it does not, your
compiler compiles some other language than ISO C.
Why I think my program is obfuscated
@@ -243,13 +243,13 @@ C compilers.
must resemble one of the canonical forms, "foo.h" or <bar.h>.
This lets us write things like
-
#define HEADER "foo.h"
-#include HEADER
+
#define HEADER "foo.h"
+ #include HEADER
I could not find a compiler rejecting this. However, if we’re
torturing the preprocessor a little more, by using token pasting,
at least one compiler falls over.
-
#define H(x)<st##x##.h>
-#include H(dio) /* expands to <stdio.h> */
is rejected by tcc version 4.1.2, the TenDRA compiler:
"t.c", line 3: Error:\ [ISO 6.8.3.3]: Invalid result for '##' operator in macro 'H'.
To be honest, I don’t know if the rules for pp-tokens and token
@@ -264,12 +264,12 @@ allows: in #line num "file" the "file" is an s-char-se
ISO 6.8.4. ISO 6.1.4 defines string literals as s-char-sequences,
which may include octal escape sequences. Let’s look at
-
This is supposed to output 'foo 8'. Here’s what happens in RL:
foo 4 gcc 2.7.2.1, lcc
foo\0bar 9 tcc 4.1.2, Sunsoft cc turn "\0" into "\\0", ugh!
@@ -283,8 +283,8 @@ ISO 6.6.4.2. Then make fun of the guru’s answer by waving case __LINE__:
under his/her nose. Easy money from a bet! Make sure your guru has
no chance to use Standardese weasel words as an escape: can I have
-
case<some_token>:
-case<some_token>:
+
case <some_token>:
+ case <some_token>:
in the same switch? (Note that you need the [invisible] newline. You
can generously allow the additional constraint that no #undefs or
#defines are allowed between the two cases.)
@@ -315,14 +315,14 @@ I could have used a lot more ^K and ^L probably undete
counter but decided to err on the side of safety. I use a perl
script to compute the character count according to the rules.
The advantages of an independent clean room approach…
-
I have tried, as suggested in the guidelines, to let the code look
like ordinary C code. Apart from a few long lines I think I left
the indentation like I would in RL. You should however not try to
diff --git a/1998/schweikh1/macos.html b/1998/schweikh1/macos.html
index cb10eee28..3590c5fdf 100644
--- a/1998/schweikh1/macos.html
+++ b/1998/schweikh1/macos.html
@@ -138,7 +138,7 @@ a file was not found (this limitation was removed in both versions in 2023). see
However, as noted, macOS does not have /usr/include so this would never
work for macOS without some changes, described next. For macOS you will need the
command line tools installed which can be done like:
-
sudo xcode-select --install
+
sudo xcode-select --install
An important point is that the original version hard-coded gcc but just like
the entry, the alternate version has also removed this limitation despite gcc
existing (though it’s clang) in macOS.
if ((H = fopen (__FILE__+43, 43+__FILE__)))
+ while ((fgets (L, (int)sizeof L, H)) != 0) {
+ I[strcspn (I, 45+__FILE__)] = O = 0;
The first number in the above C means the length starting from 0 up through the
>. The second number is the same starting point but up through the \0 which
is why it’s +2. But what happens if only the first number is updated (from the
diff --git a/1998/schweikh1/macos.md b/1998/schweikh1/macos.md
index ef18d9c0c..29187e070 100644
--- a/1998/schweikh1/macos.md
+++ b/1998/schweikh1/macos.md
@@ -19,7 +19,7 @@ However, as noted, macOS does **not** have `/usr/include` so this would never
work for macOS without some changes, described next. For macOS you will need the
command line tools installed which can be done like:
-```sh
+```
sudo xcode-select --install
```
@@ -50,7 +50,7 @@ which has been changed to be:
Shortly below that you will see, as noted above, the numbers:
-```c
+```
if ((H = fopen (__FILE__+43, 43+__FILE__)))
while ((fgets (L, (int)sizeof L, H)) != 0) {
I[strcspn (I, 45+__FILE__)] = O = 0;
diff --git a/1998/schweikh2/README.md b/1998/schweikh2/README.md
index 2f7ed9b0e..5ad2fa7a1 100644
--- a/1998/schweikh2/README.md
+++ b/1998/schweikh2/README.md
@@ -1,26 +1,26 @@
## To build:
-```sh
+```
make all
```
## To use:
-```sh
+```
./yarng
```
or
-```sh
+```
./yarng integer_number
```
## Try:
-```sh
+```
./try.sh
./yarng
@@ -42,13 +42,13 @@ At the time of judging, some non-gcc compilers that were not fully ANSI standard
did not compile this entry correctly. Also at that time, some gcc and egcs
implementations ran into a problem when building the entry. Doing:
-```sh
+```
make schweikh2
```
often produced an error of the form:
-```sh
+```
gcc -ansi schweikh2.alt.c -o schweikh2.alt
as: Error: cca00NzV.s, line 58: Missing " at end of string
"
@@ -58,20 +58,20 @@ often produced an error of the form:
because the line:
-```c
+```
#line 10 ONE(O(1,1,2,6,0,6))
```
turned into the line:
-```c
+```
# 9 "01\012"
```
(note, though, how that line is on line 11) which caused gcc to give to the
assembler the following two lines:
-```asm
+```
.stabs "schweikh2.c
",132,0,0,Ltext1
```
@@ -80,7 +80,7 @@ and the lone `"` after the `#.file` line resulted in an assembly syntax error.
In some cases one had to compile using `gcc -g`:
-```sh
+```
make schweikh2 CFLAGS=-g
```
@@ -105,7 +105,7 @@ still can :-) ).
Because of this bug, the code was changed to be instead:
-```c
+```
#line 10 "01\015"
```
@@ -122,13 +122,13 @@ compiler error:
so the line:
-```c
+```
#line 10 "01\015"
```
was changed to:
-```c
+```
#line 10 ONE(O(1,1,2,6,0,6))
```
@@ -158,7 +158,7 @@ different values? How long would you need for an empirical test?
For example:
-```sh
+```
$ ./yarng 32
10111001010101110110010101001111
$ ./yarng 5
diff --git a/1998/schweikh2/index.html b/1998/schweikh2/index.html
index f89d07d45..180b4bca7 100644
--- a/1998/schweikh2/index.html
+++ b/1998/schweikh2/index.html
@@ -141,16 +141,16 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
To use:
-
./yarng
+
./yarng
or
-
./yarng integer_number
+
./yarng integer_number
Try:
-
./try.sh
-
-./yarng
-# watch what it does
+
./try.sh
+
+ ./yarng
+ # watch what it does
What is the difference between what is in the script and running yarng without
an arg?
Judges’ remarks:
@@ -160,24 +160,24 @@ results different? Why?
At the time of judging, some non-gcc compilers that were not fully ANSI standard
did not compile this entry correctly. Also at that time, some gcc and egcs
implementations ran into a problem when building the entry. Doing:
-
make schweikh2
+
make schweikh2
often produced an error of the form:
-
gcc-ansi schweikh2.alt.c -o schweikh2.alt
-as: Error: cca00NzV.s, line 58: Missing " at end of string
- "
-as: Error: cca00NzV.s, line 58: malformed statement
-*** Error code 1 (bu21)
+
gcc -ansi schweikh2.alt.c -o schweikh2.alt
+ as: Error: cca00NzV.s, line 58: Missing " at end of string
+ "
+ as: Error: cca00NzV.s, line 58: malformed statement
+ *** Error code 1 (bu21)
because the line:
-
#line 10 ONE(O(1,1,2,6,0,6))
+
#line 10 ONE(O(1,1,2,6,0,6))
turned into the line:
-
# 9 "01\012"
+
# 9 "01\012"
(note, though, how that line is on line 11) which caused gcc to give to the
assembler the following two lines:
-
.stabs "schweikh2.c
- ",132,0,0,Ltext1
+
.stabs "schweikh2.c
+ ",132,0,0,Ltext1
and the lone " after the #.file line resulted in an assembly syntax error.
In some cases one had to compile using gcc -g:
-
make schweikh2 CFLAGS=-g
+
make schweikh2 CFLAGS=-g
to trigger this error.
With the proper text beyond the \012, it was even possible to have all kinds
of fun adding inline assembly via #line directives. :-)
@@ -191,7 +191,7 @@ for that matter :-) ).
you could have emailed the author for a free pat on the back (and maybe you
still can :-) ).
Because of this bug, the code was changed to be instead:
-
#line 10 "01\015"
+
#line 10 "01\015"
However in 2023 it was observed that it is gcc (at least some versions?) that
has a problem with the compilation of the modified program, giving an internal
compiler error:
@@ -223,10 +223,10 @@ bits may be specified by an argument and defaults either to UINT_MAXUINT_MAX+1 (most likely). Extra credit: why the
different values? How long would you need for an empirical test?
diff --git a/1998/schweikh3/README.md b/1998/schweikh3/README.md
index 5b9f48e6e..704acf525 100644
--- a/1998/schweikh3/README.md
+++ b/1998/schweikh3/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -23,7 +23,7 @@ If `dir` is the directory (or a directory tree) where you keep
all your favorite pictures off the Internet or from
`alt.binaries.pictures.*`, do
-```sh
+```
find dir -type f -print | ./samefile
```
@@ -34,7 +34,7 @@ Maybe you will not need to buy another 10 GB disk to store them. :-)
If you're in this winning entry's directory:
-```sh
+```
./try.sh
```
@@ -53,7 +53,7 @@ which if (in the code) is unset will be set to the default, 32767.
If you wish to change the size to say, 55555:
-```sh
+```
make clobber SIZE=55555 alt
```
@@ -83,7 +83,7 @@ Thank God the IEEE does not standardize a coding style...
This is best explained in the man page. The troff source for this
man page can be found in the file [samefile.1](samefile.1). To render try:
-```sh
+```
`man ./samefile.1
```
@@ -100,7 +100,7 @@ Otherwise:
#### SYNOPSIS
-```sh
+```
./samefile
```
@@ -141,7 +141,7 @@ inode numbers is also minimized. Suppose you have six
identical files of size 100 in an inode group consisting
of the three inodes with numbers 10, 20 and 30:
-```sh
+```
$ ls -i # output edited for readability:
10 file1 20 file4 30 file6
10 file2 20 file5
@@ -177,7 +177,7 @@ For everybody:
What are the duplicates under my home directory?
-```sh
+```
find $HOME | ./samefile
```
@@ -185,14 +185,14 @@ For the sysadmin folks:
Report all duplicate files under /usr larger than 16k:
-```sh
+```
find /usr -size +16384c -a -type f | ./samefile
```
For the ftp and WWW admins:
How much space is wasted below our site's /pub directory?
-```sh
+```
find /pub -type f | samefile | awk '{sum += $1} END {print sum}'
```
diff --git a/1998/schweikh3/index.html b/1998/schweikh3/index.html
index f4b75609c..e55c1fef1 100644
--- a/1998/schweikh3/index.html
+++ b/1998/schweikh3/index.html
@@ -141,7 +141,7 @@ Location: DE - Federal Republic of Germ
To build:
-
make all
+
make all
The author stated:
In the remote event that the input has more than `8192` files with
the same size (on systems where `sizeof (char *) == 4`, or `4096` when
@@ -153,11 +153,11 @@ code below.
If dir is the directory (or a directory tree) where you keep
all your favorite pictures off the Internet or from
alt.binaries.pictures.*, do
-
find dir -type f -print|./samefile
+
find dir -type f -print | ./samefile
Maybe you will not need to buy another 10 GB disk to store them. :-)
Try:
If you’re in this winning entry’s directory:
-
./try.sh
+
./try.sh
Notice that the tool finds some files that are duplicates.
Alternate code:
If you run into the problem that the author described (above) you can redefine
@@ -165,7 +165,7 @@ the size as described; this was done with the SZ macro defined in t
which if (in the code) is unset will be set to the default, 32767.
Alternate build:
If you wish to change the size to say, 55555:
-
make clobber SIZE=55555 alt
+
make clobber SIZE=55555 alt
or whatever you wish to redefine it to.
Judges’ remarks:
This program is not as smart as to detect identity of JPEG files with the same
@@ -181,13 +181,13 @@ Thank God the IEEE does not standardize a coding style…
What this program does
This is best explained in the man page. The troff source for this
man page can be found in the file samefile.1. To render try:
-
`man ./samefile.1
+
`man ./samefile.1
Otherwise:
SAMEFILE(1) User Manuals SAMEFILE(1)
NAME
samefile - find identical files
SYNOPSIS
-
./samefile
+
./samefile
DESCRIPTION
samefile reads a list of file names (one file name per
line) from stdin. For each file name pair with identical
@@ -219,13 +219,13 @@ the output for a group of identical files with different
inode numbers is also minimized. Suppose you have six
identical files of size 100 in an inode group consisting
of the three inodes with numbers 10, 20 and 30:
The sum of the sizes in the first column is the amount of
disk space you could gain by making all 6 files links to
only one file or remove all but one of the files. To be
@@ -245,13 +245,13 @@ more than a couple dozen files of the same size.
EXAMPLES
For everybody:
What are the duplicates under my home directory?
-
find$HOME|./samefile
+
find $HOME | ./samefile
For the sysadmin folks:
Report all duplicate files under /usr larger than 16k:
-
find /usr -size +16384c -a-type f |./samefile
+
find /usr -size +16384c -a -type f | ./samefile
For the ftp and WWW admins:
How much space is wasted below our site’s /pub directory?
-
find /pub -type f |samefile|awk'{sum += $1} END {print sum}'
+
find /pub -type f | samefile | awk '{sum += $1} END {print sum}'
EXIT STATUS
If samefile runs out of memory the exit status is 1, zero
otherwise.
filename : file to calculate the CRC of
bitwidth : width of the CRC in bits (decimal)
@@ -152,7 +152,7 @@ Location: ZZ - Unknown location
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
If you don’t believe the program is correct, try and compare the output
of the program with the value of CRCs computed by PKZIP or any other
@@ -169,13 +169,13 @@ archiver that uses the CRC-32 algorithm.
xor : value to xor the final CRC with (hexadecimal)
The program assumes CHAR_BIT==8. Results are undefined if bitwidth > sizeof(unsigned long) * 8. It is also assumed that EOF is -1 and 1 is a
valid exit value to indicate failure (replace them with EOF resp.
diff --git a/2000/anderson/README.md b/2000/anderson/README.md
index f215bbee9..1493b58a8 100644
--- a/2000/anderson/README.md
+++ b/2000/anderson/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
echo something | ./anderson
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2000/anderson/index.html b/2000/anderson/index.html
index b3f21a1e7..c4a1c7bf1 100644
--- a/2000/anderson/index.html
+++ b/2000/anderson/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
To use:
-
echo something |./anderson
+
echo something | ./anderson
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This small program might be a nice addition to a digital personal
organizer; just in case you are stranded on a desert island and need to
diff --git a/2000/bellard/README.md b/2000/bellard/README.md
index 91e212529..1b04c374f 100644
--- a/2000/bellard/README.md
+++ b/2000/bellard/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./bellard
```
diff --git a/2000/bellard/index.html b/2000/bellard/index.html
index 7e5fde649..c99e87691 100644
--- a/2000/bellard/index.html
+++ b/2000/bellard/index.html
@@ -141,9 +141,9 @@ Location: FR - French Republic (
To build:
-
make
+
make
To use:
-
./bellard
+
./bellard
Judges’ remarks:
This code is a nice compact example of a Modular Fast Fourier Transform. While
its output is very specific, the internal FFT has a wide variety of uses.
diff --git a/2000/bmeyer/README.md b/2000/bmeyer/README.md
index 8f122944b..5f8abc3ff 100644
--- a/2000/bmeyer/README.md
+++ b/2000/bmeyer/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./bmeyer
```
@@ -16,7 +16,7 @@
In a video window (white text on black background):
-```sh
+```
./try.sh
```
@@ -31,7 +31,7 @@ dashed argument) for compression and decompression! You've been warned.
The author recommended on linux/x86, glibc 2.0, libc4/5:
-```make
+```
bmeyer: bmeyer.c
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
```
@@ -40,7 +40,7 @@ However many compilers use `-O3` as the maximum level for `-O` optimization.
And on linux/x86, glibc 2.1:
-```make
+```
bmeyer: bmeyer.c
gcc -DY='int x=0x127f; __asm__ ("fldcw %0" : : "m" (*&x))' $? -o $@ -lm
```
@@ -80,13 +80,13 @@ on stdin, and it will decompress it to stdout --- as either raw or
ASCII .PGM, depending on what format it was compressed from. For
example:
-```sh
+```
./glicbawls < michael.pgm > michael.glic
```
and then
-```sh
+```
./glicbawls < michael.glic > michael.decoded.pgm
```
@@ -104,7 +104,7 @@ If you still have trouble, simply use a terminal or xterm with
more than 80 columns, and tell `glicbawls` about it by giving the
number of columns as an argument. For example
-```sh
+```
./glicbawls 260 lavabus.glic
```
@@ -122,21 +122,21 @@ decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply
give the maximum allowed error as an argument, with a dash (`-`)
before it. For example:
-```sh
+```
./glicbawls -2 < graph.pgm > graph.2.glic
```
will compress in a way that allows decompression with a maximum
error of two. You can combine both types of arguments, i.e.:
-```sh
+```
./glicbawls -3 180 < graph.pgm >graph.3.glic
```
will compress with a maximum error of 3, using a 180 column
terminal for the progress display, and:
-```sh
+```
./glicbawls -3 180 < graph.3.glic > graph.3maxerr.pgm
```
diff --git a/2000/bmeyer/index.html b/2000/bmeyer/index.html
index 115e8dee0..12e6a62ec 100644
--- a/2000/bmeyer/index.html
+++ b/2000/bmeyer/index.html
@@ -141,23 +141,23 @@ Location: AU - Commonwealth of Australi
To build:
-
make
+
make
To use:
-
./bmeyer
+
./bmeyer
Try:
In a video window (white text on black background):
-
./try.sh
+
./try.sh
The script will suggest you compare the output of the program with images,
prompting you to press any key to continue so that you may do so.
Judges’ remarks:
Don’t even think of supplying different compression factors (the
dashed argument) for compression and decompression! You’ve been warned.
The author recommended on linux/x86, glibc 2.0, libc4/5:
-
bmeyer: bmeyer.c
+
bmeyer: bmeyer.c
CC -DY="__setfpucw(0x127f)" -O6 $? -o $@ -lm
However many compilers use -O3 as the maximum level for -O optimization.
Compile with the maximum possible optimization on your system.
If your system has 80-bit internal representation of floating
@@ -184,9 +184,9 @@ output a compressed version to stdout. Feed it a compressed file
on stdin, and it will decompress it to stdout — as either raw or
ASCII .PGM, depending on what format it was compressed from. For
example:
-
./glicbawls< michael.pgm > michael.glic
+
./glicbawls < michael.pgm > michael.glic
and then
-
./glicbawls< michael.glic > michael.decoded.pgm
+
./glicbawls < michael.glic > michael.decoded.pgm
As it turns out, glicbawls compresses greyscale images (or, more
precisely, “natural” greyscale images) better than any other
program I am aware of (with the exception of the not-yet-published
@@ -199,7 +199,7 @@ have trouble recognizing the image, try squinting at it ;-).
If you still have trouble, simply use a terminal or xterm with
more than 80 columns, and tell glicbawls about it by giving the
number of columns as an argument. For example
-
./glicbawls 260 <lavabus.pgm >lavabus.glic
+
./glicbawls 260 <lavabus.pgm >lavabus.glic
will allow glicbawls to use up to 260 columns, which makes things
much more recognizable.
Still running out of space? Need to compress those images just a
@@ -212,13 +212,13 @@ error of 2 is allowed, an original pixel value of 37 could be
decoded as 35, 36, 37, 38 or 39. In order to use this mode, simply
give the maximum allowed error as an argument, with a dash (-)
before it. For example:
-
./glicbawls-2< graph.pgm > graph.2.glic
+
./glicbawls -2 < graph.pgm > graph.2.glic
will compress in a way that allows decompression with a maximum
error of two. You can combine both types of arguments, i.e.:
-
./glicbawls-3 180 < graph.pgm >graph.3.glic
+
./glicbawls -3 180 < graph.pgm >graph.3.glic
will compress with a maximum error of 3, using a 180 column
terminal for the progress display, and:
But wait, there is more — you can also feed glicbawls .PPM files
(i.e. colour images), raw or ASCII, your choice. glicbawls will
diff --git a/2000/briddlebane/README.md b/2000/briddlebane/README.md
index e6e1b94b9..f2623c3cc 100644
--- a/2000/briddlebane/README.md
+++ b/2000/briddlebane/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./briddlebane
```
@@ -19,7 +19,7 @@ equivalent file!
You might also like to try:
-```sh
+```
./try.sh
INSULTS=15 ./try.sh
diff --git a/2000/briddlebane/index.html b/2000/briddlebane/index.html
index d5d9338c3..b335095a9 100644
--- a/2000/briddlebane/index.html
+++ b/2000/briddlebane/index.html
@@ -144,16 +144,16 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
To use:
-
./briddlebane
+
./briddlebane
Try:
For some fun every time you log in try running this from your .bashrc or
equivalent file!
You might also like to try:
-
./try.sh
-
-INSULTS=15 ./try.sh
+
./try.sh
+
+ INSULTS=15 ./try.sh
Judges’ remarks:
One could argue that this program was a “diseased dumpster of tripe”
but I suspect that would only result in the judges being heckled as a
diff --git a/2000/dhyang/README.md b/2000/dhyang/README.md
index fe19210fb..045fd18ab 100644
--- a/2000/dhyang/README.md
+++ b/2000/dhyang/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./dhyang
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2000/dhyang/index.html b/2000/dhyang/index.html
index f37919cb9..88034d1c0 100644
--- a/2000/dhyang/index.html
+++ b/2000/dhyang/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./dhyang
+
./dhyang
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
A beautiful combination of solving several different problems, but
mostly, the single most impressive layout we’ve ever seen. Many
diff --git a/2000/dlowe/README.md b/2000/dlowe/README.md
index 9ab5e8da9..47698db36 100644
--- a/2000/dlowe/README.md
+++ b/2000/dlowe/README.md
@@ -1,12 +1,12 @@
## To build:
-```sh
+```
make
```
The following bit of perl may help determine the values you need:
-```sh
+```
perl -MConfig -e 'print "$Config{archlibexp}/CORE\n"'
```
@@ -27,14 +27,14 @@ For more detailed information see [2000 dlowe bugs](../../bugs.html#2000_dlowe).
## To use:
-```sh
+```
./dlowe [file ...]
```
## Try:
-```sh
+```
./try.sh
```
@@ -126,7 +126,7 @@ or EOF is encountered.
### Examples:
-```sh
+```
$ echo '12 13 14 15 16 + + + + f' | ./dlowe
70
$ echo '12 13 14 15 16 17 + - * / p' | ./dlowe
diff --git a/2000/dlowe/index.html b/2000/dlowe/index.html
index c07dd7df3..8d483808c 100644
--- a/2000/dlowe/index.html
+++ b/2000/dlowe/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
The following bit of perl may help determine the values you need:
When this entry was submitted the rules of the IOCCC did not prohibit
the use of embedded language interpreters. The judges considered
@@ -213,20 +213,20 @@ or EOF is encountered.
the results of an operation are really huge (> 10^308)
This bug appears to be fixed in perl5.6.0
$ echo '12 13 14 15 16 + + + + f' | ./dlowe
+ 70
+ $ echo '12 13 14 15 16 17 + - * / p' | ./dlowe
+ -0.0515873015873016
+ $ echo '+' | ./dlowe
+ stack empty
+ $ echo '999999999999999 1 + p' | ./dlowe
+ 1e+15
+ $ echo '99999999999999 1 + p' | ./dlowe
+ 100000000000000
+ $ echo '12.5 9 % 10 * 15 + f' | ./dlowe
+ 50
+ $ echo '7 P 6 d P P 8 p' | ./dlowe | tr 876 tpo
+ poot
Code Concept:
We all know that Perl and other VHLLs (very high level languages)
are particularly well-suited for (among other things) string
diff --git a/2000/jarijyrki/README.md b/2000/jarijyrki/README.md
index a7a0a6861..70205406a 100644
--- a/2000/jarijyrki/README.md
+++ b/2000/jarijyrki/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -9,7 +9,7 @@ You will need X11 header files and libraries installed to build this program.
## To use:
-```sh
+```
./jarijyrki < infile.info > outfile.info
```
@@ -18,7 +18,7 @@ You will need a system capable of displaying the results of X Window programs.
## Try:
-```sh
+```
./jarijyrki < finance.sheet > myedits.info
```
@@ -88,7 +88,7 @@ supports are:
##### Starting
-```sh
+```
./jarijyrki < finance.sheet > myedits.info
```
@@ -144,7 +144,7 @@ To start the spreadsheet program with an existing
spreadsheet, for instance [finance.sheet](finance.sheet), use the following
command line:
-```sh
+```
./jarijyrki < finance.sheet
```
@@ -156,7 +156,7 @@ supported by the program.
To start the program with an empty sheet, use
-```sh
+```
./jarijyrki < /dev/null
```
@@ -171,7 +171,7 @@ output. Hence, when the spreadsheet window has come up, you've made your
changes, and you press the ESC key the program finishes. To save the results in
a file, the following typical command line would be used:
-```sh
+```
./jarijyrki < finance.sheet > myedits.info
```
diff --git a/2000/jarijyrki/index.html b/2000/jarijyrki/index.html
index 14a9194e7..2631dba68 100644
--- a/2000/jarijyrki/index.html
+++ b/2000/jarijyrki/index.html
@@ -144,13 +144,13 @@ Location: FI - Republic of Finland
To build:
-
make
+
make
You will need X11 header files and libraries installed to build this program.
To use:
-
./jarijyrki< infile.info > outfile.info
+
./jarijyrki < infile.info > outfile.info
You will need a system capable of displaying the results of X Window programs.
Try:
-
./jarijyrki< finance.sheet > myedits.info
+
./jarijyrki < finance.sheet > myedits.info
Then click on cell C3 and type in the following:
C5 C6 C7 @
Click on cell D4 and type in the following:
@@ -190,7 +190,7 @@ supports are:
2. USAGE INSTRUCTIONS
2.1. Quick Guide
Starting
-
./jarijyrki< finance.sheet > myedits.info
+
./jarijyrki < finance.sheet > myedits.info
Stopping
Use the ESC key.
Movement
@@ -214,14 +214,14 @@ character at the end of the formula; press backspace to delete the last one.
To start the spreadsheet program with an existing
spreadsheet, for instance finance.sheet, use the following
command line:
-
./jarijyrki< finance.sheet
+
./jarijyrki < finance.sheet
The file finance.sheet has been provided as an example. This
file contains a set of financial numbers and two graphical entities - a pie
chart and a histogram - based on them. We recommend starting the use of the
program from this file, as a way to study and learn the formula language
supported by the program.
To start the program with an empty sheet, use
-
./jarijyrki< /dev/null
+
./jarijyrki < /dev/null
Alternatively, /dev/zero could be used but that may not exist on all systems.
2.3. Exiting and Saving Spreadsheets
Normally the user obviously wants to edit the spreadsheet. After the
@@ -229,7 +229,7 @@ spreadsheet program finishes, it outputs the edited spreadsheet to the standard
output. Hence, when the spreadsheet window has come up, you’ve made your
changes, and you press the ESC key the program finishes. To save the results in
a file, the following typical command line would be used:
-
./jarijyrki< finance.sheet > myedits.info
+
./jarijyrki < finance.sheet > myedits.info
2.4. Visual Overview
On top of the window the Formula Area shows the formula (or text) of the
currently selected cell. The program starts with A1 as being the current cell.
diff --git a/2000/natori/README.md b/2000/natori/README.md
index 8f7ec2f46..db50dd5e8 100644
--- a/2000/natori/README.md
+++ b/2000/natori/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,14 +11,14 @@ version](#alternate-code) below.
## To use:
-```sh
+```
./natori
```
## Try:
-```sh
+```
./try.sh
```
@@ -42,14 +42,14 @@ The author noted that those in the southern hemisphere might want to change
To run the alternate code that supports the southern hemisphere:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./natori.alt
```
@@ -65,7 +65,7 @@ versions? Or are there any?
### Alternate try:
-```sh
+```
./try.alt.sh
```
diff --git a/2000/natori/index.html b/2000/natori/index.html
index 40b6e06bd..f6b9e2044 100644
--- a/2000/natori/index.html
+++ b/2000/natori/index.html
@@ -141,14 +141,14 @@ Location: JP - Japan
To build:
-
make
+
make
An alt version exists for those in the southern hemisphere (or those who want to
see what it would be in the southern hemisphere). See alternate
version below.
To use:
-
./natori
+
./natori
Try:
-
./try.sh
+
./try.sh
Try running this on different days, say a few days apart (even better if the
Moon phase changes), and each time run it several times in a row (or several
times in a day).
@@ -160,9 +160,9 @@ input or else just by the code itself. Bonus points if you can make it show all.
acos(l/2) into acos(-l/2) which we have done in the alternate version.
Alternate build:
To run the alternate code that supports the southern hemisphere:
-
make alt
+
make alt
Alternate use:
-
./natori.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
@@ -170,7 +170,7 @@ differences?
Can you identify any Moon phases that result in the same output of both
versions? Or are there any?
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Like with try.sh, try using this multiple times in a row or throughout
the day on different days (if different phases of the Moon you’ll see more of a
difference, of course).
diff --git a/2000/primenum/README.md b/2000/primenum/README.md
index ddec251f7..705d1c9d0 100644
--- a/2000/primenum/README.md
+++ b/2000/primenum/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2000 primenum bugs](../../bugs.html#2000_prim
## To use:
-```sh
+```
echo n | ./primenum n
```
@@ -27,7 +27,7 @@ NOTE: `n` is an integer.
## Try:
-```sh
+```
./try.sh
```
@@ -64,7 +64,7 @@ Instead, the program reads input from `stdin` and returns garbled text on
`stdout`. Fortunately, you can recover the original message simply by
running the program a second time. Try:
-```sh
+```
./primenum n < textfile | ./primenum n > textfile2
diff textfile textfile2
```
diff --git a/2000/primenum/index.html b/2000/primenum/index.html
index d89b97a47..c5113b449 100644
--- a/2000/primenum/index.html
+++ b/2000/primenum/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
Don’t read the author remarks until you’re ready for the spoiler.
Just stop and read the program; it won’t take long. Once you’ve figured
@@ -174,8 +174,8 @@ syntax “mistakes” (e.g. LessThanOrEqualTo) and blatant “erro
Instead, the program reads input from stdin and returns garbled text on
stdout. Fortunately, you can recover the original message simply by
running the program a second time. Try:
-
./primenum n < textfile |./primenum n > textfile2
-diff textfile textfile2
+
./primenum n < textfile | ./primenum n > textfile2
+ diff textfile textfile2
where n is the same number (modulo 64). So, the prime number generator
is actually a simple text encoder/decoder! Of course, don’t forget that
argument, otherwise the “bugs” in the program will cause it to crash!
diff --git a/2000/rince/README.md b/2000/rince/README.md
index d4df7d496..5275e9ca7 100644
--- a/2000/rince/README.md
+++ b/2000/rince/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [2000 rince bugs](../../bugs.html#2000_rince).
## To use:
-```sh
+```
./rince number number2
```
@@ -28,7 +28,7 @@ different.
## Try:
-```sh
+```
./try.sh
```
@@ -51,7 +51,7 @@ observation.
The simplest way to run it is with no arguments. Just type:
-```sh
+```
./rince
```
@@ -65,7 +65,7 @@ has a built in time machine. Indeed the program knows the speed of light,
which is used to ensure that we see the "live" pictures. Simply specify
the fraction of a day to skip forward for each screen refresh. I suggest:
-```sh
+```
./rince 0.01
```
@@ -73,7 +73,7 @@ To display the output (still guessing?) for a given date, specify two
arguments. The first argument is as before and the second argument is a
Julian day number (given as a fractional component). E.g.:
-```sh
+```
./rince 0 2441193.6
./rince 0.01 2441193.6
```
@@ -170,7 +170,7 @@ states the following:
Thus we can plot Galileo's discoveries using the following three plots:
-```sh
+```
./rince 0 $(./dmy2jd 7.8 1 1610)
./rince 0 $(./dmy2jd 8.8 1 1610)
./rince 0 $(./dmy2jd 10.8 1 1610)
@@ -180,7 +180,7 @@ However we can go one better by seeing what Galileo would have seen if it
wasn't cloudy on the 9th. Try:
-```sh
+```
./rince 0 $(./dmy2jd 9.85 1 1610)
```
diff --git a/2000/rince/index.html b/2000/rince/index.html
index e00633062..c68115f1e 100644
--- a/2000/rince/index.html
+++ b/2000/rince/index.html
@@ -141,17 +141,17 @@ Location: GB - United Kingdom of Great
If DISPLAY is not set the program will very likely crash or do something
different.
Try:
-
./try.sh
+
./try.sh
This will run the program several times with different parameters to show
different types of things. See the author’s remarks for more details.
Judges’ remarks:
@@ -162,7 +162,7 @@ observation.
Author’s remarks:
How to use it
The simplest way to run it is with no arguments. Just type:
-
./rince
+
./rince
You will need to have access to X windows, although it doesn’t require
desperately high resolution and there are no known limitations on colour
depth.
@@ -171,12 +171,12 @@ or more to be visible. For those that cannot wait that long the program
has a built in time machine. Indeed the program knows the speed of light,
which is used to ensure that we see the “live” pictures. Simply specify
the fraction of a day to skip forward for each screen refresh. I suggest:
-
./rince 0.01
+
./rince 0.01
To display the output (still guessing?) for a given date, specify two
arguments. The first argument is as before and the second argument is a
Julian day number (given as a fractional component). E.g.:
-
./rince 0 2441193.6
-./rince 0.01 2441193.6
+
./rince 0 2441193.6
+ ./rince 0.01 2441193.6
A Julian day is defined to be the number of days since January 1st in the year
-4712 (4713BC), starting at 12 noon GMT.12 To aid conversion from our time
(GMT) to Julian day there is a supplementary program named:
@@ -248,12 +248,12 @@ states the following:
Here he could see for himself that somehow, a planet could
orbit the sun, and not leave a moon behind!
Thus we can plot Galileo’s discoveries using the following three plots:
However we can go one better by seeing what Galileo would have seen if it
wasn’t cloudy on the 9th. Try:
-
./rince 0 $(./dmy2jd 9.85 1 1610)
+
./rince 0 $(./dmy2jd 9.85 1 1610)
to see what he was missing out on. I wonder what he’d have made of that!
Galileo discovered the fourth moon a few days later.
I’ve tried typing these dates into two Java based Jovian moon plotters,
diff --git a/2000/robison/README.md b/2000/robison/README.md
index 269ca16df..373a5a921 100644
--- a/2000/robison/README.md
+++ b/2000/robison/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./robison
```
diff --git a/2000/robison/index.html b/2000/robison/index.html
index e711ca1c5..e2ba496f0 100644
--- a/2000/robison/index.html
+++ b/2000/robison/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./robison
+
./robison
Judges’ remarks:
The program plays almost always reasonably, but does not always detect
illegal moves. Try “9 1” as your first move, then “13 2”. Also it
diff --git a/2000/schneiderwent/README.md b/2000/schneiderwent/README.md
index d6329887a..aafa0d595 100644
--- a/2000/schneiderwent/README.md
+++ b/2000/schneiderwent/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./schneiderwent
```
## Try:
-```sh
+```
./schneiderwent schneiderwent.data
./schneiderwent
```
@@ -24,7 +24,7 @@ What's the difference?
If you have a long while to spare (and you're bored enough that you could watch
paint dry :-) ) you might also try:
-```sh
+```
./try.sh
```
@@ -33,7 +33,7 @@ you wish to make it run faster, you can override how long it sleeps per
iterations and how many iterations it runs. For instance to make it sleep only
30 seconds and run only twice:
-```sh
+```
SLEEP=30 ITERATIONS=2 ./try.sh
```
diff --git a/2000/schneiderwent/index.html b/2000/schneiderwent/index.html
index 8b50fcc8a..504bee43a 100644
--- a/2000/schneiderwent/index.html
+++ b/2000/schneiderwent/index.html
@@ -141,21 +141,21 @@ Location: US - United States of America
If you have a long while to spare (and you’re bored enough that you could watch
paint dry :-) ) you might also try:
-
./try.sh
+
./try.sh
Alternatively, you can check on it later on, to see all the entry does. Or if
you wish to make it run faster, you can override how long it sleeps per
iterations and how many iterations it runs. For instance to make it sleep only
30 seconds and run only twice:
-
SLEEP=30 ITERATIONS=2 ./try.sh
+
SLEEP=30 ITERATIONS=2 ./try.sh
Judges’ remarks:
Very nice play by the rules and portable text obfuscation.
This far surpasses old tricks like adding or subtracting 1
diff --git a/2000/thadgavin/README.md b/2000/thadgavin/README.md
index 5dcdf024c..aebc74a41 100644
--- a/2000/thadgavin/README.md
+++ b/2000/thadgavin/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -16,7 +16,7 @@ looked like back in 2000 (with a configurable speed). See the
## To use:
-```sh
+```
./thadgavin.alt
```
@@ -27,7 +27,7 @@ You can press 'q' at any time to exit.
If you have SDL1 installed:
-```sh
+```
./thadgavin_sdl
```
@@ -43,13 +43,13 @@ microseconds) for the SDL version.
To change the SDL one to something like `15000` you can do:
-```sh
+```
make SDL_SLEEP=15000 clobber alt
```
and to change the curses one to `40`:
-```sh
+```
make SLEEP=40 clobber alt
```
@@ -75,14 +75,14 @@ is not a problem there.
### Original build:
-```sh
+```
make all
```
### Original use:
-```sh
+```
./thadgavin
```
@@ -91,7 +91,7 @@ is not a problem there.
If you have SDL1 installed:
-```sh
+```
./thadgavin_sdl
```
@@ -110,14 +110,14 @@ less than dazzling. We could not test this entry in DOS mode.
Compile using DJGPP as follows:
-```sh
+```
gcc thadgavin.c -o thadgavin.exe -Wall -lm -O6 -mpentium -fomit-frame-pointer -ffast-math
```
### To use under Windows, X-Windows or macOS using the Simple DirectMedia Layer:
-```sh
+```
gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lSDL -DSDL -lm
```
@@ -125,7 +125,7 @@ Compile using DJGPP as follows:
### To use curses:
-```sh
+```
gcc -O6 -lpthread -g -o thadgavin thadgavin.c -lncurses -lm
```
diff --git a/2000/thadgavin/index.html b/2000/thadgavin/index.html
index 0f378f8cb..15468b390 100644
--- a/2000/thadgavin/index.html
+++ b/2000/thadgavin/index.html
@@ -144,7 +144,7 @@ Location: GB - United Kingdom of Great
looked like back in 2000 (with a configurable speed). See the
original code section for the original entry.
To use:
-
./thadgavin.alt
+
./thadgavin.alt
You can press ‘q’ at any time to exit.
Try:
If you have SDL1 installed:
-
./thadgavin_sdl
+
./thadgavin_sdl
Whereas the curses version has an early exit the SDL version does not. You will
have to kill it yourself.
You might also wish to reconfigure the speed at which the programs run. The code
@@ -167,9 +167,9 @@ redefine the values: SLEEP is how long the program sleeps (in micro
between output with curses and SDL_SLEEP is how long it sleeps (also in
microseconds) for the SDL version.
To change the SDL one to something like 15000 you can do:
-
make SDL_SLEEP=15000 clobber alt
+
make SDL_SLEEP=15000 clobber alt
and to change the curses one to 40:
-
make SLEEP=40 clobber alt
+
make SLEEP=40 clobber alt
Then use the program(s) in the same way.
The different macros is because the curses version is already much slower and so
it’s better to not tie the two values together. You may of course redefine both
@@ -184,12 +184,12 @@ typically ctrl-c) as the program does not call endwin(). Using
Original build:
-
make all
+
make all
Original use:
-
./thadgavin
+
./thadgavin
Original try:
If you have SDL1 installed:
-
./thadgavin_sdl
+
./thadgavin_sdl
Judges’ remarks:
This entry is a nice play by the rules. It can use curses, if the
SDL graphic library is not present, and is quite good at that,
@@ -198,11 +198,11 @@ less than dazzling. We could not test this entry in DOS mode.
thadgavin.c.c:46: warning: passing arg 2 of `SDL_SetColors' from incompatible pointer type
diff --git a/2000/tomx/README.md b/2000/tomx/README.md
index 3520da688..461b3d98f 100644
--- a/2000/tomx/README.md
+++ b/2000/tomx/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ There is an alternate version that compiles [mkentry.c](mkentry.c). See
## To use:
-```sh
+```
./tomx
```
## Try:
-```sh
+```
./try.sh
```
@@ -32,14 +32,14 @@ using it as a Makefile and running the code ends up running `mkentry`.
### Alternate build:
-```sh
+```
make alt
```
### Alternate try:
-```sh
+```
./try.alt.sh
```
diff --git a/2000/tomx/index.html b/2000/tomx/index.html
index 117db3d4e..3d7abcc50 100644
--- a/2000/tomx/index.html
+++ b/2000/tomx/index.html
@@ -141,22 +141,22 @@ Location: NL - Kingdom of the Netherlan
This alternate code is based on the author’s remarks with a slight fix so that
it will do what it once did, compile and run mkentry.c. You can use
it in a similar way as tomx.c, both executing the source file and
using it as a Makefile and running the code ends up running mkentry.
Alternate build:
-
make alt
+
make alt
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Polyglots have come and gone, but this was the first one we’d seen
where one language used another to perform its tasks. An interesting
diff --git a/2001/anonymous/README.md b/2001/anonymous/README.md
index 58f85d5a1..39e8c1684 100644
--- a/2001/anonymous/README.md
+++ b/2001/anonymous/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -27,14 +27,14 @@ For more detailed information see [2001 anonymous bugs](../../bugs.html#2001_ano
## To use:
-```sh
+```
./anonymous x86_program
```
## Try:
-```sh
+```
./try.sh
./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
@@ -64,14 +64,14 @@ that :-(
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./anonymous.ten.alt
./anonymous.bed.alt
diff --git a/2001/anonymous/index.html b/2001/anonymous/index.html
index 71757b9e2..65e05c607 100644
--- a/2001/anonymous/index.html
+++ b/2001/anonymous/index.html
@@ -141,7 +141,7 @@ Location: GB - United Kingdom of Great
To build:
-
make
+
make
The programs that this program is supposed to act on,
anonymous.ten.c and anonymous.bed.c,
compiled with make, MUST be compiled as 32-bit ELF binaries. In the case that
@@ -155,11 +155,11 @@ whatever your system will compile them as).
./try.sh
-
-./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
+
./try.sh
+
+ ./anonymous anonymous.bed # if able to compile as a 32-bit (-m32) ELF binary
NOTE: if the 32-bit version cannot be compiled the script will at least compile
anonymous.ten as a 64-bit program (or whatever your system is
set to) and run it directly.
@@ -176,11 +176,11 @@ program or do something terribly wrong like slaughtering all the
Imladris! :-) so please don’t do
that :-(
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./anonymous.ten.alt
-
-./anonymous.bed.alt
+
./anonymous.ten.alt
+
+ ./anonymous.bed.alt
A 2023 note about the warning from the author:
The author suggested that this might somewhat destroy the binaries this
touches but after the fix of 2023 this was not observed (yet?). It does indeed
diff --git a/2001/bellard/README.md b/2001/bellard/README.md
index 4f62e47e0..0256da76e 100644
--- a/2001/bellard/README.md
+++ b/2001/bellard/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -19,14 +19,14 @@ For more detailed information see [2001 bellard bugs](../../bugs.html#2001_bella
## To use:
-```sh
+```
./bellard file
```
## Try:
-```sh
+```
./bellard bellard.otccex.c
```
@@ -47,7 +47,7 @@ program.
You can use it by typing:
-```sh
+```
./bellard bellard.c [args]...
```
@@ -61,19 +61,19 @@ or by giving the C source to its standard input.
- Sample compilation and execution:
-```sh
+```
./bellard bellard.otccex.c 10
```
- Self compilation:
-```sh
+```
./bellard bellard.c bellard.otccex.c 10
```
- Self compilation iterated...
-```sh
+```
./bellard bellard.c bellard.c bellard.otccex.c 10
```
diff --git a/2001/bellard/index.html b/2001/bellard/index.html
index 91b5aee0d..ba8de43ec 100644
--- a/2001/bellard/index.html
+++ b/2001/bellard/index.html
@@ -141,16 +141,16 @@ Location: FR - French Republic (
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: INABIAF - please **DO NOT** fix
STATUS: doesn't work with some platforms - please help us fix
@@ -161,7 +161,7 @@ compilable by a standard ANSI C compiler. OTCC compiles,
assembles, links and runs C code without the need of any other
program.
You can use it by typing:
-
./bellard bellard.c [args]...
+
./bellard bellard.c [args]...
or by giving the C source to its standard input.
args are given to the main() function of bellard.c (argv[0] is
bellard.c).
@@ -169,15 +169,15 @@ program.
Sample compilation and execution:
-
./bellard bellard.otccex.c 10
+
./bellard bellard.otccex.c 10
Self compilation:
-
./bellard bellard.c bellard.otccex.c 10
+
./bellard bellard.c bellard.otccex.c 10
Self compilation iterated…
-
./bellard bellard.c bellard.c bellard.otccex.c 10
+
./bellard bellard.c bellard.c bellard.otccex.c 10
An alternate syntax is to use it as a script interpreter: you can
put #!/usr/local/bin/otcc at the beginning of your C source if
you installed otcc at this place.
diff --git a/2001/cheong/README.md b/2001/cheong/README.md
index 2535eba4b..d81e339c0 100644
--- a/2001/cheong/README.md
+++ b/2001/cheong/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./cheong digits
```
## Try:
-```sh
+```
./try.sh
```
@@ -36,7 +36,7 @@ Compile normally and run with one argument, an integer with 2n digits.
Program will return the integer part of its square root (n-digits).
For example,
-```sh
+```
$ cc -o cheong cheong.c
$ ./cheong 1234567890
35136
@@ -52,7 +52,7 @@ This program runs normally on any ANSI C compiler and is ASCII dependent.
Strict compiling gives just one unavoidable warning:
-```sh
+```
gcc -ansi -Wall cheong.c
cheong.c:3: warning: third argument of `main' should probably be `char **'
```
diff --git a/2001/cheong/index.html b/2001/cheong/index.html
index 7c9c9a176..087c94461 100644
--- a/2001/cheong/index.html
+++ b/2001/cheong/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./cheong digits
+
./cheong digits
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Be sure to give an even number of digits in the argument. Add a
leading 0 if needed.
@@ -156,17 +156,17 @@ as all good programs should be! :-)
Compile normally and run with one argument, an integer with 2n digits.
Program will return the integer part of its square root (n-digits).
For example,
Deviation from these instructions will cause undefined results. :-)
Portability
This program runs normally on any ANSI C compiler and is ASCII dependent.
Strict compiling gives just one unavoidable warning:
-
gcc-ansi-Wall cheong.c
-cheong.c:3: warning: third argument of `main' should probably be `char **'
+
gcc -ansi -Wall cheong.c
+ cheong.c:3: warning: third argument of `main' should probably be `char **'
Obfuscation
The main obfuscation is the algorithm used to calculate square roots,
sometimes known as the longhand method. The basic algorithm is itself
diff --git a/2001/coupard/README.md b/2001/coupard/README.md
index 5ea683a84..35c98e56a 100644
--- a/2001/coupard/README.md
+++ b/2001/coupard/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./coupard
```
## Try:
-```sh
+```
./try.sh
```
@@ -52,7 +52,7 @@ that can do sound, as a lowest-denominator sound I/O interface.
To listen to what the program says directly, invoke
-```sh
+```
./coupard > /dev/audio
```
@@ -68,7 +68,7 @@ If you want to convert the audio output of the program into another audio
format, you can pipe it to [SoX](https://en.wikipedia.org/wiki/SoX) for example
(`sox` is the Swiss army knife of Unix audio tools). The command:
-```sh
+```
./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav
```
diff --git a/2001/coupard/index.html b/2001/coupard/index.html
index 62d61f609..4ac1c3efd 100644
--- a/2001/coupard/index.html
+++ b/2001/coupard/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
To use:
-
./coupard
+
./coupard
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
You may need to run this a few times to understand exactly what is
being said. You might even need to look somewhere on your desktop,
@@ -170,7 +170,7 @@ fixed-format audio interface that is supported by the majority of Unices
that can do sound, as a lowest-denominator sound I/O interface.
Program usage
To listen to what the program says directly, invoke
-
./coupard> /dev/audio
+
./coupard > /dev/audio
The program then speaks out something like
The time is HH hours MM minutes SS seconds
@@ -181,7 +181,7 @@ the speakers connected … :-)
If you want to convert the audio output of the program into another audio
format, you can pipe it to SoX for example
(sox is the Swiss army knife of Unix audio tools). The command:
converts the output of the program into a 44.1KHz stereo .WAV
file and saves it into test.wav.
The output format of the program is 8KHz, unsigned 8-bit samples.
diff --git a/2001/ctk/README.md b/2001/ctk/README.md
index 939235595..1d5eaa29b 100644
--- a/2001/ctk/README.md
+++ b/2001/ctk/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate code) below.
## To use:
-```sh
+```
./ctk
```
@@ -23,14 +23,14 @@ This alternate version adds to the movement keys `l` for right, `h` for left and
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./ctk.alt
```
diff --git a/2001/ctk/index.html b/2001/ctk/index.html
index 359db2b43..3c96895e0 100644
--- a/2001/ctk/index.html
+++ b/2001/ctk/index.html
@@ -141,18 +141,18 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
There is an alternate version with vi(m) key movements. See alternate
code below.
To use:
-
./ctk
+
./ctk
Alternate code:
This alternate version adds to the movement keys l for right, h for left and
k for straight.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./ctk.alt
+
./ctk.alt
Judges’ remarks:
No matter how careful you are, this guy eventually crashes. Most people
can make at least one successful road trip without crashing.
diff --git a/2001/dgbeards/README.md b/2001/dgbeards/README.md
index 576fdbc44..857a8bf33 100644
--- a/2001/dgbeards/README.md
+++ b/2001/dgbeards/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2001 dgbeards bugs](../../bugs.html#2001_dgbe
## To use:
-```sh
+```
./dgbeards
```
@@ -36,14 +36,14 @@ this you can look at the author's remarks and make the change.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
./dgbeards.alt
```
diff --git a/2001/dgbeards/index.html b/2001/dgbeards/index.html
index 1957e4c97..86c8ebd6d 100644
--- a/2001/dgbeards/index.html
+++ b/2001/dgbeards/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version based on the author’s remarks. See alternate
code below for more details.
Bugs and (Mis)features:
@@ -149,16 +149,16 @@ code below for more details.
The author provided a way to speed it up a bit and also how to make it so it
doesn’t crash on losing. The idea that it crashes on losing was too good to
lose but this alternate version has the former change. If you wish to remove
this you can look at the author’s remarks and make the change.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
./dgbeards.alt
+
./dgbeards.alt
Try:
See if you can figure out how to make the computer always lose (‘win’ :-) ).
It’s a very simple thing to do. Read the author’s remarks for clues.
diff --git a/2001/herrmann1/README.md b/2001/herrmann1/README.md
index 78cced7e4..62142ebf1 100644
--- a/2001/herrmann1/README.md
+++ b/2001/herrmann1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -19,7 +19,7 @@ For more detailed information see [2001 herrmann1 bugs](../../bugs.html#2001_her
## To use:
-```sh
+```
./herrmann1.sh 'prg=file'
```
@@ -30,7 +30,7 @@ need an older compiler perhaps gcc 2.95.
## Try:
-```sh
+```
./try.sh
```
@@ -86,7 +86,7 @@ terminal!
The info files `herrmann1.turing` and [herrmann1.gcd](herrmann1.gcd) are sample
programs for the Turing machine. For example, type
-```sh
+```
./herrmann1.sh 'prg=herrmann1.times2'
```
@@ -126,7 +126,7 @@ In the previous example, the Turing machine started on the default
tape of the program `times2.turing`. To provide your own tape, type
(for example)
-```sh
+```
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
```
@@ -155,7 +155,7 @@ number in unary representation. (That is, a row of I's is
expected, and one more I is appended to the row.) Let's call it
`plus1.turing`. Here's what it could look like:
-```c
+```
/* Search beginning of number. */
#define start_O O, right, start
/* Number found. Move one step to the left. */
@@ -177,7 +177,7 @@ line defining `st2_I` has been left out.)
Now, the program can be used with
-```sh
+```
./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
```
@@ -187,7 +187,7 @@ machine would start on an empty tape (that is, a tape filled with
the case for `plus1.turing`). So you might want to provide a
default tape by adding a line like
-```c
+```
#define tape O O O O O I I I I
```
@@ -200,13 +200,13 @@ When writing long programs, the most common errors are to forget
to define a state or to misspell one. Let's assume you forgot the
line
-```c
+```
#define start_I I, left, st2
```
Remove it and type
-```sh
+```
./herrmann1 'prg=plus1.turing'
```
diff --git a/2001/herrmann1/index.html b/2001/herrmann1/index.html
index a12818c8f..3eac05ae9 100644
--- a/2001/herrmann1/index.html
+++ b/2001/herrmann1/index.html
@@ -141,19 +141,19 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: missing files - please provide them
STATUS: known bug - please help us fix
NOTE: this entry seems to rely on older versions of gcc for the compilation
stage and as such if you wish to see that part like it was designed you will
need an older compiler perhaps gcc 2.95.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
There are some clear hints in the source code as to the
purpose of this program. Perhaps the only way to figure out what is
@@ -192,7 +192,7 @@ terminal!
For the impatient
The info files herrmann1.turing and herrmann1.gcd are sample
programs for the Turing machine. For example, type
-
./herrmann1.sh'prg=herrmann1.times2'
+
./herrmann1.sh 'prg=herrmann1.times2'
and watch the animated Turing machine multiply 8 by two (in
unary representation). Here’s a screen shot during compilation:
/*
@@ -217,7 +217,7 @@ result.)
In the previous example, the Turing machine started on the default
tape of the program times2.turing. To provide your own tape, type
(for example)
-
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
+
./herrmann1 prg=times2.turing tape="O O O I I I O O O"
(The Os and Is are letters, not digits.) You might prefer to
provide only a finite portion of the tape, like I did above. In
this case, the remainder of the tape is filled with Os. ;-)
@@ -234,12 +234,12 @@ better. Simply try some out.
number in unary representation. (That is, a row of I’s is
expected, and one more I is appended to the row.) Let’s call it
plus1.turing. Here’s what it could look like:
-
/* Search beginning of number. */
-#define start_O O, right, start
-/* Number found. Move one step to the left. */
-#define start_I I, left, st2
-/* Write a I and stop */
-#define st2_O I, left, stop
+
/* Search beginning of number. */
+ #define start_O O, right, start
+ /* Number found. Move one step to the left. */
+ #define start_I I, left, st2
+ /* Write a I and stop */
+ #define st2_O I, left, stop
Some explanations:
- The tape alphabet is always O and I.
- The states can be anything starting with “st”. “start” and
@@ -251,21 +251,21 @@ line defining st2_I has been left out.)
- The order of the lines is irrelevant.
- You may use C-style comments. (Would you have guessed it?)
Now, the program can be used with
-
./herrmann1.sh'prg=plus1.turing''tape="I I I"'
+
./herrmann1.sh 'prg=plus1.turing' 'tape="I I I"'
But what happens if no tape is provided? Up to now, the Turing
machine would start on an empty tape (that is, a tape filled with
Os). For many programs, this doesn’t make much sense (as is
the case for plus1.turing). So you might want to provide a
default tape by adding a line like
-
#define tape O O O O O I I I I
+
#define tape O O O O O I I I I
to your program.
Debugging
When writing long programs, the most common errors are to forget
to define a state or to misspell one. Let’s assume you forgot the
line
-
#define start_I I, left, st2
+
#define start_I I, left, st2
Remove it and type
-
./herrmann1'prg=plus1.turing'
+
./herrmann1 'prg=plus1.turing'
The output will be
Undefined state start.
Tape:
diff --git a/2001/herrmann2/README.md b/2001/herrmann2/README.md
index 250f7c74a..9c6c63b1d 100644
--- a/2001/herrmann2/README.md
+++ b/2001/herrmann2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./herrmann2
```
## Try:
-```sh
+```
./try.sh
```
@@ -75,7 +75,7 @@ to about 9k.
3D picture, constructed of random characters (with ASCII code between
32 and 126). For example, type
-```sh
+```
./herrmann2 < herrmann2.ioccc
```
@@ -86,7 +86,7 @@ new random character, it will take the next one from the
argument. When it arrives at the end of the argument, it will
start over at the beginning. Example:
-```sh
+```
./herrmann2 "234 84 045 5 6765 7487 65190 84 656 254 12 43931 818 0 6542 \
341 45 567 76967 7244 606 976567 895 81898 095 68678 1843 4650547 \
565980691 389 04974" < herrmann2.ioccc
@@ -122,7 +122,7 @@ get it (if you lost it or if you don't have it already) is to use
the program itself on the right picture and with the right
argument:
-```sh
+```
./herrmann2 \
'char*d,A[9876];e;b;*ad,a,c; tw,ndr,T; wri; ;*h; _,ar ;on;'\
' ;l ;i(V)man,n {-!har ; =Aadre(0,&e,o||n -- +,o4,=9,l=b=8,'\
@@ -183,7 +183,7 @@ works.)
- When still in doubt about how to judge this program, type
-```sh
+```
./herrmann2 < herrmann2.cup
```
diff --git a/2001/herrmann2/index.html b/2001/herrmann2/index.html
index 590c127b4..cfdecbd48 100644
--- a/2001/herrmann2/index.html
+++ b/2001/herrmann2/index.html
@@ -141,11 +141,11 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
To use:
-
./herrmann2
+
./herrmann2
Try:
-
./try.sh
+
./try.sh
If you use vi(m) you can see a pattern in herrmann2.cup and
[herrmann2.ioccc][(herrmann2.ioccc]) by say:
/[pon]\
@@ -177,7 +177,7 @@ to about 9k.
3D picture, constructed of random characters (with ASCII code between
32 and 126). For example, type
-
./herrmann2< herrmann2.ioccc
+
./herrmann2 < herrmann2.ioccc
If you want to control the characters used in the output (for
example if your picture is to consist only of digits), pass them
@@ -186,9 +186,9 @@ new random character, it will take the next one from the
argument. When it arrives at the end of the argument, it will
start over at the beginning. Example:
Due to the way these 3D pictures work, the left part of the
@@ -216,15 +216,15 @@ get it (if you lost it or if you don’t have it already) is to use
the program itself on the right picture and with the right
argument:
If I had submitted the program last year, I would have said that
it has exactly the maximum allowed length: 1536 characters. Now
@@ -267,7 +267,7 @@ only needs a logarithmic recursion depth! (Find out how this
works.)
When still in doubt about how to judge this program, type
-
./herrmann2< herrmann2.cup
+
./herrmann2 < herrmann2.cup
and let the result inspire you. ;-)
Requirements to the compiler / Compatibility
diff --git a/2001/jason/README.md b/2001/jason/README.md
index fdc8a4c6d..5e4bb6eba 100644
--- a/2001/jason/README.md
+++ b/2001/jason/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./jason
```
@@ -37,7 +37,7 @@ cause problems. Go ahead, try it! :-)
TED Shroyer came up with the idea that made it possible to hide all
the text. Thanks, TED. You won. :)
-```sh
+```
cc -o jason jason.c
./jason
you are in a maze of twisty little passages
diff --git a/2001/jason/index.html b/2001/jason/index.html
index 827a54176..562152aad 100644
--- a/2001/jason/index.html
+++ b/2001/jason/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./jason
+
./jason
Judges’ remarks:
You are in a maze of twisty little passages, all alike.
The really amazing part of this is that it’s a text adventure, and there’s
@@ -160,13 +160,13 @@ cause problems. Go ahead, try it! :-)
Author’s remarks:
TED Shroyer came up with the idea that made it possible to hide all
the text. Thanks, TED. You won. :)
-
cc-o jason jason.c
-./jason
-you are in a maze of twisty little passages
-caves lead: left forward back
-you see
-a lamp
-> _
+
cc -o jason jason.c
+ ./jason
+ you are in a maze of twisty little passages
+ caves lead: left forward back
+ you see
+ a lamp
+ > _
This program is a rather nostalgic little labyrinth game. Start
out by typing “get lamp”, then use the direction words “left”,
“right”, “forward”, and “back” to explore the caves. Note that
diff --git a/2001/kev/README.md b/2001/kev/README.md
index 23555bd96..d45a0f4ce 100644
--- a/2001/kev/README.md
+++ b/2001/kev/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2001 kev bugs](../../bugs.html#2001_kev).
## To use:
-```sh
+```
./kev # in one terminal
./kev hostname # in another terminal
@@ -32,7 +32,7 @@ NOTE: each player's paddle is at the bottom and the opponent at the top.
## Try:
-```sh
+```
./kev # in one terminal
./kev localhost # in another terminal on the same host
@@ -41,13 +41,13 @@ NOTE: each player's paddle is at the bottom and the opponent at the top.
If you need to change the speed you can reconfigure it like (say
for over a network and not the same host):
-```sh
+```
make clobber SPEED=50 all # original default value which is very fast
```
If you wish to change the port you can do so like:
-```sh
+```
make clobber PORT=3773 all
```
@@ -58,19 +58,19 @@ syscall with the `l_` macro, changing the `L` variable like one would `PORT`. Of
course you can do more than one at the same time. For instance to change the
speed and port:
-```sh
+```
make clobber SPEED=512 PORT=3773 all
```
If you have `xterm` try on one system:
-```sh
+```
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
```
and then the other, the client system:
-```sh
+```
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
```
@@ -85,7 +85,7 @@ awkward `,` and `.` keys to move your paddle.
### Alternate build:
-```sh
+```
make alt
```
@@ -105,13 +105,13 @@ terminal?
If you have `xterm` try on one system:
-```sh
+```
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
```
and then the other, the client system:
-```sh
+```
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
```
@@ -151,14 +151,14 @@ getting the ball past your opponent's paddle. It's pretty fun! :)
Run the server first without any command line arguments, i.e.
-```sh
+```
./kev
```
Then run the client with a single command line argument which is
the name of the machine running the server, e.g.
-```sh
+```
./kev localhost
```
@@ -169,7 +169,7 @@ blocked by a firewall.
Here's a good quick example to see it in action on your own
machine, assuming you have `Xwindows`:
-```sh
+```
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
```
diff --git a/2001/kev/index.html b/2001/kev/index.html
index 0646ec5de..799eebf62 100644
--- a/2001/kev/index.html
+++ b/2001/kev/index.html
@@ -141,7 +141,7 @@ Location: AU - Commonwealth of Australi
To build:
-
make
+
make
There is another version which lets you use the arrow keys rather than the more
awkward , and . keys. See alternate code below.
Bugs and (Mis)features:
@@ -149,35 +149,35 @@ awkward , and . keys. See al
./kev# in one terminal
-
-./kev hostname # in another terminal
+
./kev # in one terminal
+
+ ./kev hostname # in another terminal
NOTE: each player’s paddle is at the bottom and the opponent at the top.
Try:
-
./kev# in one terminal
-
-./kev localhost # in another terminal on the same host
+
./kev # in one terminal
+
+ ./kev localhost # in another terminal on the same host
If you need to change the speed you can reconfigure it like (say
for over a network and not the same host):
-
make clobber SPEED=50 all # original default value which is very fast
+
make clobber SPEED=50 all # original default value which is very fast
If you wish to change the port you can do so like:
-
make clobber PORT=3773 all
+
make clobber PORT=3773 all
Of course if you want a port < 1024 you’ll need to be root so don’t do that.
And if you know what you’re doing you can redefine the call to the socket(2)
syscall with the l_ macro, changing the L variable like one would PORT. Of
course you can do more than one at the same time. For instance to change the
speed and port:
-
make clobber SPEED=512 PORT=3773 all
+
make clobber SPEED=512 PORT=3773 all
If you have xterm try on one system:
-
xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
+
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
and then the other, the client system:
-
xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
+
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
This might look nicer than just the terminal itself.
Alternate code:
This version allows you to use arrow keys on the keyboard rather than the more
awkward , and . keys to move your paddle.
Alternate build:
-
make alt
+
make alt
You can reconfigure the macros described above in the same way.
Alternate use:
Use kev.alt as you would kev.
@@ -185,9 +185,9 @@ awkward , and . keys to move your paddle.
terminal?
Alternate try:
If you have xterm try on one system:
-
xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
+
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt &
and then the other, the client system:
-
xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
+
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev.alt localhost&
Judges’ remarks:
Continuing with this year’s “retro game” theme, this is another old game;
arguably, one of the oldest. Requires a functioning network, and curses.
@@ -212,17 +212,17 @@ speeds. Each player has a paddle to hit the ball, and you get points for
getting the ball past your opponent’s paddle. It’s pretty fun! :)
RUNNING
Run the server first without any command line arguments, i.e.
-
./kev
+
./kev
Then run the client with a single command line argument which is
the name of the machine running the server, e.g.
-
./kev localhost
+
./kev localhost
Make sure that the terminals on both ends are the same size. Also, the TCP port
number (by default 5455) specified in the Makefile mustn’t be
blocked by a firewall.
Here’s a good quick example to see it in action on your own
machine, assuming you have Xwindows:
-
xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
-xterm-geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
+
xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev &
+ xterm -geometry 80x40 -fg green -bg black -fn 9x15bold -e ./kev localhost&
PLAYING
Your paddle is the one at the bottom of the screen, your opponent
is at the top. To move your paddle left, hold down , (i.e. <
diff --git a/2001/ollinger/README.md b/2001/ollinger/README.md
index 2e1f80115..28bec6d77 100644
--- a/2001/ollinger/README.md
+++ b/2001/ollinger/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./ollinger integer
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2001/ollinger/index.html b/2001/ollinger/index.html
index 5471516bc..5f4250b8d 100644
--- a/2001/ollinger/index.html
+++ b/2001/ollinger/index.html
@@ -141,11 +141,11 @@ Location: FR - French Republic (
To build:
-
make
+
make
To use:
-
./ollinger integer
+
./ollinger integer
Try:
-
./try.sh
+
./try.sh
Try the above command in a large window, say 200 chars wide and 100
high (200x100) with a tiny font.
Judges’ remarks:
diff --git a/2001/rosten/README.md b/2001/rosten/README.md
index 4850b0412..deb0a58cc 100644
--- a/2001/rosten/README.md
+++ b/2001/rosten/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 rosten bugs](../../bugs.html#2001_rosten
## To use:
-```sh
+```
./rosten [number]
```
@@ -30,14 +30,14 @@ NOTE: number is floating point.
## Try:
-```sh
+```
./rosten 1.03
./rosten 1.00
```
For some abuse, try:
-```sh
+```
./rosten 0.99
```
@@ -57,7 +57,7 @@ cursor) in the wrong way. :-)
### SYNOPSIS
-```sh
+```
./rosten [greasiness]
```
@@ -94,7 +94,7 @@ portable, but compile with almost no warnings on most of the compilers
tested. It's a kind of shame that none of the compilers do anything
like this:
-```sh
+```
$ make greasymouse
cc greasymouse.c -o greasymouse -lX11
greasymouse.c:30: This macro should have more text and spaces in it
@@ -142,7 +142,7 @@ the way it's used to.
The MIPS compiler suggests an `==` instead of an `=` in expressions
such as:
-```c
+```
&&(a=b)
```
diff --git a/2001/rosten/index.html b/2001/rosten/index.html
index 2d97bd752..49dc56c33 100644
--- a/2001/rosten/index.html
+++ b/2001/rosten/index.html
@@ -141,21 +141,21 @@ Location: GB - United Kingdom of Great
WARNING: this will mess with your mouse and can make it hard to quit the
program. Use at your own risk.
NOTE: number is floating point.
Try:
-
./rosten 1.03
-./rosten 1.00
+
./rosten 1.03
+ ./rosten 1.00
For some abuse, try:
-
./rosten 0.99
+
./rosten 0.99
Judges’ remarks:
Friction can be your friend if it does not rub you (or your mouse
cursor) in the wrong way. :-)
@@ -163,7 +163,7 @@ cursor) in the wrong way. :-)
NAME
rosten - make the mouse act as if it has been greased
SYNOPSIS
-
./rosten[greasiness]
+
./rosten [greasiness]
DESCRIPTION
This program is designed primarily to make your X windows interface more
obfuscated. Try doing something mouse driven (such as using a mouse
@@ -183,15 +183,15 @@ required is a large desk and some good grease.
portable, but compile with almost no warnings on most of the compilers
tested. It’s a kind of shame that none of the compilers do anything
like this:
-
$ make greasymouse
-cc greasymouse.c -o greasymouse -lX11
-greasymouse.c:30: This macro should have more text and spaces in it
-greasymouse.c:32: This is a really stupid way to perform this operation
-greasymouse.c:42: This program would look better with a newline here
-greasymouse.c:48: That's a really silly thing to do
- greasymouse.c:55: So is that
- ...
- greasymouse.c:58: This program is rubbish. I'm not going to link it.
+
$ make greasymouse
+ cc greasymouse.c -o greasymouse -lX11
+ greasymouse.c:30: This macro should have more text and spaces in it
+ greasymouse.c:32: This is a really stupid way to perform this operation
+ greasymouse.c:42: This program would look better with a newline here
+ greasymouse.c:48: That's a really silly thing to do
+ greasymouse.c:55: So is that
+ ...
+ greasymouse.c:58: This program is rubbish. I'm not going to link it.
The code is best viewed with tab stops every 8 spaces.
BUGS
The mouse gets stuck completely if you give it an option of less
@@ -213,7 +213,7 @@ would never do a thing like that: I just haven’t used them in
the way it’s used to.
The MIPS compiler suggests an == instead of an = in expressions
such as:
-
&&(a=b)
+
&&(a=b)
but its suggestions would break my program. It also reckons
that r() has no prototype.
Giving the -pedantic option to the MIPS compiler causes it to generate
diff --git a/2001/schweikh/README.md b/2001/schweikh/README.md
index 6f0b4c42c..c0b7a466b 100644
--- a/2001/schweikh/README.md
+++ b/2001/schweikh/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 schweikh bugs](../../bugs.html#2001_schw
## To use:
-```sh
+```
./schweikh string string2
```
@@ -40,7 +40,7 @@ This is supposed to happen. As is written in the
## Try:
-```sh
+```
./try.sh
```
@@ -64,7 +64,7 @@ pattern if you are looking for something in the middle.
You can use it for your shell scripting needs similar to a silent grep
(and without `stdout` redirected to `/dev/null`):
-```sh
+```
if prog "${VARIABLE}" ''; then
echo VARIABLE matches
else
diff --git a/2001/schweikh/index.html b/2001/schweikh/index.html
index 6d3c239a5..94ec92997 100644
--- a/2001/schweikh/index.html
+++ b/2001/schweikh/index.html
@@ -141,13 +141,13 @@ Location: DE - Federal Republic of Germ
@@ -170,11 +170,11 @@ the whole string, so you may want to use * at the beginning and end
pattern if you are looking for something in the middle.
You can use it for your shell scripting needs similar to a silent grep
(and without stdout redirected to /dev/null):
-
ifprog"${VARIABLE}"'<glob>';then
-echo VARIABLE matches
-else
-echo no match
-fi
+
if prog "${VARIABLE}" '<glob>'; then
+ echo VARIABLE matches
+ else
+ echo no match
+ fi
Bugs
There is no way to escape the meta characters. Dammit Jim, I’m a
one-liner, not a regexp lib.
diff --git a/2001/westley/README.md b/2001/westley/README.md
index 130a6d2e1..90e05afe9 100644
--- a/2001/westley/README.md
+++ b/2001/westley/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -25,7 +25,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl
## To use:
-```sh
+```
./westley 2>/dev/null
# enter some input, terminate with EOF
@@ -37,7 +37,7 @@ For more detailed information see [2001 westley bugs](../../bugs.html#2001_westl
## Try:
-```sh
+```
./try.sh
```
@@ -60,7 +60,7 @@ everyone in the face! :-) This is also compiled by default.
### Punch card try:
-```sh
+```
echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null
```
@@ -73,7 +73,7 @@ This alternate code might be less portable.
### Alternate build:
-```sh
+```
make alt
```
@@ -108,7 +108,7 @@ to punch cards - C programs can be written to be "drop proof".
Consider the following C program:
-```c
+```
main(){a();b();c();}
a(){printf("A");}
b(){printf("B");}
@@ -122,7 +122,7 @@ any particular order\*\*; it will always produce `ABC` as output.
You can also use global variables:
-```c
+```
char *greet = "Hello, world!";
char *greet; main(){puts(greet);}
```
@@ -132,7 +132,7 @@ It would be trivial to write an entire C program that is
possible to write a program that will always compile but
behave differently depending on the line order:
-```c
+```
test(a,b){return a;}
#define test(a,b) test(b,a)
main(){if (test(0,1)) printf("T"); else printf("F");}
@@ -144,7 +144,7 @@ falls between the declaration of `test()` and its use in
you can use the same call to `test()` repeatedly in
different lines to return different values:
-```c
+```
#define test(x,y) test(y,x)
main(){int i=0;a(&i);b(&i);c(&i);d(&i);printf("%d\n",i);}
a(i)int*i;{if (test(0,1)) *i += 1;}
diff --git a/2001/westley/index.html b/2001/westley/index.html
index a94053795..bf1377749 100644
--- a/2001/westley/index.html
+++ b/2001/westley/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
./westley2>/dev/null
-# enter some input, terminate with EOF
-
-echo foo |./westley2>/dev/null
-
-./westley< westley.c 2>/dev/null
+
./westley 2>/dev/null
+ # enter some input, terminate with EOF
+
+ echo foo | ./westley 2>/dev/null
+
+ ./westley < westley.c 2>/dev/null
Try:
-
./try.sh
+
./try.sh
Sorted code:
The author stated that one can sort (ignoring leading blanks i.e. sort -b) the
code by line and it will always sort the order of the input.
@@ -171,12 +171,12 @@ code by line and it will always sort the order of the input.
westley.punch.c code is specifically so that Westley can punch
everyone in the face! :-) This is also compiled by default.
Punch card try:
-
echo'Brian Westley does it again!'|./westley.punch2>/dev/null
+
echo 'Brian Westley does it again!' | ./westley.punch 2>/dev/null
Alternate code:
An alternate version of this entry, westley.alt.c, is provided.
This alternate code might be less portable.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use westley.alt as you would westley above.
Judges’ remarks:
@@ -195,36 +195,36 @@ were becoming obsolete just as C was becoming more popular*; this is rather
unfortunate, because C has an advantage over many other languages when it comes
to punch cards - C programs can be written to be “drop proof”.
This program will compile and run no matter what order the
lines are in. If you punch it on cards (one line of code per
card, naturally) and drop them, you don’t need to put them in
any particular order**; it will always produce ABC as output.
It would be trivial to write an entire C program that is
“drop proof” using the above techniques; surprisingly, it’s
possible to write a program that will always compile but
behave differently depending on the line order:
This program will print out T if the #define statement
falls between the declaration of test() and its use in
main(), otherwise it will print out F. Furthermore,
you can use the same call to test() repeatedly in
different lines to return different values:
If you enter the above program on punch cards, throw them
up in the air, gather them up, and run it, you will get
a number from 0 to 15 printed out. Now that’s a random
diff --git a/2001/williams/README.md b/2001/williams/README.md
index aec31762b..e1e46d7ff 100644
--- a/2001/williams/README.md
+++ b/2001/williams/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2001 williams bugs](../../bugs.html#2001_will
## To use:
-```sh
+```
./williams
```
diff --git a/2001/williams/index.html b/2001/williams/index.html
index e3c6337eb..64f36d0b7 100644
--- a/2001/williams/index.html
+++ b/2001/williams/index.html
@@ -141,13 +141,13 @@ Location: ZZ - Unknown location
A strange game. The only winning move is not to
play. No, really; you can’t
diff --git a/2004/anonymous/README.md b/2004/anonymous/README.md
index 84ff70b52..129e7d637 100644
--- a/2004/anonymous/README.md
+++ b/2004/anonymous/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./anonymous 'foo' > bar.pgm
```
@@ -21,7 +21,7 @@ images.
## Try:
-```sh
+```
./try.sh
```
@@ -107,7 +107,7 @@ The following command thus writes a rendering of the [Ring
inscription](https://www.glyphweb.com/arda/r/ringinscription.html) to
the file `ring.pgm`:
-```sh
+```
./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \
ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >ring.pgm
```
diff --git a/2004/anonymous/index.html b/2004/anonymous/index.html
index 0dea0b6a3..7fa90e8a9 100644
--- a/2004/anonymous/index.html
+++ b/2004/anonymous/index.html
@@ -141,9 +141,9 @@ Location: SG - Republic of Singapore
To build:
-
make
+
make
To use:
-
./anonymous'foo'> bar.pgm
+
./anonymous 'foo' > bar.pgm
Now open the output using your favourite
pgm viewer. If you don’t
have a pgm viewer then we suggest the netpbm
@@ -151,7 +151,7 @@ toolkit to convert the image to a graphics
format that you can view. Most graphical web browsers can display PNG or JPEG
images.
Try:
-
./try.sh
+
./try.sh
NOTE: technically the text is supposed to be in all lower case but the script
does use some upper case letters for demonstration purposes.
Judges’ remarks:
@@ -220,8 +220,8 @@ in lower case.
The following command thus writes a rendering of the Ring
inscription to
the file ring.pgm:
The source code assumes the ASCII character set; also, due to space
constraints, the program uses rather inefficient algorithms, so it may
waste a lot of time and space even when rendering moderately long
diff --git a/2004/arachnid/README.md b/2004/arachnid/README.md
index 21fd5b2a3..6411587e5 100644
--- a/2004/arachnid/README.md
+++ b/2004/arachnid/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,20 +11,20 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./arachnid [mazefile]
```
## Try:
-```sh
+```
./arachnid arachnid.txt
```
and then try:
-```sh
+```
./arachnid arachnid.c
```
@@ -41,7 +41,7 @@ instead.
### Alternate build:
-```sh
+```
make alt
```
@@ -80,7 +80,7 @@ explorers out there.
### Usage
-```sh
+```
./arachnid [mazefile]
```
diff --git a/2004/arachnid/index.html b/2004/arachnid/index.html
index dc1def705..7b7ba1dbc 100644
--- a/2004/arachnid/index.html
+++ b/2004/arachnid/index.html
@@ -141,16 +141,16 @@ Location: NZ - New Zealand
To build:
-
make
+
make
There is an alt version for rogue players, vi(m) users and Dvorak typist (i.e.
those who need hljk for moving left, right, down and up. See alternate
code below.
To use:
-
./arachnid[mazefile]
+
./arachnid [mazefile]
Try:
-
./arachnid arachnid.txt
+
./arachnid arachnid.txt
and then try:
-
./arachnid arachnid.c
+
./arachnid arachnid.c
Navigation is through the use of the wasd inverted-T formation on
QWERTY keyboards. Rogue players, vi users, and Dvorak typists are
invited to get lost (or use the alt version)!
@@ -158,7 +158,7 @@ invited to get lost (or use the alt version)!
If you don’t like the wasd movement keys you can try the vi(m) movement keys
instead.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use arachnid.alt as you would arachnid above.
Judges’ remarks:
@@ -181,7 +181,7 @@ Another maze, arachnid.txt has also been provided. Th
255x255, about the largest maze supported, for the particularly insane maze
explorers out there.
Usage
-
./arachnid[mazefile]
+
./arachnid [mazefile]
You can explore the maze using the w,a,s, and d keys.
make
```
@@ -10,7 +10,7 @@ will not work with it enabled.
## To use:
-```sh
+```
./burley
```
diff --git a/2004/burley/index.html b/2004/burley/index.html
index ca3871288..bc28babc1 100644
--- a/2004/burley/index.html
+++ b/2004/burley/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
will not work with it enabled.
To use:
-
./burley
+
./burley
NOTE: you need to input a number first. See judges’ remarks below for
information on how to play.
Judges’ remarks:
diff --git a/2004/gavare/README.md b/2004/gavare/README.md
index 473563536..92ce998fb 100644
--- a/2004/gavare/README.md
+++ b/2004/gavare/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ for more details.
## To use:
-```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
```
@@ -28,7 +28,7 @@ and then view `ioccc_ray.jpg` in a graphics viewer, editor or web browser.
If you have `xv(1)` you can do:
-```sh
+```
./gavare | xv -
```
@@ -53,19 +53,19 @@ on `stdout` which theoretically should work in Windows.
To build the configurable and unobfuscated versions:
-```sh
+```
make alt
```
To change the default size from 1024x768 try:
-```sh
+```
make clobber XX=640 YY=480 alt
```
You might also wish to change the anti-alias setting:
-```sh
+```
make clobber AA=2 alt
```
@@ -78,7 +78,7 @@ This is not possible with the author's version but it is with the alt versions
As the Windows version will not compile on most viewers' systems we do not build
it with `make alt`; instead try:
-```sh
+```
make alt2
```
diff --git a/2004/gavare/index.html b/2004/gavare/index.html
index 8cadf4c3c..2945549cf 100644
--- a/2004/gavare/index.html
+++ b/2004/gavare/index.html
@@ -141,18 +141,18 @@ Location: SE - Kingdom of Sweden (
To build:
-
make
+
make
There are three alternate versions; see alternate code below
for more details.
To use:
-
./gavare> ioccc_ray.ppm
+
./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:
-
convert ioccc_ray.ppm ioccc_ray.jpg
+
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:
-
./gavare|xv-
+
./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 allows you to change the size of the
@@ -165,18 +165,18 @@ was used during development, which we have included in the file
on stdout which theoretically should work in Windows.
Alternate build:
To build the configurable and unobfuscated versions:
-
make alt
+
make alt
To change the default size from 1024x768 try:
-
make clobber XX=640 YY=480 alt
+
make clobber XX=640 YY=480 alt
You might also wish to change the anti-alias setting:
-
make clobber AA=2 alt
+
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).
As the Windows version will not compile on most viewers’ systems we do not build
it with make alt; instead try:
-
make alt2
+
make alt2
Alternate use:
Use gavare.alt, gavare.r3 or gavare.alt2 as you would gavare above.
Judges’ remarks:
diff --git a/2004/gavin/README.md b/2004/gavin/README.md
index 9365781b0..355192b0b 100644
--- a/2004/gavin/README.md
+++ b/2004/gavin/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -25,7 +25,7 @@ For more detailed information see [2004 gavin bugs](../../bugs.html#2004_gavin).
## To use:
-```sh
+```
./gavin
```
@@ -36,14 +36,14 @@ To enjoy the results (on a Linux/x86 machine) with a floppy drive (remember
those? We do!):
-```sh
+```
su
```
Make a floppy with an ext2 filesystem (`mke2fs /dev/fd0` replacing `fd0` with
whatever the floppy device is!), mount it under `/mnt/floppy` and then:
-```sh
+```
cp kernel fs.tar lilo.conf boot.b /mnt/floppy
```
@@ -51,26 +51,26 @@ NOTE: If the version of your lilo is not 21.4, use the appropriate boot.b file.
NOTE: If your floppy drive is not `/dev/fd0`, edit lilo.conf appropriately.
-```sh
+```
lilo -C /mnt/floppy/lilo.conf
```
Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse.
Move the window away from the corner.
-```sh
+```
vi gavin.c
```
Scroll up and down the file with up-arrow and down-arrow.
-```sh
+```
sh
```
You can have several shell windows:
-```sh
+```
vi README.md
./prim
```
@@ -86,7 +86,7 @@ you can use it with `QEMU`.
### Alternate build:
-```sh
+```
make alt
```
diff --git a/2004/gavin/index.html b/2004/gavin/index.html
index 98602f50c..4df5f8f49 100644
--- a/2004/gavin/index.html
+++ b/2004/gavin/index.html
@@ -141,7 +141,7 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
There is an alternate version for those who wish to use QEMU rather than having
to reboot and rely on having a floppy drive (if you even remember what those are
:-) ) etc. See alternate code below.
@@ -152,31 +152,31 @@ to reboot and rely on having a floppy drive (if you even remember what those are
STATUS: INABIAF - please **DO NOT** fix
To enjoy the results (on a Linux/x86 machine) with a floppy drive (remember
those? We do!):
-
su
+
su
Make a floppy with an ext2 filesystem (mke2fs /dev/fd0 replacing fd0 with
whatever the floppy device is!), mount it under /mnt/floppy and then:
-
cp kernel fs.tar lilo.conf boot.b /mnt/floppy
+
cp kernel fs.tar lilo.conf boot.b /mnt/floppy
NOTE: If the version of your lilo is not 21.4, use the appropriate boot.b file.
NOTE: If your floppy drive is not /dev/fd0, edit lilo.conf appropriately.
-
lilo-C /mnt/floppy/lilo.conf
+
lilo -C /mnt/floppy/lilo.conf
Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse.
Move the window away from the corner.
-
vi gavin.c
+
vi gavin.c
Scroll up and down the file with up-arrow and down-arrow.
-
sh
+
sh
You can have several shell windows:
-
vi README.md
-./prim
+
vi README.md
+ ./prim
Press and hold any key.
Alternate code:
This version’s main difference is that the macro K is redefined to 1 so that
you can use it with QEMU.
Alternate build:
-
make alt
+
make alt
Alternate use:
The use is mostly the same as gavin except that one initially executes gavin.alt
(which make alt will do) and one will have to use QEMU instead. The files
diff --git a/2004/hibachi/README.md b/2004/hibachi/README.md
index 5e0495890..d75c7b660 100644
--- a/2004/hibachi/README.md
+++ b/2004/hibachi/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
cd build; ./hibachi-start.sh &
```
@@ -42,7 +42,7 @@ 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
lynx hibachi/localhost/index.html
```
@@ -58,19 +58,19 @@ To build just the executable:
For Cygwin, FreeBSD, Linux (newer), Mac OS X:
-```sh
+```
gcc -o hibachi hibachi.c
```
For Linux (older):
-```sh
+```
gcc -DSHUT_WR=1 -o hibachi hibachi.c
```
For SunOS:
-```sh
+```
gcc -o hibachi hibachi.c -lnsl -lsocket
```
@@ -88,20 +88,20 @@ examples. In which case the preferred build commands are:
To start the server on the default port (8008):
-```sh
+```
cd build;
./hibachi-start.sh &
```
To test the server:
-```sh
+```
lynx http://localhost:8008/
```
To stop the server:
-```sh
+```
kill %1
```
diff --git a/2004/hibachi/index.html b/2004/hibachi/index.html
index 651bd8429..87fca84d8 100644
--- a/2004/hibachi/index.html
+++ b/2004/hibachi/index.html
@@ -141,9 +141,9 @@ Location: CA - Canada
To build:
-
make
+
make
To use:
-
cd build;./hibachi-start.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-start.sh for
@@ -163,19 +163,19 @@ so the file does not exist here.
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:
tar -zxf hibachi.tgz
+ lynx hibachi/localhost/index.html
Or once Hibachi is running, use a web browser (preferably one that
supports images and JavaScript, to view the documentation and try
some of the CGI examples) to visit: http://localhost:8008/.
Building
To build just the executable:
For Cygwin, FreeBSD, Linux (newer), Mac OS X:
-
gcc-o hibachi hibachi.c
+
gcc -o hibachi hibachi.c
For Linux (older):
-
gcc-DSHUT_WR=1 -o hibachi hibachi.c
+
gcc -DSHUT_WR=1 -o hibachi hibachi.c
For SunOS:
-
gcc-o hibachi hibachi.c -lnsl-lsocket
+
gcc -o hibachi hibachi.c -lnsl -lsocket
Since some systems place socket and network functions into other libraries, a
GNU autoconfconfigure script has been
@@ -185,12 +185,12 @@ examples. In which case the preferred build commands are:
./configure [--enable-port=number]
make
To start the server on the default port (8008):
-
cd build;
-./hibachi-start.sh&
+
cd build;
+ ./hibachi-start.sh &
To test the server:
-
lynx http://localhost:8008/
+
lynx http://localhost:8008/
To stop the server:
-
kill %1
+
kill %1
Features
Supports virtual hosts.
diff --git a/2004/hoyle/README.md b/2004/hoyle/README.md
index ce72288ba..905c94ad7 100644
--- a/2004/hoyle/README.md
+++ b/2004/hoyle/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./hoyle point ...
```
## Try:
-```sh
+```
./try.sh
```
@@ -47,13 +47,13 @@ passed in.
For example, to graph `y = x^2`:
-```sh
+```
./hoyle 0 0 1
```
Note that:
-```sh
+```
./hoyle 0 0 2
```
diff --git a/2004/hoyle/index.html b/2004/hoyle/index.html
index 3460a4d6f..2bb08aa74 100644
--- a/2004/hoyle/index.html
+++ b/2004/hoyle/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./hoyle point ...
+
./hoyle point ...
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The obfuscation functions at several levels. Note the clever
use of use of #defines. The #define do(if,else), for example,
@@ -167,9 +167,9 @@ passed in.
dashes rather than a simple block of Xs.
For example, to graph y = x^2:
-
./hoyle 0 0 1
+
./hoyle 0 0 1
Note that:
-
./hoyle 0 0 2
+
./hoyle 0 0 2
will produce the same graph, since the y-axis is auto scaling.
make
```
@@ -21,14 +21,14 @@ For more detailed information see [2004 jdalbec bugs](../../bugs.html#2004_jdalb
## To use:
-```sh
+```
./jdalbec number ...
```
## Try:
-```sh
+```
./try.sh
```
@@ -43,7 +43,7 @@ which line it is on.
### Alternate build:
-```sh
+```
make alt
```
@@ -52,7 +52,7 @@ many number of lines to print on a line. Set at default to 11 protons, salt, if
you wish to make it silver, 47 (a prime) protons, do:
-```sh
+```
make clobber Ag=47 alt
```
@@ -60,7 +60,7 @@ though it might be odd to have 47 numbers on a line as it would defeat the
purpose. :-) Or if you prefer some prime, golden irony:
-```sh
+```
make clobber Ag=79 alt
```
@@ -72,7 +72,7 @@ Use `jdalbec.alt` as you would `jdalbec` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
diff --git a/2004/jdalbec/index.html b/2004/jdalbec/index.html
index 0622267c6..23f92668e 100644
--- a/2004/jdalbec/index.html
+++ b/2004/jdalbec/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version that allows one to control the number of numbers
to print on a line. See alternate code below.
Bugs and (Mis)features:
@@ -149,27 +149,27 @@ to print on a line. See alternate code below.
This version lets you control how many numbers to show on a line before adding a
newline as it can be harder to see when there are a lot of numbers. For lines
that don’t end up having too many line breaks it also makes it easier to see
which line it is on.
Alternate build:
-
make alt
+
make alt
The macro Ag (silver) controls how
many number of lines to print on a line. Set at default to 11 protons, salt, if
you wish to make it silver, 47 (a prime) protons, do:
-
make clobber Ag=47 alt
+
make clobber Ag=47 alt
though it might be odd to have 47 numbers on a line as it would defeat the
purpose. :-) Or if you prefer some prime, golden irony:
-
make clobber Ag=79 alt
+
make clobber Ag=79 alt
Alternate use:
Use jdalbec.alt as you would jdalbec above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
We still aren’t sure whether or not this is a useful program, but
it’s the first atomic fission we’ve seen in the IOCCC.
diff --git a/2004/kopczynski/README.md b/2004/kopczynski/README.md
index ede111eab..3f45a0bc7 100644
--- a/2004/kopczynski/README.md
+++ b/2004/kopczynski/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ will not work with it enabled.
## To use:
-```sh
+```
./kopczynski < input_file
```
## Try:
-```sh
+```
./try.sh
```
@@ -34,14 +34,14 @@ does.
### Alternate build:
-```sh
+```
make alt
```
### Alternate try:
-```sh
+```
./kopczynski.alt < kopczynski-10
echo $?
```
diff --git a/2004/kopczynski/index.html b/2004/kopczynski/index.html
index 919c8fd53..3e9e77cf1 100644
--- a/2004/kopczynski/index.html
+++ b/2004/kopczynski/index.html
@@ -141,13 +141,13 @@ Location: PL - Republic of Poland
To build:
-
make
+
make
NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
will not work with it enabled.
To use:
-
./kopczynski< input_file
+
./kopczynski < input_file
Try:
-
./try.sh
+
./try.sh
What happens if you feed the program source to the program? Can you figure out
why?
Alternate code:
@@ -155,10 +155,10 @@ why?
program returned the result as an exit code which is what the alternate version
does.
Alternate build:
-
make alt
+
make alt
Alternate try:
-
./kopczynski.alt< kopczynski-10
-echo$?
+
./kopczynski.alt < kopczynski-10
+ echo $?
Judges’ remarks:
What is in a line? A lot when you obfuscate the way Eryk Kopczynski
did it. This small one line program is an outstanding technical
diff --git a/2004/newbern/README.md b/2004/newbern/README.md
index 7c2de3fd5..74a13a23d 100644
--- a/2004/newbern/README.md
+++ b/2004/newbern/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./newbern [file.dat arg]
```
## Try:
-```sh
+```
./try.sh
```
@@ -34,14 +34,14 @@ This is a configurable `banner(1)`-like program.
- To convert a character glyph into a data file:
-```sh
+```
./newbern char < some_nicely_shaped_text >> data_file
```
- To print a string using glyphs from a data file:
-```sh
+```
./newbern data_file a_string
```
diff --git a/2004/newbern/index.html b/2004/newbern/index.html
index 707c56f2a..12eac61bf 100644
--- a/2004/newbern/index.html
+++ b/2004/newbern/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
To use:
-
./newbern [file.dat arg]
+
./newbern [file.dat arg]
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The program is formatted using the same font glyphs as the example
data file.
The program can also act as a Morse encoder, unarguably.
It also has double-super-secret encryption capabilities.
diff --git a/2004/omoikane/README.md b/2004/omoikane/README.md
index a56689061..d1234803f 100644
--- a/2004/omoikane/README.md
+++ b/2004/omoikane/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./omoikane infile layout outfile
```
@@ -43,7 +43,7 @@ insert a human-readable checksum string in the text itself! `^_^`
### Usage
-```sh
+```
./omoikane
```
diff --git a/2004/omoikane/index.html b/2004/omoikane/index.html
index 34cf5d461..06e864baa 100644
--- a/2004/omoikane/index.html
+++ b/2004/omoikane/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./omoikane infile layout outfile
+
./omoikane infile layout outfile
Try:
./try.sh
Judges’ remarks:
@@ -161,7 +161,7 @@ Comments refer to it as such.
strange file names or package .SFVs with your files! Rinia will
insert a human-readable checksum string in the text itself! ^_^
Usage
-
./omoikane<infile><layout><outfile>
+
./omoikane <infile> <layout> <outfile>
All three arguments may reference the same file. All files is
assumed to be of ASCII character set.
Input
diff --git a/2004/schnitzi/README.md b/2004/schnitzi/README.md
index feace3a2c..30dd06415 100644
--- a/2004/schnitzi/README.md
+++ b/2004/schnitzi/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./schnitzi
./try.sh
```
@@ -132,13 +132,13 @@ Try one of these methods to get the animation to run:
1. Redirect the output directly to vi, like this:
-```sh
+```
./schnitzi < input.dat | vi
```
2. Redirect the output to a file, like this:
-```sh
+```
./schnitzi < input.dat > output.dat
```
diff --git a/2004/schnitzi/index.html b/2004/schnitzi/index.html
index 7860a6a97..cb71b101a 100644
--- a/2004/schnitzi/index.html
+++ b/2004/schnitzi/index.html
@@ -141,11 +141,11 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
To use:
-
./schnitzi<foo |vi-n
+
./schnitzi <foo | vi -n
Try:
-
./try.sh
+
./try.sh
NOTE: if you’re one of those who don’t know how to exit vi :-) don’t worry as
it will exit for you.
Judges’ remarks:
@@ -221,11 +221,11 @@ scene, the other a bit of scrolling text.
Redirect the output directly to vi, like this:
-
./schnitzi< input.dat |vi
+
./schnitzi < input.dat | vi
Redirect the output to a file, like this:
-
./schnitzi< input.dat > output.dat
+
./schnitzi < input.dat > output.dat
Then, open the output file, select the text, and copy it
to your system pasteboard/cut/selection buffer and paste
it into vi. The paste is NOT the vi paste command, but
diff --git a/2004/sds/README.md b/2004/sds/README.md
index d55ecce7a..e26089882 100644
--- a/2004/sds/README.md
+++ b/2004/sds/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2004 sds bugs](../../bugs.html#2004_sds).
## To use:
-```sh
+```
./sds
```
## Try:
-```sh
+```
./try.sh
```
@@ -63,13 +63,13 @@ decoder.
Try it out. Compile the program, then type
-```sh
+```
./sds < sds.c
```
You should see the encoder program displayed. Now save it, like:
-```sh
+```
./sds < sds.c > encoder.c
```
@@ -82,14 +82,14 @@ standard input, and will output the results on the standard output.
You can use it like this (assuming you have a file called remarks):
-```sh
+```
echo 'Hello, World!' > message
./encoder message < remarks > remarks_msg
```
Then to decode:
-```sh
+```
./sds < remarks_msg
Hello, World!
```
diff --git a/2004/sds/index.html b/2004/sds/index.html
index 0348d1ce7..d1aa5529f 100644
--- a/2004/sds/index.html
+++ b/2004/sds/index.html
@@ -141,15 +141,15 @@ Location: FI - Republic of Finland
Why not use the program to hide another program in the program? It
must have seemed reasonable at the time.
@@ -174,20 +174,20 @@ provide a separate encoding program, you should not be surprised to
learn that I opted to steganographically hide the encoder inside the
decoder.
Try it out. Compile the program, then type
-
./sds< sds.c
+
./sds < sds.c
You should see the encoder program displayed. Now save it, like:
-
./sds< sds.c > encoder.c
+
./sds < sds.c > encoder.c
Then compile encoder.c. You now have the complete system ready.
The encoder expects to get a filename as an argument. This filename
is the name of the file containing the information to be hidden. It
expects the file in which to hide the information to be on the
standard input, and will output the results on the standard output.
You can use it like this (assuming you have a file called remarks):
C programs are mostly unaffected by adding steganographic content,
but it is possible in certain circumstances for whitespace to be
changed inside strings where it should be left alone. Plain text
diff --git a/2004/vik1/README.md b/2004/vik1/README.md
index fe79826bc..72fc61959 100644
--- a/2004/vik1/README.md
+++ b/2004/vik1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./vik1 [arg]
```
## Try:
-```sh
+```
./vik1
./vik1 a
@@ -82,7 +82,7 @@ Compile the source code and link X libraries if necessary.
The program takes three options which have to be typed in a specific
order as described below.
-```sh
+```
Usage: ./vik1 ['a']['d'][#]
a - Advanced racing in a winter landscape
diff --git a/2004/vik1/index.html b/2004/vik1/index.html
index efd9cad3d..54c3343bb 100644
--- a/2004/vik1/index.html
+++ b/2004/vik1/index.html
@@ -141,17 +141,17 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./vik1[arg]
+
./vik1 [arg]
Try:
-
./vik1
-
-./vik1 a
-
-./vik1 d2
-
-./vik1 ad3
+
./vik1
+
+ ./vik1 a
+
+ ./vik1 d2
+
+ ./vik1 ad3
Can you figure out how to cheat?
Also see the author’s remarks below for more details on the different
modes/options.
@@ -184,11 +184,11 @@ glance at the feature list he provided below. Amazing!
Compile the source code and link X libraries if necessary.
The program takes three options which have to be typed in a specific
order as described below.
-
Usage: ./vik1 ['a']['d'][#]
-
-a- Advanced racing in a winter landscape
-d- Racing in at night in the dark
-# - Race track selection 1-3 are valid numbers
+
Usage: ./vik1 ['a']['d'][#]
+
+ a - Advanced racing in a winter landscape
+ d - Racing in at night in the dark
+# - Race track selection 1-3 are valid numbers
Here are a few examples:
Command line: Description:
diff --git a/2004/vik2/README.md b/2004/vik2/README.md
index a4b81a5b4..2dd20b1b1 100644
--- a/2004/vik2/README.md
+++ b/2004/vik2/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./vik2
```
@@ -127,7 +127,7 @@ speed up the compilation, define the `STOP` symbol to anything from `_3` to
`_10`. (The default value is `_10` which will make the compilation take some
time.) Prime numbers up to `2^STOP` will be calculated.
-```sh
+```
cpp '-DSTOP=_5' '-DFNAME="tmp1.c"' prog.c tmp1.c
```
@@ -135,20 +135,20 @@ Then use `cpp` or any other
[pre-processor](https://en.wikipedia.org/wiki/C_preprocessor) to do the actual
work. This will take some time....
-```sh
+```
cpp tmp1.c > tmp2.c
```
Finally compile the pre-processed file
-```sh
+```
cc -O tmp2.c -o prog
```
Then run the program to reveal all prime numbers up to 32 (if you used
`STOP=_5` as above):
-```sh
+```
./vik2
```
diff --git a/2004/vik2/index.html b/2004/vik2/index.html
index decc85989..3a7a9169c 100644
--- a/2004/vik2/index.html
+++ b/2004/vik2/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./vik2
+
./vik2
Judges’ remarks:
The fun thing about CPP abuses
is that, in most cases, running the
@@ -234,16 +234,16 @@ symbol must be defined to the name of the output file. If you want to
speed up the compilation, define the STOP symbol to anything from _3 to
_10. (The default value is _10 which will make the compilation take some
time.) Prime numbers up to 2^STOP will be calculated.
-
cpp'-DSTOP=_5''-DFNAME="tmp1.c"' prog.c tmp1.c
+
cpp '-DSTOP=_5' '-DFNAME="tmp1.c"' prog.c tmp1.c
Then use cpp or any other
pre-processor to do the actual
work. This will take some time….
-
cpp tmp1.c > tmp2.c
+
cpp tmp1.c > tmp2.c
Finally compile the pre-processed file
-
cc-O tmp2.c -o prog
+
cc -O tmp2.c -o prog
Then run the program to reveal all prime numbers up to 32 (if you used
STOP=_5 as above):
-
./vik2
+
./vik2
Verification
I wasn’t able to compile the full program which calculates prime
numbers up to 1024 using GNU cpp
diff --git a/2005/aidan/README.md b/2005/aidan/README.md
index 76e94a799..c3af9d722 100644
--- a/2005/aidan/README.md
+++ b/2005/aidan/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code).
## To use:
-```sh
+```
./aidan < puzzle
./aidan seed
@@ -21,7 +21,7 @@ where `seed` is a number.
## Try:
-```sh
+```
./try.sh
```
@@ -34,7 +34,7 @@ which is slower, inelegant and not as obscure, as the author put it.
### Alternate build:
-```sh
+```
make alt
```
@@ -46,7 +46,7 @@ Use `aidan.alt` as you would `aidan` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -139,7 +139,7 @@ Telegraph](https://www.telegraph.co.uk/), a UK newspaper.
Now, with modern computers this **can** be solved using brute force, e.g.:
-```c
+```
#include /* sudoku-bfi.c */
#define S(t) for(n=0;n<9;v[n++]=0);for(n=0;n<81;n++)if(i[n]){z=1<
cc -o sudoku-sf sudoku-sf.c
```
or, if using gcc, try:
-```sh
+```
gcc -O2 -Wall -Wextra -ansi -pedantic-errors -o sudoku-sf sudoku-sf.c
```
#### Testing (optional)
-```sh
+```
perl ./test-su.perl
```
@@ -211,7 +211,7 @@ really.
#### Solving
-```sh
+```
./aidan < somefile.txt
```
@@ -232,7 +232,7 @@ though slightly slower. See if you can figure out what it does.)
#### Generating
-```sh
+```
./sudoku
```
@@ -292,7 +292,7 @@ least 32. (No, that isn't a typo - I did say 15, not 16).
Also requires that `cpp` can properly handle something like:
-```c
+```
#define foo(x,y) x y
foo(bar,)
```
diff --git a/2005/aidan/index.html b/2005/aidan/index.html
index b8205ee06..939278ce8 100644
--- a/2005/aidan/index.html
+++ b/2005/aidan/index.html
@@ -141,25 +141,25 @@ Location: GB - United Kingdom of Great
To build:
-
make
+
make
There is an alternate version based on the author’s remarks. See alternate
code.
To use:
-
./aidan< puzzle
-
-./aidan seed
+
./aidan < puzzle
+
+ ./aidan seed
where seed is a number.
Try:
-
./try.sh
+
./try.sh
Alternate code:
This code is formatted differently and is not the approach used by the author
which is slower, inelegant and not as obscure, as the author put it.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use aidan.alt as you would aidan above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Are you puzzled about puzzles? This entry might puzzle you
more while it puzzles out some puzzles: all in a puzzling way!
@@ -223,14 +223,14 @@ figure out how to solve them, but there’s a useful tutorial on
http://www.sudoku.org.uk/, which is roughly affiliated with the Daily
Telegraph, a UK newspaper.
Now, with modern computers this can be solved using brute force, e.g.:
@@ -259,17 +259,17 @@ also has trouble - it took 66 seconds to solve it - but probably for different
reasons. That’s the worst performance I’ve had from brute-force so far!)
Note that this requires Perl 5 (I use 5.8.5, earlier versions untested) and is
somewhat slow (should take under a minute on a fairly modern PC - try
appending -n 0 if you’re in a hurry). I wrote it mostly for my own benefit,
really.
Solving
-
./aidan< somefile.txt
+
./aidan < somefile.txt
Input should be the numbers of each row in turn. Empty spaces can be
represented as a full stop (.) or zero (0). Other characters are ignored, so you
can cut-and-paste either example sudoku puzzle from above into a file and feed that
@@ -282,7 +282,7 @@ an extra 15 bytes of (very simple) code to add, so it doesn’t really matter to
me. (It’s the same as the normal mode for most input you’re likely to feed it,
though slightly slower. See if you can figure out what it does.)
Generating
-
./sudoku<seed>
+
./sudoku <seed>
Output is a blank grid, then the solution, then the problem. There’s no
control over the difficulty. Sorry. However, all generated sudokus should have
exactly one solution - if one doesn’t, that’s a bug.
@@ -321,8 +321,8 @@ can’t help you figure out where the mistake is, sadly.
Dependant on ASCII, requires that an int is at least 15 bits and a long at
least 32. (No, that isn’t a typo - I did say 15, not 16).
Also requires that cpp can properly handle something like:
-
#define foo(x,y) x y
- foo(bar,)
+
#define foo(x,y) x y
+ foo(bar,)
Apparently, a few can’t (ANSI C specifically doesn’t require that this works,
though it usually does). Unfortunately, I didn’t discover this issue until too
late. (It was mentioned in the notes for people modifying GCC in the “beware
diff --git a/2005/anon/README.md b/2005/anon/README.md
index c77a47391..674bb5e0a 100644
--- a/2005/anon/README.md
+++ b/2005/anon/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -8,7 +8,7 @@ NOTE: there is an alternate version for vi(m) like movements. See [alternate
version](#alternate-code) below. If your terminal has problems with the
`stty(1)` commands try:
-```sh
+```
make anon-no_stty
```
@@ -28,14 +28,14 @@ For more detailed information see [2005 anon bugs](../../bugs.html#2005_anon).
## To use:
-```sh
+```
./anon x y [z]
```
## Try:
-```sh
+```
./anon 4 4
./anon 3 3 3
@@ -48,13 +48,13 @@ hook you) and spending too much time playing. :-)
If you want to see this in action you can easily do this:
-```sh
+```
yes 'please crash on me :-)' | ./anon 4 4
```
What happens if you specify a larger board? For instance:
-```sh
+```
yes 'please crash on me :-)' | ./anon 10 10 10
```
@@ -70,13 +70,13 @@ The alternate version uses `vi(m)` like movement keys.
### Alternate build:
-```sh
+```
make alt
```
To compile the version without `stty(1)`:
-```sh
+```
make alt-no_stty
```
@@ -121,13 +121,13 @@ sorted in the order they appear on the screen.
The program takes 2 or 3 arguments, specifying the dimensions of the board.
For example, to play the original version of the Fifteen Puzzle:
-```sh
+```
./anon 4 4
```
To play with a 3D board, do something like this:
-```sh
+```
./anon 3 3 3
```
@@ -377,7 +377,7 @@ stored in a well-known location in the `MASS`.
`if(p,q,r,s)` is, in fact, an `if` statement. :-) It is equivalent to:
-```c
+```
if (p) { q; r } else {s}
```
@@ -404,7 +404,7 @@ closes the current state and opens a new one behind the programmer's back.
variable); `x` and `y-1` define the starting and ending values of `i`, and `z`
is the loop body. `Z` is the post-loop code in the current state. For example:
-```c
+```
for(s,i, 0, 10,
some_code ,
other_code)
@@ -412,7 +412,7 @@ is the loop body. `Z` is the post-loop code in the current state. For example:
is equivalent to:
-```c
+```
for (i=0; i<10; i++) {
some_code;
}
diff --git a/2005/anon/index.html b/2005/anon/index.html
index 1bd2b5830..bea7bc0f7 100644
--- a/2005/anon/index.html
+++ b/2005/anon/index.html
@@ -141,39 +141,39 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
NOTE: there is an alternate version for vi(m) like movements. See alternate
version below. If your terminal has problems with the
stty(1) commands try:
-
make anon-no_stty
+
make anon-no_stty
This will compile anon.c as anon to not use stty(1).
After a very large number of moves this program will deliberately force itself
to destroy its runtime stack. This is the author’s way to prevent you from being
frustrated (which might happen as it likes to create unsolvable puzzles just to
hook you) and spending too much time playing. :-)
If you want to see this in action you can easily do this:
-
yes'please crash on me :-)'|./anon 4 4
+
yes 'please crash on me :-)' | ./anon 4 4
What happens if you specify a larger board? For instance:
-
yes'please crash on me :-)'|./anon 10 10 10
+
yes 'please crash on me :-)' | ./anon 10 10 10
If you specify more than three args the program might also crash or do
something strange. This might also happen if you specify excessively large board
dimensions. Try 100 100 100 for instance and see what happens!
Alternate version:
The alternate version uses vi(m) like movement keys.
Alternate build:
-
make alt
+
make alt
To compile the version without stty(1):
-
make alt-no_stty
+
make alt-no_stty
Alternate use:
Use anon.alt as you would anon with the change in movements:
k | Move empty spot up
@@ -200,9 +200,9 @@ spaces on the board, and the goal is to rearrange them so that they appear
sorted in the order they appear on the screen.
The program takes 2 or 3 arguments, specifying the dimensions of the board.
For example, to play the original version of the Fifteen Puzzle:
-
./anon 4 4
+
./anon 4 4
To play with a 3D board, do something like this:
-
./anon 3 3 3
+
./anon 3 3 3
WARNING: do NOT run the program with more than 3 command-line arguments.
This will trigger a bug that will cause it to crash or do something strange.
:-)
@@ -394,7 +394,7 @@ allocation. It’s the only state that needs to return a value from the boolean
expression, since once the MASS is initialized any return value can simply be
stored in a well-known location in the MASS.
if(p,q,r,s) is, in fact, an if statement. :-) It is equivalent to:
-
if(p){ q; r }else{s}
+
if (p) { q; r } else {s}
Why are q and r split up? Because it’s cleaner (in whatever twisted sense of
the word that can be applied to an IOCCC entry) to implement using boolean
expressions. Keep in mind that all statements are assumed to evaluate to
@@ -415,14 +415,14 @@ closes the current state and opens a new one behind the programmer’s back.
i is the index variable (well, the index into the MASS of the index
variable); x and y-1 define the starting and ending values of i, and z
is the loop body. Z is the post-loop code in the current state. For example:
Note the “wrong” indentation in the former: the author prefers to write it
that way, since the analogy to the usual for loop is clearer. This is why it’s
easier to understand the pre-CPP code, since after CPP, the macro reshuffles
diff --git a/2005/boutines/README.md b/2005/boutines/README.md
index 33e34fb0f..3470383de 100644
--- a/2005/boutines/README.md
+++ b/2005/boutines/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -15,20 +15,20 @@ require it?](../../faq.html#imagemagick).
Look here to find some [SVG Viewer
Implementations](https://www.w3.org/Graphics/SVG/WG/wiki/Implementations).
-```sh
+```
./boutines < input > output.svg
```
## Try:
-```sh
+```
./try.sh
```
If `ruby` is installed [try.sh](try.sh) will generate an SVG file by:
-```sh
+```
ruby -e '20.times{puts "#{rand} #{rand}"}' | ./boutines > test.svg
```
@@ -75,7 +75,7 @@ an [SVG](https://www.w3.org/TR/SVG11/expanded-toc.html) stream.
This will possibly save a compressed SVG file and may be useful:
-```sh
+```
./boutines | gzip > result.svg.gz
```
diff --git a/2005/boutines/index.html b/2005/boutines/index.html
index d9d1a30a1..7788b2e7a 100644
--- a/2005/boutines/index.html
+++ b/2005/boutines/index.html
@@ -141,7 +141,7 @@ Location: FR - French Republic (
It will also create an SVG file with the file input.txt.
The script will check if convert is available and if so it will try converting
the SVG file(s) to PNG file(s) which you should be able to view in most any
@@ -178,7 +178,7 @@ square.
This will possibly save a compressed SVG file and may be useful:
-
./boutines|gzip> result.svg.gz
+
./boutines | gzip > result.svg.gz
Input consists of a list of floating points values separated by whitespaces
(ranging preferably in [0,1]). Alternating a horizontal coordinate, a
whitespace then the other coordinate (pointing downwards in the resulting
diff --git a/2005/chia/README.md b/2005/chia/README.md
index 39d05ac22..7818566e7 100644
--- a/2005/chia/README.md
+++ b/2005/chia/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./chia
```
diff --git a/2005/chia/index.html b/2005/chia/index.html
index aa6347830..034a4da96 100644
--- a/2005/chia/index.html
+++ b/2005/chia/index.html
@@ -141,9 +141,9 @@ Location: SG - Republic of Singapore
To build:
-
make
+
make
To use:
-
./chia
+
./chia
Judges’ remarks:
Have you had your morning cup of Java? You might want a
second cup before parsing this entry. And give your C
diff --git a/2005/giljade/README.md b/2005/giljade/README.md
index d46c0f8a3..287ad9e97 100644
--- a/2005/giljade/README.md
+++ b/2005/giljade/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,21 +21,21 @@ For more detailed information see [2005 giljade bugs](../../bugs.html#2005_gilja
## To use:
-```sh
+```
./giljade
```
## Try:
-```sh
+```
./try.sh
```
### Self-test feature to try:
-```sh
+```
./giljade > out
./giljade out
```
@@ -52,7 +52,7 @@ Control-F.
If you really understand expressions, then understand this:
-```c
+```
s=s^(b=s&s-1^s)
```
diff --git a/2005/giljade/index.html b/2005/giljade/index.html
index 4e4ec12a3..fe88f4053 100644
--- a/2005/giljade/index.html
+++ b/2005/giljade/index.html
@@ -141,7 +141,7 @@ Location: IL - State of Israel (
To build:
-
make
+
make
NOTE: We FORCE the use of -O0 even if someone overrides it because this entry
will not work with it enabled.
Bugs and (Mis)features:
@@ -149,12 +149,12 @@ will not work with it enabled.
This entry takes editorial in how it deals with its output. After using vi(1)
@@ -162,7 +162,7 @@ will not work with it enabled.
output. We especially recommend it on a 78 column xterm while leaning on
Control-F.
If you really understand expressions, then understand this:
-
s=s^(b=s&s-1^s)
+
s=s^(b=s&s-1^s)
… and understand why it is found in the source code.
Author’s remarks:
So what do we have here ?
diff --git a/2005/jetro/README.md b/2005/jetro/README.md
index ada4b5791..377961547 100644
--- a/2005/jetro/README.md
+++ b/2005/jetro/README.md
@@ -6,14 +6,14 @@ haven't already.
If you have SDL installed:
-```sh
+```
make
```
## To use:
-```sh
+```
./jetro
```
diff --git a/2005/jetro/index.html b/2005/jetro/index.html
index 38e6ec4bb..083fae0e5 100644
--- a/2005/jetro/index.html
+++ b/2005/jetro/index.html
@@ -145,9 +145,9 @@ Location: FI - Republic of Finland for information on how to install it if you
haven’t already.
If you have SDL installed:
-
make
+
make
To use:
-
./jetro
+
./jetro
Judges’ remarks:
We have seen entries with SDL graphics in the past, now it’s time for SDL
sound. This entry can even be run on a computer without a sound card with an
diff --git a/2005/klausler/README.md b/2005/klausler/README.md
index 4a0d22772..6584b6226 100644
--- a/2005/klausler/README.md
+++ b/2005/klausler/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./klausler arg1 arg2 | head
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2005/klausler/index.html b/2005/klausler/index.html
index 3c3b17bdc..3583f4859 100644
--- a/2005/klausler/index.html
+++ b/2005/klausler/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./klausler arg1 arg2 |head
+
./klausler arg1 arg2 | head
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
To reduce the size of the source, include other people’s data.
That is what Peter suggests when he describes how to generate
diff --git a/2005/mikeash/README.md b/2005/mikeash/README.md
index aa183e382..1b4f288c2 100644
--- a/2005/mikeash/README.md
+++ b/2005/mikeash/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2005 mikeash bugs](../../bugs.html#2005_mikea
## To use:
-```sh
+```
./mikeash
```
@@ -28,7 +28,7 @@ under 64-bit (x86_64, arm64) machines too.
## Try:
-```sh
+```
./try.sh
```
@@ -67,7 +67,7 @@ functions.
Try:
-```sh
+```
echo '(format t "~s" (+ 2 2 ))' | ./mikeash
```
@@ -76,7 +76,7 @@ the lack of a newline are due to the somewhat broken implementation of
the format function. More sophisticated arithmetic expressions may be
used:
-```sh
+```
echo '(format t "~s" (* (+ 2 2 ) (- 5 (/ 9 3 ))))' | ./mikeash
```
@@ -130,7 +130,7 @@ nowhere near
Basically, the [LISP][] interpreter is good for some basic math operations, and
for running itself. To do the latter, try this:
-```sh
+```
./mikeash < mikeash.c > mikeash2.c
diff mikeash.c mikeash2.c
```
diff --git a/2005/mikeash/index.html b/2005/mikeash/index.html
index 65544d691..714fad6d0 100644
--- a/2005/mikeash/index.html
+++ b/2005/mikeash/index.html
@@ -141,17 +141,17 @@ Location: US - United States of America
NOTE: the author stated that they tested this under i386 machines but this works
under 64-bit (x86_64, arm64) machines too.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Having problems speaking code? Do you LISP? Parenthetically
speaking, this entry takes advantage of C99 features, while
@@ -175,12 +175,12 @@ constant string, due to different string escape semantics in C and Lisp, and
some implicit integer-to-pointer conversions due to the implicitly-declared
functions.
Try:
-
echo'(format t "~s" (+ 2 2 ))'|./mikeash
+
echo '(format t "~s" (+ 2 2 ))' | ./mikeash
You should see 4" echoed on your command prompt. The " after the 4 and
the lack of a newline are due to the somewhat broken implementation of
the format function. More sophisticated arithmetic expressions may be
used:
This evaluates the expression (2+2) * (5 - 9/3) giving the correct result,
8" (with the same issue of no newline after the "). Note that due to the
highly ad-hoc nature of the tokenizer, the spaces before the closing parentheses
@@ -219,8 +219,8 @@ nowhere near
Basically, the LISP interpreter is good for some basic math operations, and
for running itself. To do the latter, try this:
The program can also be run from an implementation of common
lisp. To do
this, run the common lisp compiler and then type the following command:
diff --git a/2005/mynx/README.md b/2005/mynx/README.md
index 176f16747..ce5b08d53 100644
--- a/2005/mynx/README.md
+++ b/2005/mynx/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2005 mynx bugs](../../bugs.html#2005_mynx).
## To use:
-```sh
+```
./mynx http://
```
@@ -31,7 +31,7 @@ the issue of https.
## Try:
-```sh
+```
./mynx http://www.textfiles.com
./mynx manual.html
@@ -58,7 +58,7 @@ must just appreciate the entry for what it once was.
### Alternate build:
-```sh
+```
make alt
```
@@ -68,7 +68,7 @@ must just appreciate the entry for what it once was.
Use `mynx.alt` as you would `mynx`. You'd have to specify a port at the end of
the URL like:
-```sh
+```
./mynx.alt https://www.ioccc.org:443
```
@@ -92,13 +92,13 @@ it inspired me to try my hand at writing the client side complement.
A typical build command would be:
-```sh
+```
cc -o mynx mynx.c
```
While some others like to be a little different:
-```sh
+```
cc -o mynx mynx.c -lnsl -lsocket
```
@@ -107,13 +107,13 @@ example, which is kinda of useful when you consider how many OSes put
all the network functions in a variety of places. So a simpler build
command sequence would be:
-```sh
+```
cd source ; ./configure ; make
```
After which, the rest of the documentation can be read by saying:
-```sh
+```
./mynx ../manual.html
```
diff --git a/2005/mynx/index.html b/2005/mynx/index.html
index 3cb72131c..afba61089 100644
--- a/2005/mynx/index.html
+++ b/2005/mynx/index.html
@@ -141,7 +141,7 @@ Location: CA - Canada
To build:
-
make
+
make
There is an alternate version that scans for (ONLY scans) the string https
as a starting point. See alternate code below.
Bugs and (Mis)features:
@@ -149,13 +149,13 @@ as a starting point. See alternate code below.
Obviously this will not work with https as it only scans for http in the URL
(if not specified it tries to open it as a local file). But even if it scanned
@@ -171,11 +171,11 @@ to either come up with a pipeline (or some other command line) that allows it to
work with https or to update the code to support https they may. Otherwise you
must just appreciate the entry for what it once was.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use mynx.alt as you would mynx. You’d have to specify a port at the end of
the URL like:
-
./mynx.alt https://www.ioccc.org:443
+
./mynx.alt https://www.ioccc.org:443
but again unless you have a clever workaround or hack to the problem, this sadly
won’t work.
Judges’ remarks:
@@ -188,16 +188,16 @@ get a functioning LAMP stack.
I was rather impressed by last year’s mini webserver. So much so that
it inspired me to try my hand at writing the client side complement.
A typical build command would be:
-
cc-o mynx mynx.c
+
cc -o mynx mynx.c
While some others like to be a little different:
-
cc-o mynx mynx.c -lnsl-lsocket
+
cc -o mynx mynx.c -lnsl -lsocket
I even managed to figure out a basic configure script, given last year’s
example, which is kinda of useful when you consider how many OSes put
all the network functions in a variety of places. So a simpler build
command sequence would be:
-
cd source ;./configure;make
+
cd source ; ./configure ; make
After which, the rest of the documentation can be read by saying:
-
./mynx ../manual.html
+
./mynx ../manual.html
make
```
@@ -10,14 +10,14 @@ setting binary mode on `stdout`. See [alternate code](#alternate-code) below.
## To use:
-```sh
+```
./persano p q [num frames]
```
## Try:
-```sh
+```
./try.sh
```
@@ -49,7 +49,7 @@ Use `persano.alt` as you would `persano` above.
### Alternate try:
-```sh
+```
./persano.alt 3 16 > knot3-16.gif
```
@@ -80,7 +80,7 @@ knots](https://en.wikipedia.org/wiki/Torus_knot) to standard output.
### SYNOPSIS
-```sh
+```
./persano p q [num frames]
```
@@ -98,14 +98,14 @@ cutting it [^1], until it ends up looking just like a circle embedded in R3 [^2]
Sample usage:
-```sh
+```
./persano 3 2 1 > foo.gif
```
writes a non-animated GIF (a single frame) stream of a rendered trefoil
knot to the file `foo.gif`.
-```sh
+```
./persano 5 2
```
diff --git a/2005/persano/index.html b/2005/persano/index.html
index c3bb029d3..12ae28eef 100644
--- a/2005/persano/index.html
+++ b/2005/persano/index.html
@@ -141,13 +141,13 @@ Location: BR - Federative Republic of B
To build:
-
make
+
make
There is an alternate version of this entry which should work for Windows by
setting binary mode on stdout. See alternate code below.
To use:
-
./persano p q [num frames]
+
./persano p q [num frames]
Try:
-
./try.sh
+
./try.sh
Open the GIF files with a viewer capable of
displaying animated GIFs and watch closely at the bottom of the picture (you may
need to use gifsicle - a great tool to
@@ -162,7 +162,7 @@ let it work with Windows.
Alternate use:
Use persano.alt as you would persano above.
Alternate try:
-
./persano.alt 3 16 > knot3-16.gif
+
./persano.alt 3 16 > knot3-16.gif
Follow the same instructions, using different tools if necessary, as the above
try section.
Judges’ remarks:
@@ -179,7 +179,7 @@ linker option).
knot writes animated GIF images of rendered torus
knots to standard output.
SYNOPSIS
-
./persano p q [num frames]
+
./persano p q [num frames]
DESCRIPTION
A (p,q)-torus knot is a closed,
non-intersecting curve on the surface of a
@@ -190,10 +190,10 @@ resulting curve will not be a knot (that is, imagining the resulting cu
a loop of rubber, there will be a way to bend, twist and stretch it, without
cutting it 1, until it ends up looking just like a circle embedded in R3 2).
Sample usage:
-
./persano 3 2 1 > foo.gif
+
./persano 3 2 1 > foo.gif
writes a non-animated GIF (a single frame) stream of a rendered trefoil
knot to the file foo.gif.
-
./persano 5 2
+
./persano 5 2
writes a GIF stream with a rendering of Solomon’s Seal
knot to standard
output; since the number of frames is not specified, an animation with
diff --git a/2005/sykes/README.md b/2005/sykes/README.md
index ffe3e7576..771e47a32 100644
--- a/2005/sykes/README.md
+++ b/2005/sykes/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2005 sykes bugs](../../bugs.html#2005_sykes).
## To use:
-```sh
+```
./sykes binary_file
```
## Try:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ We downloaded the [ROM](https://en.wikipedia.org/wiki/ROM_image) contents to use
the [emulator](https://en.wikipedia.org/wiki/Emulator) in
[PET](https://en.wikipedia.org/wiki/Commodore_PET) mode as follows:
-```sh
+```
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-c000.901465-01.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/basic-2-d000.901465-02.bin
wget http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/edit-2-n.901447-24.bin
@@ -53,7 +53,7 @@ the [emulator](https://en.wikipedia.org/wiki/Emulator) in
We then created:
-```sh
+```
dd bs=2k count=1 if=/dev/zero of=nullfill.bin
```
@@ -79,7 +79,7 @@ Compile the program, then test the
[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description)
[emulation](https://en.wikipedia.org/wiki/Emulator) like this:
-```sh
+```
./sykes 6502test
```
@@ -105,7 +105,7 @@ Make sure you have a [terminal
window](https://en.wikipedia.org/wiki/Terminal_emulator) of 40x25 chars or
bigger, and then run the emulator like this:
-```sh
+```
./sykes pet.rom
```
@@ -119,13 +119,13 @@ You should see the startup message. Try typing in some
There is an optional numeric parameter, which controls the speed. For a
slower cursor blink, try
-```sh
+```
./sykes pet.rom 6
```
and for faster
-```sh
+```
./sykes pet.rom 2
```
@@ -191,7 +191,7 @@ Supplied as a demonstration is a
compiled-for-[6502](https://en.wikipedia.org/wiki/MOS_Technology_6502#Technical_description)
version a chess program (heh, I found a use for a previous losing entry :) ). Try:
-```sh
+```
./sykes chess
```
@@ -306,7 +306,7 @@ from the Internet. This is to avoid directly infringing any copyright.
What does this do?
-```sh
+```
./sykes pet.rom -1
```
diff --git a/2005/sykes/index.html b/2005/sykes/index.html
index fd7caecff..ce4fe537e 100644
--- a/2005/sykes/index.html
+++ b/2005/sykes/index.html
@@ -141,15 +141,15 @@ Location: FI - Republic of Finland
For your convenience, we have added the above mentioned files to this entry directory.
They were used to form the pet.rom file.
Author’s remarks:
@@ -180,7 +180,7 @@ to not infringe the rules.
Compile the program, then test the
6502emulation like this:
-
./sykes 6502test
+
./sykes 6502test
A basic test is done for each instruction and addressing mode, all tests
should pass. At the end of the tests, it loops forever - break out with
control-C.
@@ -196,15 +196,15 @@ Transactor.
Make sure you have a terminal
window of 40x25 chars or
bigger, and then run the emulator like this:
-
./sykes pet.rom
+
./sykes pet.rom
You should see the startup message. Try typing in some
BASIC - for instance:
PRINT "HELLO, WORLD"
There is an optional numeric parameter, which controls the speed. For a
slower cursor blink, try
-
./sykes pet.rom 6
+
./sykes pet.rom 6
and for faster
-
./sykes pet.rom 2
+
./sykes pet.rom 2
The default is 4.
The control keys are as follows:
^A HOME
@@ -243,7 +243,7 @@ The filenames must be upper case in order to be loaded by the emulator.
Supplied as a demonstration is a
compiled-for-6502
version a chess program (heh, I found a use for a previous losing entry :) ). Try:
-
./sykes chess
+
./sykes chess
It works as you would expect (it plays very badly). There’s no castling
or en-passant, and to win you must actually take the opponent’s king.
make
```
## To use:
-```sh
+```
./timwi < bf_program
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2005/timwi/index.html b/2005/timwi/index.html
index a39b3a351..459bd2844 100644
--- a/2005/timwi/index.html
+++ b/2005/timwi/index.html
@@ -141,11 +141,11 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
To use:
-
./timwi< bf_program
+
./timwi < bf_program
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Unlike most BF interpreters that we
have been receiving for the last few years, this one, in our opinion, is the
diff --git a/2005/toledo/README.md b/2005/toledo/README.md
index 590089412..e417df988 100644
--- a/2005/toledo/README.md
+++ b/2005/toledo/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./toledo [a ...]
```
## Try:
-```sh
+```
./toledo a
./toledo a b
```
@@ -30,7 +30,7 @@ Two alternate versions of this entry, [toledo2.c](toledo2.c) and
To compile the alternate versions:
-```sh
+```
make alt
```
@@ -63,7 +63,7 @@ This is a [chess](https://en.wikipedia.org/wiki/Chess) program, it can work in
two modes: two-players, and one player (always white) against the machine. To
get the first mode, run the program without arguments:
-```sh
+```
./toledo
```
@@ -71,14 +71,14 @@ The other mode is accessible running the program with one argument
(5-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))
analysis):
-```sh
+```
./toledo a
```
Two arguments for 6-[ply](https://en.wikipedia.org/wiki/Ply_(game_theory))
analysis:
-```sh
+```
./toledo a b
```
diff --git a/2005/toledo/index.html b/2005/toledo/index.html
index 2230a9bdb..67590a05e 100644
--- a/2005/toledo/index.html
+++ b/2005/toledo/index.html
@@ -141,18 +141,18 @@ Location: MX - United Mexican States
To build:
-
make
+
make
To use:
-
./toledo [a ...]
+
./toledo [a ...]
Try:
-
./toledo a
-./toledo a b
+
./toledo a
+ ./toledo a b
Alternate code:
Two alternate versions of this entry, toledo2.c and
toledo3.c are provided.
Alternate build:
To compile the alternate versions:
-
make alt
+
make alt
Alternate use:
Use Use toledo2 and toledo3 as you would toledo above.
Judges’ remarks:
@@ -170,14 +170,14 @@ single function.
This is a chess program, it can work in
two modes: two-players, and one player (always white) against the machine. To
get the first mode, run the program without arguments:
-
./toledo
+
./toledo
The other mode is accessible running the program with one argument
(5-ply
analysis):
And each successive argument will analyze one
ply more. There is no ply
limit, but beyond 7 ply is very slow, try it at your own risk and computing
diff --git a/2005/vik/README.md b/2005/vik/README.md
index 95b6acf58..60ff99348 100644
--- a/2005/vik/README.md
+++ b/2005/vik/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./vik [file.map]
```
## Try:
-```sh
+```
./vik maze.map
```
@@ -60,7 +60,7 @@ Compile the source code and link in [X
libraries](https://en.wikipedia.org/wiki/Xlib) if necessary. The program takes
three options which have to be typed in a specific order as described below.
-```sh
+```
./vik [-w ] [mapfile]
```
@@ -75,20 +75,20 @@ where:
Start the engine using a built in labyrinth and texture bitmaps:
-```sh
+```
./vik
```
Start the engine and loads the labyrinth defined in the file
[maze.map](maze.map):
-```sh
+```
./vik maze.map
```
Start the engine using [maze.map](maze.map) in a window that is 400 pixels wide:
-```sh
+```
./vik -w 400 maze.map
```
diff --git a/2005/vik/index.html b/2005/vik/index.html
index 18d77889f..f92ae5ecc 100644
--- a/2005/vik/index.html
+++ b/2005/vik/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./vik[file.map]
+
./vik [file.map]
Try:
-
./vik maze.map
+
./vik maze.map
Judges’ remarks:
An amazing use of the X libraries with twisty code passages, all different. One
risks running in code path circles as main() is called again and again. Be
@@ -177,18 +177,18 @@ backward).
Compile the source code and link in X
libraries if necessary. The program takes
three options which have to be typed in a specific order as described below.
-
./vik [-w <width>] [mapfile]
+
./vik [-w <width>] [mapfile]
where:
width - Specifies the width of the window
mapfile - Filename containing a map
Examples
Start the engine using a built in labyrinth and texture bitmaps:
-
./vik
+
./vik
Start the engine and loads the labyrinth defined in the file
maze.map:
-
./vik maze.map
+
./vik maze.map
Start the engine using maze.map in a window that is 400 pixels wide:
-
./vik-w 400 maze.map
+
./vik -w 400 maze.map
Note that the mapfile has to be the last argument and the -w option if present
has to be the first. The map definition files and the bitmap files should be
located in the current directory.
diff --git a/2005/vince/README.md b/2005/vince/README.md
index cfd3975be..ead138c22 100644
--- a/2005/vince/README.md
+++ b/2005/vince/README.md
@@ -3,14 +3,14 @@
Before building, make sure that you have the OpenGL development libraries
installed.
-```sh
+```
make
```
## To use:
-```sh
+```
./vince
```
@@ -31,7 +31,7 @@ also has the recursive `CPP` macro (which sneaked in accidentally) removed.
To compile this alternate version:
-```sh
+```
make alt
```
diff --git a/2005/vince/index.html b/2005/vince/index.html
index b7d8e34f2..c7a368846 100644
--- a/2005/vince/index.html
+++ b/2005/vince/index.html
@@ -143,9 +143,9 @@ Location: US - United States of America
To build:
Before building, make sure that you have the OpenGL development libraries
installed.
-
make
+
make
To use:
-
./vince
+
./vince
Try:
When running this in the program’s window try hitting space a few times and see
what happens!
@@ -154,7 +154,7 @@ what happens!
also has the recursive CPP macro (which sneaked in accidentally) removed.
Alternate build:
To compile this alternate version:
-
make alt
+
make alt
Alternate use:
Use vince.alt as you would vince above.
Alternate try:
diff --git a/2006/birken/README.md b/2006/birken/README.md
index 22445ac14..b5d9f3724 100644
--- a/2006/birken/README.md
+++ b/2006/birken/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2006 birken bugs](../../bugs.html#2006_birken
## To use:
-```sh
+```
./birken < file.tofu
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2006/birken/index.html b/2006/birken/index.html
index ef786662f..ca01f809c 100644
--- a/2006/birken/index.html
+++ b/2006/birken/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: uses gets() - change to fgets() if possible
We recommend you input for the filename example.gif and for the string
ioccc@example.com. The script will not overwrite files. It runs the program in
a loop until you answer that you do not wish to make another.
@@ -175,9 +175,9 @@ line. To avoid complications with patent issues the Usage:
-
make all
-./borsanyi my@example.com > email.gif
-my_favourite_gif_viewer email.gif
+
make all
+ ./borsanyi my@example.com > email.gif
+ my_favourite_gif_viewer email.gif
The address cannot be longer than 42 characters, and may consist of
the characters: a-z_A-Z0-9@.-.
The program is (like email addresses are) case insensitive.
diff --git a/2006/grothe/README.md b/2006/grothe/README.md
index 0ef56dd95..f7ede74fc 100644
--- a/2006/grothe/README.md
+++ b/2006/grothe/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./grothe carrier_freq pixelclock horizontal_total < some_input.txt
```
@@ -16,7 +16,7 @@
Put on your "electronic ears" and then try:
-```sh
+```
./try.sh
```
@@ -50,13 +50,13 @@ parameters:
If you have `xvidtune` installed you can get the `pixelclock` and
`horizontal_total` with the following command
-```sh
+```
xvidtune -show | head -n 1 | awk '{ print "pixelclock " $2 * 1000000 " horizontal_total = " $6 }'
```
Example from my laptops:
-```sh
+```
./grothe 65000000 10000000 1344 < twinkle.txt
```
diff --git a/2006/grothe/index.html b/2006/grothe/index.html
index f575407ae..0ff4542e9 100644
--- a/2006/grothe/index.html
+++ b/2006/grothe/index.html
@@ -141,12 +141,12 @@ Location: US - United States of America
Even if the user gets a setting off, the sound will usually be able to be
heard on AM at a multiple of
the original frequency.
diff --git a/2006/hamre/README.md b/2006/hamre/README.md
index 87d012e3a..df2e650e3 100644
--- a/2006/hamre/README.md
+++ b/2006/hamre/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./hamre math_expression_string
```
## Try:
-```sh
+```
./try.sh
```
@@ -42,7 +42,7 @@ supported operators are: `+`, `-` (binary and unary), `*`, `/` and `()`. Run it
by supplying an expression as the first argument, and the normalized
result will be written to `stdout`.
-```sh
+```
./hamre '-1+4/3*(2+1/(3/2*(7/2-7/3+1/6)))/2'
2/3
```
diff --git a/2006/hamre/index.html b/2006/hamre/index.html
index c108e650d..270228d34 100644
--- a/2006/hamre/index.html
+++ b/2006/hamre/index.html
@@ -141,11 +141,11 @@ Location: NO - Kingdom of Norway (
To build:
-
make
+
make
To use:
-
./hamre math_expression_string
+
./hamre math_expression_string
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
An irrationally coded source presents rational things!
A rational person might want to attempt the
@@ -162,8 +162,8 @@ an obfuscated one.
supported operators are: +, - (binary and unary), *, / and (). Run it
by supplying an expression as the first argument, and the normalized
result will be written to stdout.
-
If you do not supply an argument, the calculator will crash. Other
arguments are ignored. Supplying more arguments may further limit the
number of nested operators supported.
diff --git a/2006/meyer/README.md b/2006/meyer/README.md
index 93831e729..3e0afc604 100644
--- a/2006/meyer/README.md
+++ b/2006/meyer/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./meyer [SEED]
```
## Try:
-```sh
+```
./meyer [SEED]
```
@@ -75,7 +75,7 @@ you write is what it does'). It may be tempting to think that
might do something similar as
-```c
+```
struct not_an_object o;
```
@@ -100,7 +100,7 @@ implementation in a popular object-oriented programming language.
### Starting the game
-```sh
+```
./meyer [SEED]
```
diff --git a/2006/meyer/index.html b/2006/meyer/index.html
index e57f9884e..c5d8d5501 100644
--- a/2006/meyer/index.html
+++ b/2006/meyer/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./meyer[SEED]
+
./meyer [SEED]
Try:
-
./meyer[SEED]
+
./meyer [SEED]
For your first input try:
a 0 1
where a is the row (a-i), 0 is the column (0-8) and 1 is the
@@ -183,7 +183,7 @@ it is obvious, that object-oriented code isn’t ‘WYWIWID’ (‘
you write is what it does’). It may be tempting to think that
Object o;
might do something similar as
-
struct not_an_object o;
+
struct not_an_object o;
But this program reveals that it doesn’t. Even worse, this program only
reveals the tip of the iceberg, what kind of black magic is involved in
a simple declaration of an object.
It is a sudoku based game. The goal of
the game is to be able to do the last valid ‘move’.
diff --git a/2006/monge/README.md b/2006/monge/README.md
index ce795898f..a876a978d 100644
--- a/2006/monge/README.md
+++ b/2006/monge/README.md
@@ -2,7 +2,7 @@
Make sure you have the SDL1 (not SDL2!) development environment installed.
-```sh
+```
make
```
@@ -24,7 +24,7 @@ For more detailed information see [2006 monge bugs](../../bugs.html#2006_monge).
## To use:
-```sh
+```
./monge expression ...
```
@@ -33,7 +33,7 @@ Incorrect formulas will ungracefully crash the program.
## Try:
-```sh
+```
./try.sh
```
@@ -49,7 +49,7 @@ as the number of iterations to perform.
To use the default values, the same as [monge.c](monge.c), just do:
-```sh
+```
make alt
```
@@ -58,13 +58,13 @@ of the variables `W`, `H` and `I`. The defaults are (respectively) 400, 300 and
\128. If you wish to change the image size to 500x500 but keep the iterations
the same then do:
-```sh
+```
make clobber WIDTH=500 HEIGHT=500 alt
```
If you wish to keep the dimensions the same but change the iterations to 512:
-```sh
+```
make clobber ITERATIONS=512 alt
```
@@ -82,7 +82,7 @@ Use `monge.alt` exactly as you would `monge` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -109,13 +109,13 @@ effort to work on both `i386` and `x86_64`. Portable it is! :)
0. Compile using the Makefile, or just run:
-```sh
+```
gcc monge.c -o monge -O3 `sdl-config --libs --cflags`
```
1. Run:
-```sh
+```
./monge "z = 0" "z = z*z + c; Abs2(z) < 4"
```
@@ -171,49 +171,49 @@ Here are a few examples of fractals you can draw:
- Mandelbrot:
-```sh
+```
./monge "z=1" "z=z*z+c; Abs2(z)<4"
```
- Mandelbrot (return time variation):
-```sh
+```
./monge "z=c" "z=z*z+c; Abs2(z-c)>0.0001"
```
- Julia, for `c=0.31+i*0.5`:
-```sh
+```
./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z)<4"
```
- Julia (return time variation), `for c=0.31+i*0.5`:
-```sh
+```
./monge "z=c; c=0.31+i*0.5" "z=z*z+c; Abs2(z-c)>0.0001"
```
- Newton, for `x^3-1`:
-```sh
+```
./monge "z=c" "p=z; z=0.6666*z+0.3333/(z*z); Abs2(p-z) > 0.001"
```
- Newton-Mandelbrot:
-```sh
+```
./monge "z=0" "p=z; z=z-(z*z*z + (c-1)*z - c)/(3*z*z+c-1); Abs2(p-z) > 0.001"
```
- Phoenix, Mandelbrot version:
-```sh
+```
./monge "z=0; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"
```
- Phoenix, Julia version for `c=0.56667-i*0.5`:
-```sh
+```
./monge "z=c; c=0.56667-i*0.5; q=0" "t=z; z=z*z+Re(c)+Im(c)*q; q=t; Abs2(z)<4"
```
diff --git a/2006/monge/index.html b/2006/monge/index.html
index 0a436f931..8354793cf 100644
--- a/2006/monge/index.html
+++ b/2006/monge/index.html
@@ -142,7 +142,7 @@ Location: IT - Italian Republic (<
To build:
Make sure you have the SDL1 (not SDL2!) development environment installed.
-
make
+
make
There is alternate version that lets you redefine the width and height and number
of iterations to use. See Alternate code below.
Bugs and (Mis)features:
@@ -151,23 +151,23 @@ of iterations to use. See Alternate code below.
Incorrect formulas will ungracefully crash the program.
Try:
-
./try.sh
+
./try.sh
Alternate code:
This alternate code lets you specify the width and height of the image as well
as the number of iterations to perform.
Alternate build:
To use the default values, the same as monge.c, just do:
-
make alt
+
make alt
But if you wish to actually make use of it you will want to redefine one or more
of the variables W, H and I. The defaults are (respectively) 400, 300 and
\128. If you wish to change the image size to 500x500 but keep the iterations
the same then do:
-
make clobber WIDTH=500 HEIGHT=500 alt
+
make clobber WIDTH=500 HEIGHT=500 alt
If you wish to keep the dimensions the same but change the iterations to 512:
-
make clobber ITERATIONS=512 alt
+
make clobber ITERATIONS=512 alt
If you specify a value less than 1 for any of these it sets it back to the
default. The value 1 was selected arbitrarily and such a small number as 1 will
not do anything useful but as long as it’s at least 1 it’ll not be redefined.
@@ -176,7 +176,7 @@ anyway.
Alternate use:
Use monge.alt exactly as you would monge above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
For those who are familiar with the previous IOCCC entries,
this program is best described as “1994/tvr meets
@@ -193,11 +193,11 @@ effort to work on both i386 and x86_64. Portable it is
Keep clicking with left or right button to zoom in or out.
Use the number pad + and - to increase/decrease the iteration count when
@@ -240,35 +240,35 @@ as you like (as understood by the C function isspace()).
This program will only work on x86 (with an x87 FPU) or x86_64 machines,
but it requires the SDL library.
diff --git a/2006/night/README.md b/2006/night/README.md
index 9bd86c18c..30866c181 100644
--- a/2006/night/README.md
+++ b/2006/night/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code) section below.
## To use:
-```sh
+```
./night
```
@@ -23,7 +23,7 @@ keys.
### Alternate build:
-```sh
+```
make alt
```
@@ -129,7 +129,7 @@ to deobfuscate.
Keypad support was removed to save space. To restore, modify the
following two macros to:
-```c
+```
#define ATG srand(time(0)); initscr(); cbreak(); noecho(); start_color(); keypad(stdscr,1);
#define AGG A&2?KEY_UP:KEY_DOWN:A&1?KEY_RIGHT:KEY_LEFT
```
diff --git a/2006/night/index.html b/2006/night/index.html
index 092edb520..ec15ce4fe 100644
--- a/2006/night/index.html
+++ b/2006/night/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version that supports arrow keys. See the alternate
code section below.
To use:
-
./night
+
./night
Alternate code:
This version allows you to use arrow keys instead of the more awkward wasd
keys.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use night.alt as you would night above.
Judges’ remarks:
@@ -217,8 +217,8 @@ preprocessed code is over 80KB in length, hindering the preprocessor’s ability
to deobfuscate.
Keypad support was removed to save space. To restore, modify the
following two macros to:
make alt
```
@@ -11,7 +11,7 @@ code](#original-code) below.
## To use:
-```sh
+```
./slone.alt
```
@@ -24,7 +24,7 @@ problematic for some people, can be configured to different speeds by way of the
value used in `usleep()`. The default is `75000` but you can easily change
it. To do so try:
-```sh
+```
make clobber SLEEP=70000 clobber alt
./sloane.alt
```
@@ -32,7 +32,7 @@ it. To do so try:
If you wish to make it like the original, as if the below [Original
code](#original-code) was being used, you can do:
-```sh
+```
make SLEEP=0 clobber alt
./sloane.alt
```
@@ -46,14 +46,14 @@ Should you wish to see the original you may do so with the original code,
### Original build:
-```sh
+```
make clobber all
```
### Original use:
-```sh
+```
./sloane
```
diff --git a/2006/sloane/index.html b/2006/sloane/index.html
index 21c88db9d..e9c676afb 100644
--- a/2006/sloane/index.html
+++ b/2006/sloane/index.html
@@ -141,31 +141,31 @@ Location: US - United States of America
To build:
-
make alt
+
make alt
We recommend the alt version so that you can see what this looked like back in 2006.
If you wish to see the original faster version see original
code below.
To use:
-
./slone.alt
+
./slone.alt
Try:
The alternate version, which we recommend that you use in order to see what is
happening with modern systems, and to not flash too quickly, which can be
problematic for some people, can be configured to different speeds by way of the
value used in usleep(). The default is 75000 but you can easily change
it. To do so try:
-
make clobber SLEEP=70000 clobber alt
-./sloane.alt
+
make clobber SLEEP=70000 clobber alt
+ ./sloane.alt
If you wish to make it like the original, as if the below Original
code was being used, you can do:
-
make SLEEP=0 clobber alt
-./sloane.alt
+
make SLEEP=0 clobber alt
+ ./sloane.alt
Original code:
Should you wish to see the original you may do so with the original code,
sloane.c.
Original build:
-
make clobber all
+
make clobber all
Original use:
-
./sloane
+
./sloane
WARNING: if you are easily overstimulated with fast movement or have
photosensitivity please be careful running this version and instead see the
above!
diff --git a/2006/stewart/README.md b/2006/stewart/README.md
index f7c787689..b83423947 100644
--- a/2006/stewart/README.md
+++ b/2006/stewart/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./stewart width_and_height iterations file > file.xbm
convert file.xbm file.png
```
@@ -29,7 +29,7 @@ NOTE: `convert(1)` belongs to [ImageMagick](https://imagemagick.org/index.php).
## Try:
-```sh
+```
./try.sh
```
@@ -58,7 +58,7 @@ a reasonably experienced user who can parse formats in their mind. :-)
The program should be run with the following
-```sh
+```
./stewart
```
@@ -77,7 +77,7 @@ are 3. Wrong arguments will cause the program to bomb out.
#### Example:
-```sh
+```
./stewart 1024 1000000 gasket > gasket.xbm
```
diff --git a/2006/stewart/index.html b/2006/stewart/index.html
index 04ac81666..96b549c93 100644
--- a/2006/stewart/index.html
+++ b/2006/stewart/index.html
@@ -141,10 +141,10 @@ Location: US - United States of America
After running the program on a few files it will ask you if you wish to run it
on the remaining files.
The script will try converting the xbm files created by the program to png
@@ -171,7 +171,7 @@ a reasonably experienced user who can parse formats in their mind. :-)
Author’s remarks:
Execution
The program should be run with the following
-
./stewart<m><n><ifs>
+
./stewart <m> <n> <ifs>
where:
m = The size of the picture (picture will be m X m in size).
n = The number of iterations to run (More will make for a
@@ -181,7 +181,7 @@ a reasonably experienced user who can parse formats in their mind. :-)
on standard out. Minimal checking is done on the arguments mainly that there
are 3. Wrong arguments will cause the program to bomb out.
Example:
-
./stewart 1024 1000000 gasket > gasket.xbm
+
./stewart 1024 1000000 gasket > gasket.xbm
Compilation/Testing
The program compiles without warning with gcc -ansi -Wall.
lint also seems to like the code. This must be a bug in lint.
diff --git a/2006/sykes1/README.md b/2006/sykes1/README.md
index 0f04c6c3c..d51e17857 100644
--- a/2006/sykes1/README.md
+++ b/2006/sykes1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -22,7 +22,7 @@ For more detailed information see [2006 sykes1 bugs](../../bugs.html#2006_sykes1
## To use:
-```sh
+```
./sykes1
```
@@ -31,7 +31,7 @@ Next point your browser to the file: `sykes1.html`.
## Try:
-```sh
+```
./sykes1 10
```
@@ -39,7 +39,7 @@ Refresh your browser.
You might also try:
-```sh
+```
./try.sh
```
@@ -52,7 +52,7 @@ If you have all day :-) and wish to find out how fast your machine can solve the
maximum:
-```sh
+```
time ./sykes1 19186
```
@@ -81,7 +81,7 @@ This alternate code is based on the author's remarks.
### Alternate build:
-```sh
+```
make alt
```
@@ -96,7 +96,7 @@ Use `sykes1.alt` as you would `sykes1` above.
The [try.sh](try.sh) script will use both versions to show some differences. You
can do so like:
-```sh
+```
./try.sh
```
@@ -106,7 +106,7 @@ can do so like:
Read the [sykes1.html](sykes1.html) page source.
Now then read the C source. Confused? :-) If it's not clear try:
-```sh
+```
diff -s sykes1.c sykes1.html
```
@@ -138,7 +138,7 @@ need to be very lucky indeed to stumble across a solution.
Compile the program, then test that it works:
-```sh
+```
./sykes1
```
@@ -154,7 +154,7 @@ cube. Rendered in glorious 3D color.
Want to see another solution? Try:
-```sh
+```
./sykes1 some_number
```
@@ -165,7 +165,7 @@ Try some more - there are exactly `19186` solutions to choose from.
If you have a fast machine you might try the last solution:
-```sh
+```
./sykes1 19186
```
@@ -178,7 +178,7 @@ The implementation is an optimized recursive algorithm that tries to fit
the pieces into the cube one by one. The cube pieces are defined near
the start of the program:
-```c
+```
int s[ ] = { 186, 94, 1426, 3098
,1047 , 122 , 1082 , 3083 , 1039
, 569 , 527 , 1054 , 531 } ;
@@ -233,7 +233,7 @@ the pieces, and provided that a solution is possible, it will be found.
For example, if you modify line 13 of the source like this, the program
will solve for a different piece set:
-```c
+```
int s[ ] = { 187, 94, 402, 3098
```
diff --git a/2006/sykes1/index.html b/2006/sykes1/index.html
index 1464395d8..009463410 100644
--- a/2006/sykes1/index.html
+++ b/2006/sykes1/index.html
@@ -141,7 +141,7 @@ Location: FI - Republic of Finland
To build:
-
make
+
make
There is an alt version based on the author’s remarks. The try.sh
script will compile and use both but if you wish to see the alternate version
specifically see the Alternate code section below.
@@ -150,18 +150,18 @@ specifically see the Alternate code section below.
This will run both the original entry and the alt code to show some differences.
Also try:
If you have all day :-) and wish to find out how fast your machine can solve the
maximum:
-
time ./sykes1 19186
+
time ./sykes1 19186
This was done on a Rocky Linux 9.2 server with Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz with 16 cores (via HyperThreading):
real 6m35.524s
user 6m35.159s
@@ -173,17 +173,17 @@ maximum:
Alternate code:
This alternate code is based on the author’s remarks.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use sykes1.alt as you would sykes1 above.
Alternate try:
The try.sh script will use both versions to show some differences. You
can do so like:
-
./try.sh
+
./try.sh
Judges’ remarks:
Read the sykes1.html page source.
Now then read the C source. Confused? :-) If it’s not clear try:
-
diff-s sykes1.c sykes1.html
+
diff -s sykes1.c sykes1.html
For extra credit, understand what happens when you give this entry
an negative number argument, and why.
See the author’s remarks for how to make your own shapes as well.
@@ -200,7 +200,7 @@ together. I have not known anyone to solve it in this way - you would
need to be very lucky indeed to stumble across a solution.
Instructions
Compile the program, then test that it works:
-
./sykes1
+
./sykes1
Shortly you should see the first solution pop out on your screen. It
shows you how to build the cube piece by piece, rendered in glorious
3D ASCII.
@@ -210,20 +210,20 @@ open the file sykes1.html. This html file is just a co
the browser display for you a nice animated GIF, showing you how to build the
cube. Rendered in glorious 3D color.
Want to see another solution? Try:
-
./sykes1 some_number
+
./sykes1 some_number
The program will discard solutions up to the number, and output numbered
solution. Refresh your browser window to see the new solution.
Try some more - there are exactly 19186 solutions to choose from.
If you have a fast machine you might try the last solution:
-
./sykes1 19186
+
./sykes1 19186
On my machine this takes about half an hour to run.
Implementation
The implementation is an optimized recursive algorithm that tries to fit
the pieces into the cube one by one. The cube pieces are defined near
the start of the program:
-
int s[]={186,94,1426,3098
-,1047,122,1082,3083,1039
-,569,527,1054,531};
Each piece is a bitmap, and represents a 3x3x3 cube.
For instance the first piece is 186 - this is 010111010 in binary.
Written out like this you can see that it is the cross shaped piece:
@@ -256,7 +256,7 @@ shape:
the pieces, and provided that a solution is possible, it will be found.
For example, if you modify line 13 of the source like this, the program
will solve for a different piece set:
-
int s[]={187,94,402,3098
+
int s[ ] = { 187, 94, 402, 3098
And of course you can make your own.
After the pieces are defined, the first thing the program does it to
fit them into a 4x4 cube. It collects every possible placing of each
diff --git a/2006/sykes2/README.md b/2006/sykes2/README.md
index 0ca475207..c0d579da2 100644
--- a/2006/sykes2/README.md
+++ b/2006/sykes2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./sykes2
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2006/sykes2/index.html b/2006/sykes2/index.html
index c72553191..1b20fc885 100644
--- a/2006/sykes2/index.html
+++ b/2006/sykes2/index.html
@@ -141,11 +141,11 @@ Location: FI - Republic of Finland
To build:
-
make
+
make
To use:
-
./sykes2
+
./sykes2
Try:
-
./try.sh
+
./try.sh
This will repeatedly remake the program and run it then sleep for one second for
a nice show of time.
Judges’ Comments:
diff --git a/2006/toledo1/README.md b/2006/toledo1/README.md
index 14eaa3579..9f3907dfd 100644
--- a/2006/toledo1/README.md
+++ b/2006/toledo1/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./toledo1 [0-9][0-9]
```
@@ -16,7 +16,7 @@ where `[0-9][0-9]` is a two digit number.
## Try:
-```sh
+```
./try.sh
```
@@ -38,7 +38,7 @@ visit the 64 squares without repeating them?
If not, this program does it, just run it with an argument
giving initial position.
-```sh
+```
./toledo1 11 # start is A8
./toledo1 18 # start is H8
./toledo1 81 # start is A1
diff --git a/2006/toledo1/index.html b/2006/toledo1/index.html
index 76abcfbf4..b7d1f3158 100644
--- a/2006/toledo1/index.html
+++ b/2006/toledo1/index.html
@@ -141,12 +141,12 @@ Location: MX - United Mexican States
To build:
-
make
+
make
To use:
-
./toledo1[0-9][0-9]
+
./toledo1 [0-9][0-9]
where [0-9][0-9] is a two digit number.
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
For most of the arguments (e.g. those above) the resulting path
is not circular, but at least one starting point yields a circular path.
@@ -157,11 +157,11 @@ be expected, and some dump core?
visit the 64 squares without repeating them?
If not, this program does it, just run it with an argument
giving initial position.
-
./toledo1 11 # start is A8
-./toledo1 18 # start is H8
-./toledo1 81 # start is A1
-./toledo1 88 # start is H1
-./toledo1 44 # start is D5
+
./toledo1 11 # start is A8
+ ./toledo1 18 # start is H8
+ ./toledo1 81 # start is A1
+ ./toledo1 88 # start is H1
+ ./toledo1 44 # start is D5
It will print move order. The algorithm is so simple that you can read
it in the source code. At the first glance it can appear checkered.
Nevertheless, don’t be dismayed, jar, jar. :-)
diff --git a/2006/toledo2/README.md b/2006/toledo2/README.md
index 7e9d6e67d..3d6b31c4c 100644
--- a/2006/toledo2/README.md
+++ b/2006/toledo2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -22,7 +22,7 @@ For more detailed information see [2006 toledo2 bugs](../../bugs.html#2006_toled
## To use:
-```sh
+```
./toledo2
```
@@ -33,7 +33,7 @@ does not seem to happen in macOS or linux in 2023.
## Try:
-```sh
+```
./toledo2
```
@@ -56,7 +56,7 @@ functions in place of `read(2)` and `write(2)`.
### Alternate build:
-```sh
+```
make alt
```
@@ -112,7 +112,7 @@ Journal](https://en.wikipedia.org/wiki/Dr._Dobb%27s_Journal).
Type using uppercase letters. Here are three example programs. Press Enter after
each line:
-```basic
+```
10 PRINT "Hello, world!"
LIST
RUN
@@ -155,7 +155,7 @@ from the `SOURCE` directory:
To import them, you must run the emulator with an argument, by
example:
-```sh
+```
./toledo2 DDT.COM
```
diff --git a/2006/toledo2/index.html b/2006/toledo2/index.html
index b109fe00f..5572e5c3a 100644
--- a/2006/toledo2/index.html
+++ b/2006/toledo2/index.html
@@ -141,7 +141,7 @@ Location: MX - United Mexican States
To build:
-
make
+
make
There is alternate code that is based on the author’s notes
for DOS/Windows. This cannot be tested by us, not even to compile, but it appears
that it should be fine, after the proper header files were added.
@@ -150,12 +150,12 @@ that it should be fine, after the proper header files were added.
To end execution press ctrl-z. As mentioned in the author’s remarks and in the
below section, it is supposed to crash on termination though some noted this
does not seem to happen in macOS or linux in 2023.
Try:
-
./toledo2
+
./toledo2
and then type in the following:
10 PRINT "HELLO WORLD!"
LIST
@@ -165,7 +165,7 @@ does not seem to happen in macOS or linux in 2023.
This version, as noted, should work for DOS/Windows. It uses non-standard
functions in place of read(2) and write(2).
Alternate build:
-
make alt
+
make alt
Alternate use:
The author noted that for PC/DOS you will have to add ANSI.SYS to your
CONFIG.SYS but this is also something we can’t test.
When it ends, do HALT, so the file is closed, and you can start
diff --git a/2006/toledo3/README.md b/2006/toledo3/README.md
index 9a1a0bab4..7542733db 100644
--- a/2006/toledo3/README.md
+++ b/2006/toledo3/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,14 +11,14 @@ tested with Windows. See [alternate code](#alternate-code) below.
## To use:
-```sh
+```
./toledo3 [1 | 2 | 3 [b]]
```
## Try:
-```sh
+```
./toledo3 1
```
@@ -62,7 +62,7 @@ So I managed to do a graphical X11 chess program ('`WYSIAIE`', or 'What You See
Is An IOCCC Entry'). Pointing and clicking to move pieces is the only required
action, and of course the command-line options:
-```sh
+```
./toledo3 # Two-players mode (useful if you don't have a board at hand)
./toledo3 1 # Human white - Computer black, level 1 (fast)
./toledo3 2 # Human white - Computer black, level 2 (medium)
@@ -97,7 +97,7 @@ number generator.
Because it is resource-hungry, I strongly recommend to compile it
using maximum optimization. With GCC you can use:
-```sh
+```
gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11
```
diff --git a/2006/toledo3/index.html b/2006/toledo3/index.html
index e0282106f..2a913a8a8 100644
--- a/2006/toledo3/index.html
+++ b/2006/toledo3/index.html
@@ -141,14 +141,14 @@ Location: MX - United Mexican States
To build:
-
make
+
make
The author provided two alternate versions, one which adds a status bar and
another that makes it text only. The author also provided a version that they
tested with Windows. See alternate code below.
To use:
-
./toledo3 [1 |2|3[b]]
+
./toledo3 [1 | 2 | 3 [b]]
Try:
-
./toledo3 1
+
./toledo3 1
Alternate code:
The author provided two additional versions, toledo3-sbar.c
and toledo3-txt.c. Respectively these create a status bar and
@@ -172,13 +172,13 @@ the code for Deep Blue.
So I managed to do a graphical X11 chess program (‘WYSIAIE’, or ‘What You See
Is An IOCCC Entry’). Pointing and clicking to move pieces is the only required
action, and of course the command-line options:
-
./toledo3# Two-players mode (useful if you don't have a board at hand)
-./toledo3 1 # Human white - Computer black, level 1 (fast)
-./toledo3 2 # Human white - Computer black, level 2 (medium)
-./toledo3 3 # Human white - Computer black, level 3 (slow)
-./toledo3 1 b # Human black - Computer white, level 1 (fast)
-./toledo3 2 b # Human black - Computer white, level 2 (medium)
-./toledo3 3 b # Human black - Computer white, level 3 (slow)
+
./toledo3 # Two-players mode (useful if you don't have a board at hand)
+ ./toledo3 1 # Human white - Computer black, level 1 (fast)
+ ./toledo3 2 # Human white - Computer black, level 2 (medium)
+ ./toledo3 3 # Human white - Computer black, level 3 (slow)
+ ./toledo3 1 b # Human black - Computer white, level 1 (fast)
+ ./toledo3 2 b # Human black - Computer white, level 2 (medium)
+ ./toledo3 3 b # Human black - Computer white, level 3 (slow)
The computer will check that your moves are legal. Full legal
chess moves are allowed, except minor promotions on human side.
The game will continue up to its logical conclusion, you make
@@ -196,7 +196,7 @@ optimizations use valuable IOCCC characters.
number generator.
Because it is resource-hungry, I strongly recommend to compile it
using maximum optimization. With GCC you can use:
Because this is my second X11 program (the first was
diff --git a/2011/akari/README.md b/2011/akari/README.md
index 5211680d7..e4136da81 100644
--- a/2011/akari/README.md
+++ b/2011/akari/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./akari [ input_file | - ] [ output_file | - ] [even]
```
## Try:
-```sh
+```
./try.sh
```
@@ -56,7 +56,7 @@ keep odd pixels on odd [scanlines](https://en.wikipedia.org/wiki/Scan_line).
### Examples:
-```sh
+```
gcc akari.c -o akari
./akari < example.ppm > odd_output.ppm
./akari - - even < example.ppm > even_output.ppm
@@ -82,7 +82,7 @@ Anything that is not parsable as `PGM` or `PPM` will be downsampled as
ASCII art. Since the source code is formatted as ASCII art, it's only
natural to try:
-```sh
+```
./akari akari.c akari2.c
```
@@ -91,7 +91,7 @@ By default, this second program reads text from `stdin` and writes
expanded output to `stdout`. If the extra argument is specified, the
output text will also pass through a rot13 filter.
-```sh
+```
gcc akari2.c -o akari2
./akari2 < input.txt > expanded_output.txt
./akari2 rot13 < input.txt > expanded_and_rot13_output.txt
@@ -100,20 +100,20 @@ output text will also pass through a rot13 filter.
You can combine the two programs together to have just a regular rot13
filter:
-```sh
+```
./akari2 rot13 < input.txt | ./akari > rot13.txt
```
Of course, we wouldn't stop with just 2 programs, you can downsample
the source *again* and get yet another C program:
-```sh
+```
./akari < akari.c | ./akari > akari3.c
```
We must go deeper:
-```sh
+```
./akari < akari.c | ./akari | ./akari > akari4.c
```
diff --git a/2011/akari/index.html b/2011/akari/index.html
index dbcddc3a5..087128ddc 100644
--- a/2011/akari/index.html
+++ b/2011/akari/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
Anything that is not parsable as PGM or PPM will be downsampled as
ASCII art. Since the source code is formatted as ASCII art, it’s only
natural to try:
-
./akari akari.c akari2.c
+
./akari akari.c akari2.c
akari2.c is also a valid C program, and accepts up to 1 argument.
By default, this second program reads text from stdin and writes
expanded output to stdout. If the extra argument is specified, the
output text will also pass through a rot13 filter.
You can combine the two programs together to have just a regular rot13
filter:
-
./akari2 rot13 < input.txt |./akari> rot13.txt
+
./akari2 rot13 < input.txt | ./akari > rot13.txt
Of course, we wouldn’t stop with just 2 programs, you can downsample
the source again and get yet another C program:
-
./akari< akari.c |./akari> akari3.c
+
./akari < akari.c | ./akari > akari3.c
We must go deeper:
-
./akari< akari.c |./akari|./akari> akari4.c
+
./akari < akari.c | ./akari | ./akari > akari4.c
akari3.c and akari4.c are still (mostly valid) C programs.
gcc -Wall will output a few warnings, but still produce output
executables. The output executables each print a message to stdout.
diff --git a/2011/blakely/README.md b/2011/blakely/README.md
index b100c2ab1..d607d4ea2 100644
--- a/2011/blakely/README.md
+++ b/2011/blakely/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -9,20 +9,20 @@
Zoom out and make your terminal window 53 or more lines deep.
-```sh
+```
./blakely < blakely.c | head -300
```
## Try:
-```sh
+```
./try.sh
```
For those who have a lot of time, try:
-```sh
+```
./blakely < t0_3.dat
```
@@ -40,7 +40,7 @@ is a [Garden of Eden](http://en.wikipedia.org/wiki/Garden_of_Eden_%28cellular_au
If you have enough time to spare, put the plan of your garden in a text file,
and run:
-```sh
+```
./blakely - < garden.txt
```
@@ -54,7 +54,7 @@ over tabs.
In order to see the main feature of the code, type:
-```sh
+```
./blakely < blakely.c
```
@@ -72,7 +72,7 @@ layout of the source-code is such that it evolves to a digital representation of
the first 15 decimal places of pi after 4 time steps. This was setup using the
other feature of the program which can be demonstrated as follows:
-```sh
+```
./blakely - < 3.dat
```
@@ -81,7 +81,7 @@ more grids (taking a few minutes to display the last). Waiting for any more
grids will take a substantial amount of time. The final grid has been put into
[evolve_to_3.dat](evolve_to_3.dat), and if you type
-```sh
+```
./blakely < evolve_to_3.dat
```
diff --git a/2011/blakely/index.html b/2011/blakely/index.html
index 2110056ac..382bd9d76 100644
--- a/2011/blakely/index.html
+++ b/2011/blakely/index.html
@@ -141,14 +141,14 @@ Location: GB - United Kingdom of Great
To build:
-
make
+
make
To use:
Zoom out and make your terminal window 53 or more lines deep.
-
./blakely< blakely.c |head-300
+
./blakely < blakely.c | head -300
Try:
-
./try.sh
+
./try.sh
For those who have a lot of time, try:
-
./blakely< t0_3.dat
+
./blakely < t0_3.dat
though one might or might not need to kill it, depending on your boredom
threshold.
Judges’ remarks:
@@ -158,14 +158,14 @@ if given its own source as input, and allows to check if your garden
is a Garden of Eden, all in one source.
If you have enough time to spare, put the plan of your garden in a text file,
and run:
-
./blakely-< garden.txt
+
./blakely - < garden.txt
Author’s remarks:
This program uses a well-known algorithm in order to display pi to fifteen
decimal places. The source-layout itself demonstrates the importance of using
the correct amount of whitespace in code and the clear superiority of spaces
over tabs.
In order to see the main feature of the code, type:
-
./blakely< blakely.c
+
./blakely < blakely.c
and wait for about four seconds before using Ctrl-C (or whatever) to end the program. The
results are best viewed in a terminal window at least 60 characters
high and wide. Alternatively, redirect the output to a separate file
@@ -176,12 +176,12 @@ Life
”, using standard input as a starting grid. The
layout of the source-code is such that it evolves to a digital representation of
the first 15 decimal places of pi after 4 time steps. This was setup using the
other feature of the program which can be demonstrated as follows:
-
./blakely-< 3.dat
+
./blakely - < 3.dat
The program will first display the grid given in 3.dat, and then three
more grids (taking a few minutes to display the last). Waiting for any more
grids will take a substantial amount of time. The final grid has been put into
evolve_to_3.dat, and if you type
-
./blakely< evolve_to_3.dat
+
./blakely < evolve_to_3.dat
then the 3 will reappear after three time steps.
As should now be clear, this use of the program will attempt to evolve a given setup
backwards in time according to the Life rules. The resulting grid is clearly not
diff --git a/2011/borsanyi/README.md b/2011/borsanyi/README.md
index f932b7a1f..064418901 100644
--- a/2011/borsanyi/README.md
+++ b/2011/borsanyi/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 borsanyi bugs](../../bugs.html#2011_bors
## To use:
-```sh
+```
./borsanyi < some_data_file
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2011/borsanyi/index.html b/2011/borsanyi/index.html
index cd9a6dbcb..7ddc790a6 100644
--- a/2011/borsanyi/index.html
+++ b/2011/borsanyi/index.html
@@ -141,15 +141,15 @@ Location: DE - Federal Republic of Germ
This is a nice quick histogram
plotter. A useful utility when you need to look at the distribution of some
diff --git a/2011/dlowe/README.md b/2011/dlowe/README.md
index f228ed7d8..ec7638b56 100644
--- a/2011/dlowe/README.md
+++ b/2011/dlowe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -19,7 +19,7 @@ For more detailed information see [2011 dlowe bugs](../../bugs.html#2011_dlowe).
## To use:
-```sh
+```
./dlowe - corpus1/ [...] corpus0/ < start.net > trained.net
```
@@ -27,7 +27,7 @@ NOTE: In the above command, the directory args MUST end in a `/`.
Then to use `trained.net`:
-```sh
+```
./dlowe file [file ...] < trained.net
```
@@ -36,7 +36,7 @@ Then to use `trained.net`:
Try these pre-trained networks:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ NOTE: The `dlowe-aux-data/` directory, which [try.sh](try.sh) refers to, was
created by:
-```sh
+```
tar -jxf dlowe-aux-data.tar.bz2
```
@@ -63,7 +63,7 @@ on the C code of entries that were supplied to the 20Th IOCCC.
The `ioccc-winlose-trained.net` was trained using the
[earlystop.pl](earlystop.pl) tool:
-```sh
+```
rm -f ioccc-winlose-trained.net
./earlystop.pl ioccc-winlose-trained.net ioccc_won_training/ ioccc_lost_training/ ioccc_won_test/ ioccc_lost_test/
```
@@ -101,7 +101,7 @@ The resulting `ioccc-winlose-trained.net` file was included in the
The [dlowe.c](dlowe.c) was explicitly excluded from this trailing set, so this
test is interesting:
-```sh
+```
./dlowe dlowe.c < dlowe-aux-data/ioccc-winlose-trained.net
```
@@ -127,7 +127,7 @@ data sets on which to test:
We created the [english-trained.net](dlowe-aux-data/english-trained.net) as follows:
-```sh
+```
./dlowe -8000 dlowe-aux-data/english-1/ dlowe-aux-data/english-0/ < /dev/null > dlowe-aux-data/english-trained.net
```
@@ -139,7 +139,7 @@ We created the [english-trained.net](dlowe-aux-data/english-trained.net) as foll
We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
-```sh
+```
./dlowe -8000 png-1/ png-0/ < /dev/null > dlowe-aux-data/png-trained.net
```
@@ -151,7 +151,7 @@ We created the [png-trained.net](dlowe-aux-data/png-trained.net) as follows:
We created the [xor-trained.net](dlowe-aux-data/xor-trained.net) as follows:
-```sh
+```
./dlowe -8000 dlowe-aux-data/xor-1/ dlowe-aux-data/xor-0/ < /dev/null > dlowe-aux-data/xor-trained.net
```
@@ -189,7 +189,7 @@ The neurons' activation function is the logistic function `1 / (1 + e ^ -x)`.
### Classifying
-```sh
+```
./dlowe file [file ...] < trained.net
```
@@ -205,7 +205,7 @@ trained, but it's geared toward interpretation as a *probability* or a
### Training
-```sh
+```
./dlowe - corpus1/ [...] corpus0/ < start.net > end.net
```
diff --git a/2011/dlowe/index.html b/2011/dlowe/index.html
index 7edb919fa..7630a1d6b 100644
--- a/2011/dlowe/index.html
+++ b/2011/dlowe/index.html
@@ -141,23 +141,23 @@ Location: US - United States of America
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: missing or dead link - please provide them
STATUS: INABIAF - please **DO NOT** fix
The match of dlowe.c to the lose/win trailed network was:
dlowe.c 0.125108
@@ -203,7 +203,7 @@ mean it will win or lose a future IOCCC. On the other hand … it just might!While we cannot supply you with the losing IOCCC source code, the author did supply a number
data sets on which to test:
@@ -242,7 +242,7 @@ which can be trained, using on-line
neuron.
The neurons’ activation function is the logistic function 1 / (1 + e ^ -x).
Classifying
-
./dlowe file [file ...] < trained.net
+
./dlowe file [file ...] < trained.net
To classify files, one specifies a trained network (on stdin) and one or more
files to classify. The program will output one line per successfully-classified
file to stderr, with the filename and the classification: a number between 0
@@ -251,7 +251,7 @@ and 1.
trained, but it’s geared toward interpretation as a probability or a
confidence.
NOTE: The directory args must end in a/ for them to work.
To train a network, one specifies a starting network (on stdin), two or more
corpora (directories containing training data), and the number of training
diff --git a/2011/eastman/README.md b/2011/eastman/README.md
index 986f6994a..16143d677 100644
--- a/2011/eastman/README.md
+++ b/2011/eastman/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./eastman
```
@@ -19,7 +19,7 @@ NOTE: to restore your cursor in your shell, try `reset`.
Run the program. Quit it (ctrl-c/intr). Resize your terminal window. Run it
again. Try doing this a number of times with different sizes each time.
-```sh
+```
./eastman
```
@@ -60,7 +60,7 @@ program is running, though. It only checks the size once, when it starts up.
To compile:
-```sh
+```
cc -lm eastman.c
```
diff --git a/2011/eastman/index.html b/2011/eastman/index.html
index d37b07e6f..513b183c5 100644
--- a/2011/eastman/index.html
+++ b/2011/eastman/index.html
@@ -141,14 +141,14 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./eastman
+
./eastman
NOTE: to restore your cursor in your shell, try reset.
Try:
Run the program. Quit it (ctrl-c/intr). Resize your terminal window. Run it
again. Try doing this a number of times with different sizes each time.
-
./eastman
+
./eastman
NOTE: to restore your cursor in your shell, try reset.
Judges’ remarks:
This round program will generate a classic spherical result!
@@ -173,7 +173,7 @@ is also just part of the texture, not an actual raytraced shadow.
so try enlarging the window to get higher resolution. Don’t resize while the
program is running, though. It only checks the size once, when it starts up.
To compile:
-
cc-lm eastman.c
+
cc -lm eastman.c
Portability
It should be completely portable. I’ve tested with gcc on Mac OS X 10.7 (Lion)
and Fedora 10. I would expect it to work in any Unix-like environment.
diff --git a/2011/fredriksson/README.md b/2011/fredriksson/README.md
index d244e27d3..562108af2 100644
--- a/2011/fredriksson/README.md
+++ b/2011/fredriksson/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 fredriksson bugs](../../bugs.html#2011_f
## To use:
-```sh
+```
./fredriksson [-icvtnk#] regexp < file
```
## Try:
-```sh
+```
./try.sh
```
@@ -55,7 +55,7 @@ Implements a variant of `grep`.
To search regexp from file, do:
-```sh
+```
./fredriksson [-icvtnk#] regexp < file
```
@@ -123,13 +123,13 @@ expressions by putting `]` as the first character, and putting `-` last.
Just say
-```sh
+```
./fredriksson -k3 cat < file
```
* Like with `cat`, you can append line numbers too:
-```sh
+```
./fredriksson -nk3 cat < file
```
@@ -173,7 +173,7 @@ Just say
* Depending on the file, it might require a lot of stack space. If the
program segfaults (because of this), say
-```sh
+```
ulimit -s unlimited
```
@@ -207,7 +207,7 @@ Just say
extracts and builds that, and then calls it. More precisely, the command
to build is
-```sh
+```
gcc -O3 ag.c -o ag
```
@@ -260,14 +260,14 @@ Just say
* No numerical values, other than in the initialized char array, try
-```sh
+```
./fredriksson -ck0 [0-9] < fredriksson.c
```
This should print 1, as there is a number `3` in the char array (only).
You can also try
-```sh
+```
./fredriksson -ck0 [0-9] < ag.c
```
diff --git a/2011/fredriksson/index.html b/2011/fredriksson/index.html
index f93f25ed1..f2fb75be6 100644
--- a/2011/fredriksson/index.html
+++ b/2011/fredriksson/index.html
@@ -141,15 +141,15 @@ Location: FI - Republic of Finland
NOTE: you need to be allowed to change your stack size or else the last command
in the script would likely cause the program to dump core, which is why the
script checks the exit code of ulimit first.
@@ -165,7 +165,7 @@ program and calls it. As an exercise, try writing the compressor.
Implements a variant of grep.
Usage
To search regexp from file, do:
-
./fredriksson[-icvtnk#] regexp < file
+
./fredriksson [-icvtnk#] regexp < file
Pipes might not work, see the section Limitations.
The options -i, -c, -v and -n are the classic ones:
@@ -220,11 +220,11 @@ expressions by putting ] as the first character, and putting
It is assumed that the user knows how to feed correct input to the
@@ -256,7 +256,7 @@ you can easily use long long instead,
Depending on the file, it might require a lot of stack space. If the
program segfaults (because of this), say
-
ulimit-s unlimited
+
ulimit -s unlimited
cross your fingers, hope it is enough, and try again.
Assumes C99 standard, because of the one very long line. Most C compilers
@@ -284,7 +284,7 @@ as well as its name and commands to build and run it, all
extracts and builds that, and then calls it. More precisely, the command
to build is
-
gcc-O3 ag.c -o ag
+
gcc -O3 ag.c -o ag
To change that you need to edit the char array p[] and (possibly) two
specially encoded constants, -~('('*'(') and 'C'*' '-'-'.
The extracted source (ag.c) is obfuscated as well.
@@ -333,10 +333,10 @@ Two’s complement representation of integers is also abused. E.g. instead
of writing x++ or x-1, it is much better to write x=-~x and ~-x.
No numerical values, other than in the initialized char array, try
-
./fredriksson-ck0[0-9]< fredriksson.c
+
./fredriksson -ck0 [0-9] < fredriksson.c
This should print 1, as there is a number 3 in the char array (only).
You can also try
-
./fredriksson-ck0[0-9]< ag.c
+
./fredriksson -ck0 [0-9] < ag.c
after running fredriksson at least once (since this generates that
ag.c file), and this should print 0.
diff --git a/2011/goren/README.md b/2011/goren/README.md
index cd1afbbd9..ecc7bd32d 100644
--- a/2011/goren/README.md
+++ b/2011/goren/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
echo "some text" | ./goren
```
## Try:
-```sh
+```
./try.sh
```
@@ -27,13 +27,13 @@ In the words of [René François Ghislain Magritte Magritte](http://en.wikipedia
One may ask the surrealist question:
-```sh
+```
echo 'If | is just a representation of a pipe, then how can data stuff it?' | ./goren
```
However if one takes a firm stand and declares:
-```sh
+```
echo '| is just a representation of a pipe because I say so! So stuff it!' | ./goren
```
diff --git a/2011/goren/index.html b/2011/goren/index.html
index 2e1dd2c39..147a961dc 100644
--- a/2011/goren/index.html
+++ b/2011/goren/index.html
@@ -141,11 +141,11 @@ Location: IL - State of Israel (
If you have perl installed you should be able to reproduce
dragon.nono like:
-
perl c2nono.pl hamaji.c |./hamaji
+
perl c2nono.pl hamaji.c | ./hamaji
Judges’ remarks:
This program solves Nonograms which is
also known as “Paint by Numbers”.
@@ -260,7 +260,7 @@ with the well obfuscated code.
Portability
This program uses two C99 features. One line comments and long long.
GCC’s -ansi -pedantic check should pass:
-
cc-ansi-pedantic-std=c99 hamaji.c
+
cc -ansi -pedantic -std=c99 hamaji.c
I checked my program with gcc-4.6.2 on linux, llvm-gcc-4.2 on Mac, and
clang-3.0 on Mac.
Note that the behavior of scanf(3) differs on linux and mac, but this
@@ -269,7 +269,7 @@ program supports both semantics.
memory layout, undefined evaluation order (e.g., a[i++]=i), etc.
This program won’t work if the size of long long literal is less than 8.
By grepping the source code of gcc
-
grep LONG_LONG_TYPE_SIZE gcc/config/*/*
+
grep LONG_LONG_TYPE_SIZE gcc/config/*/*
I found long long may be 32bit integers only on AVR.
make
```
## To use:
-```sh
+```
./hou 'expression'
```
## Try:
-```sh
+```
./try.sh
```
@@ -32,7 +32,7 @@ source code. What does it mean?
The calculator obeys the precedence rules and allows parenthesis.
-```sh
+```
./hou '1+2*3'
./hou '(1+2)*3'
```
@@ -41,7 +41,7 @@ What exactly does the text formatting do?
What does this evaluate to in C?
-```c
+```
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
```
diff --git a/2011/hou/index.html b/2011/hou/index.html
index ec07eb888..f560962d5 100644
--- a/2011/hou/index.html
+++ b/2011/hou/index.html
@@ -141,11 +141,11 @@ Location: CN - People’s Republic of C
To build:
-
make
+
make
To use:
-
./hou'expression'
+
./hou 'expression'
Try:
-
./try.sh
+
./try.sh
As the script asks you, what does the last one mean? Can you get it to report a
different value? Hint: it’s in this file, kind of.
Judges’ remarks:
@@ -154,11 +154,11 @@ warnings under the most strict pedantic mode of gcc and clang.
The first example, along with the correct result appears in the
source code. What does it mean?
The calculator obeys the precedence rules and allows parenthesis.
-
./hou'1+2*3'
-./hou'(1+2)*3'
+
./hou '1+2*3'
+ ./hou '(1+2)*3'
What exactly does the text formatting do?
What does this evaluate to in C?
-
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
Self documenting source
Comments would almost be redundant. :-}
The ASCII art is valid C code
diff --git a/2011/konno/README.md b/2011/konno/README.md
index 17fc889f6..da53d68cc 100644
--- a/2011/konno/README.md
+++ b/2011/konno/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./konno lower_case_word
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2011/konno/index.html b/2011/konno/index.html
index f5ae5e431..fa985c6a1 100644
--- a/2011/konno/index.html
+++ b/2011/konno/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./konno lower_case_word
+
./konno lower_case_word
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This tiny program outputs what looks like a tiny keyboard.
OK, so the letters are missing. But that is no problem because
diff --git a/2011/richards/README.md b/2011/richards/README.md
index 37fabfe56..f4f6ca68b 100644
--- a/2011/richards/README.md
+++ b/2011/richards/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2011 richards bugs](../../bugs.html#2011_rich
## To use:
-```sh
+```
echo expression | ./richards
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2011/richards/index.html b/2011/richards/index.html
index caad3fa9d..32dcf6e33 100644
--- a/2011/richards/index.html
+++ b/2011/richards/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: doesn't work with some platforms - please help us fix
Oh no, yet another
dc-style calculator? (see
diff --git a/2011/toledo/README.md b/2011/toledo/README.md
index 03a441569..c9c92d985 100644
--- a/2011/toledo/README.md
+++ b/2011/toledo/README.md
@@ -2,7 +2,7 @@
If you have X11 installed:
-```sh
+```
make
```
@@ -13,7 +13,7 @@ Windows](toledo.alt2.c). See [Alternate code](#alternate-code) below.
## To use:
-```sh
+```
./toledo
```
@@ -49,7 +49,7 @@ but you can change them about however you like, even with other keys. For
instance to swap `LEFT` and `RIGHT`:
-```sh
+```
make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt
```
@@ -75,7 +75,7 @@ the source early on, right before the code gets hard to follow, or using the
Like Oscar's previous winning X11 program for the 19th IOCCC, if
you remove both the X11 include files and replace them with
-```c
+```
#include "layer.c"
```
diff --git a/2011/toledo/index.html b/2011/toledo/index.html
index f793cdca8..611225179 100644
--- a/2011/toledo/index.html
+++ b/2011/toledo/index.html
@@ -142,12 +142,12 @@ Location: MX - United Mexican States
The first alt version, toledo.alt.c, allows you to reconfigure
the controls and the dimensions more easily.
@@ -168,7 +168,7 @@ have the right names you can define the macros FIRE, FORWARD<
HEIGHT= 288
but you can change them about however you like, even with other keys. For
instance to swap LEFT and RIGHT:
-
make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt
+
make clobber LEFT=XK_Right:XK_d RIGHT=XK_Left:XK_a alt
but you can specify something completely else and you can pick and choose which
controls you wish to redefine. You might also wish to change the dimensions of
the game, WIDTH and HEIGHT which have an arbitrarily selected lower limit as
@@ -184,7 +184,7 @@ the source early on, right before the code gets hard to follow, or using the
alternate version.
Like Oscar’s previous winning X11 program for the 19th IOCCC, if
you remove both the X11 include files and replace them with
-
#include "layer.c"
+
#include "layer.c"
you ought to be able to compile and run this program on Windows.
NOTE: this is what toledo.alt2.c is for.
Author’s remarks:
diff --git a/2011/vik/README.md b/2011/vik/README.md
index 34d0add56..a23661849 100644
--- a/2011/vik/README.md
+++ b/2011/vik/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,20 +21,20 @@ For more detailed information see [2011 vik bugs](../../bugs.html#2011_vik).
## To use:
-```sh
+```
./vik file.mod > audio_file.raw
```
If you have `mplayer(1)`:
-```sh
+```
./vik file.mod | mplayer -demuxer rawaudio -
```
Alternatively, you can convert the file to a WAV:
-```sh
+```
./vik file.mod > file.raw; ./raw2wav file.raw > file.wav
```
@@ -43,7 +43,7 @@ and then play `file.wav` with a program that can play WAV files.
## Try:
-```sh
+```
./try.sh
```
@@ -66,7 +66,7 @@ This version is based on the author's remarks and it should work for Windows.
Assuming that `make` is similar enough try:
-```sh
+```
make alt
```
@@ -87,7 +87,7 @@ initialization for?
Does it take your system a long time to compile? You may want to do:
-```sh
+```
cc -S vik.c
```
@@ -153,7 +153,7 @@ Bertilsson, also known as Deelite:
Compiling for Unix systems (including cygwin) is straight forward:
-```sh
+```
gcc -o vik vik.c
```
@@ -162,13 +162,13 @@ Compiling for Unix systems (including cygwin) is straight forward:
#### Convert MOD file to raw 44.1kHz stereo audio file
-```sh
+```
./vik mad_world.mod > audio_file.raw
```
#### Listen to the MOD file (streaming to mplayer)
-```sh
+```
./vik randowan.mod | mplayer -demuxer rawaudio -
```
@@ -210,7 +210,7 @@ Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:
-```c
+```
_setmode(_fileno(stdout), 0x8000);
```
diff --git a/2011/vik/index.html b/2011/vik/index.html
index db3ec9ef8..1b20de803 100644
--- a/2011/vik/index.html
+++ b/2011/vik/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version that should work for Windows. See alternate
code below.
and then play file.wav with a program that can play WAV files.
Try:
-
./try.sh
+
./try.sh
The script checks that you have mplayer(1) installed and if it is it will pipe
vik to mplayer. In this case it will also use raw2wav to convert the file
to a WAV file. If mplayer(1) cannot be found it will just use raw2wav. This
@@ -168,7 +168,7 @@ Archive.
This version is based on the author’s remarks and it should work for Windows.
Alternate build:
Assuming that make is similar enough try:
-
make alt
+
make alt
Alternate use:
Use vik.alt as you would vik above.
Judges’ remarks:
@@ -178,7 +178,7 @@ in a most pleasing manner if you don’t like tremolo or vibrato.
initialized 32MB array. Can you tell what that partial
initialization for?
Does it take your system a long time to compile? You may want to do:
-
cc-S vik.c
+
cc -S vik.c
and examine the resulting assembly file vik.s. On some platforms
the assembly file is about 128MB in size!
NOTE: The randowan.mod and mad_world.mod files were
@@ -225,12 +225,12 @@ Bertilsson, also known as Deelite:
Build
Compiling for Unix systems (including cygwin) is straight forward:
-
gcc-o vik vik.c
+
gcc -o vik vik.c
Usage
Convert MOD file to raw 44.1kHz stereo audio file
-
./vik mad_world.mod > audio_file.raw
+
./vik mad_world.mod > audio_file.raw
Listen to the MOD file (streaming to mplayer)
-
./vik randowan.mod |mplayer-demuxer rawaudio -
+
./vik randowan.mod | mplayer -demuxer rawaudio -
(Don’t forget the last - as it makes mplayer read from stdin.)
Obfuscation
The IOCCC rules did not put a limit on the entropy of the source code,
@@ -256,7 +256,7 @@ that the program relies on writing binary data to stdout.
Microsoft compilers adds a carriage return to newlines, and to compile
the program with this platform, the following line can be added after
the main declaration in order for the program to run correctly:
The program only runs when a valid MOD file is passed as argument. If
diff --git a/2011/zucker/README.md b/2011/zucker/README.md
index 50d371113..35e73d2a7 100644
--- a/2011/zucker/README.md
+++ b/2011/zucker/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ binary mode from text mode. See [alternate code](#alternate-code) below.
## To use:
-```sh
+```
./zucker > image.ppm
```
@@ -19,7 +19,7 @@ Now open `image.ppm` with your image viewer of choice.
## Try:
-```sh
+```
./try.sh
```
@@ -36,7 +36,7 @@ that distinguish binary and text.
### Alternate build:
-```sh
+```
make alt
```
@@ -68,7 +68,7 @@ This entry uses no local variables. None! At! All!
This program makes pretty pictures. To see the default output, try
running
-```sh
+```
./zucker > ioccc2011.ppm
```
@@ -82,7 +82,7 @@ Netpbm files, and are available on multiple platforms.
With macOS you can type at the command line:
-```sh
+```
open ioccc2021.ppm
```
@@ -90,7 +90,7 @@ and it will open image in the default application Preview.app.
To use ImageMagick you might do something like:
-```sh
+```
convert ioccc2011.ppm ioccc2011.png
```
@@ -98,7 +98,7 @@ and then open `ioccc2011.png` in your viewer of choice.
To use GraphicsMagick you might do something like:
-```sh
+```
gm convert ioccc2011.ppm ioccc2011.png
```
@@ -107,14 +107,14 @@ and then open `ioccc2011.png` in your viewer of choice.
Aside from the default image, you may create your own by running the
program as follows:
-```sh
+```
./zucker "your text" > image.ppm
```
To mitigate long runtime, the program can be invoked in a "preview"
mode by appending `-preview` to the command line arguments, like so:
-```sh
+```
./zucker faster\! -preview > image.ppm
```
diff --git a/2011/zucker/index.html b/2011/zucker/index.html
index 2adca8c1b..c6a87851f 100644
--- a/2011/zucker/index.html
+++ b/2011/zucker/index.html
@@ -141,14 +141,14 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version which should work for Windows which distinguishes
binary mode from text mode. See alternate code below.
To use:
-
./zucker> image.ppm
+
./zucker > image.ppm
Now open image.ppm with your image viewer of choice.
Try:
-
./try.sh
+
./try.sh
After running try.sh, open the PPM images ioccc.ppm, hello.ppm and
image2.ppm with your image viewer of choice.
Alternate code:
@@ -156,7 +156,7 @@ binary mode from text mode. See alternate code bel
binary mode on stdout which the author noted would be necessary for systems
that distinguish binary and text.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use zucker.alt as you would zucker above.
Alternate try:
@@ -170,7 +170,7 @@ The vector font is proportional.
What it does:
This program makes pretty pictures. To see the default output, try
running
-
./zucker> ioccc2011.ppm
+
./zucker > ioccc2011.ppm
On the author’s 2.5 GHz MacBook Pro, this command takes approximately 1 minute
and 18 seconds to run – your runtime may vary. You will need an image viewer
capable of displaying Netpbm images in
@@ -179,20 +179,20 @@ well; otherwise ImageMagick and/or
GraphicsMagick are both capable of displaying
Netpbm files, and are available on multiple platforms.
With macOS you can type at the command line:
-
open ioccc2021.ppm
+
open ioccc2021.ppm
and it will open image in the default application Preview.app.
To use ImageMagick you might do something like:
-
convert ioccc2011.ppm ioccc2011.png
+
convert ioccc2011.ppm ioccc2011.png
and then open ioccc2011.png in your viewer of choice.
To use GraphicsMagick you might do something like:
-
gm convert ioccc2011.ppm ioccc2011.png
+
gm convert ioccc2011.ppm ioccc2011.png
and then open ioccc2011.png in your viewer of choice.
Aside from the default image, you may create your own by running the
program as follows:
-
./zucker"your text"> image.ppm
+
./zucker "your text" > image.ppm
To mitigate long runtime, the program can be invoked in a “preview”
mode by appending -preview to the command line arguments, like so:
-
./zucker faster\!-preview> image.ppm
+
./zucker faster\! -preview > image.ppm
If your platform distinguishes between binary and text streams, you may need to
insert some code to reopen standard output in binary mode at the start of
main() (the provided alternate version will set binary mode
diff --git a/2012/blakely/README.md b/2012/blakely/README.md
index ab4f26ecc..d2cbcae27 100644
--- a/2012/blakely/README.md
+++ b/2012/blakely/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2012 blakely bugs](../../bugs.html#2012_blake
## To use:
-```sh
+```
./blakely "RPN formula" resolution > output.gif
```
## Try:
-```sh
+```
./try.sh
```
@@ -59,7 +59,7 @@ output to `stdout`.
The program should be run as:
-```sh
+```
./blakely xy* 32 > pic.gif
```
@@ -105,7 +105,7 @@ resolution of `ripple.gif`
to 250 took ~35 minutes to render on an [i7
processor](https://en.wikipedia.org/wiki/Intel_Core#Core_i7).
-```sh
+```
./blakely xy* 32 > saddle.gif
./blakely xx*yy*1++d5*ct/ 64 > ripple.gif
diff --git a/2012/blakely/index.html b/2012/blakely/index.html
index 350ebca77..16c3f074c 100644
--- a/2012/blakely/index.html
+++ b/2012/blakely/index.html
@@ -141,15 +141,15 @@ Location: GB - United Kingdom of Great
Several IOCCC themes (RPN
calculator, animated
@@ -169,7 +169,7 @@ resolution, and an animated GIF showing a fly-around of the resulting surface is
output to stdout.
Usage
The program should be run as:
-
./blakely xy* 32 > pic.gif
+
./blakely xy* 32 > pic.gif
where the first parameter is a
RPN expression, and the
second is the width of the required GIF, up
@@ -201,9 +201,9 @@ and more complex expressions take longer to compute. For example, increasing the
resolution of ripple.gif
to 250 took ~35 minutes to render on an i7
processor.
A generic root-finding algorithm to find the point of intersection between a ray
and the surface is done using a simple forward search from the eye. In order to
diff --git a/2012/deckmyn/README.md b/2012/deckmyn/README.md
index ca689c5c1..c8bb59a8f 100644
--- a/2012/deckmyn/README.md
+++ b/2012/deckmyn/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2012 deckmyn bugs](../../bugs.html#2012_deckm
## To use:
-```sh
+```
./deckmyn "$(cat deckmyn.c)" "$(cat musicfile.txt)" > sheetmusic.pbm
```
## Try:
-```sh
+```
./try.sh
```
@@ -59,13 +59,13 @@ You need the source code and example input (either one of the example files, or
manual input as below) ready and a program capable of showing [.pbm bitmap
format](https://en.wikipedia.org/wiki/Netpbm) images.
-```sh
+```
./deckmyn "`cat deckmyn.c`" "`cat example_greensleeves`" > greensleeves.pbm
```
If you have macOS you can open the image like:
-```sh
+```
open greensleeves.pbm
```
@@ -73,13 +73,13 @@ If you have macOS you can open the image like:
normally open an image.
-```sh
+```
./deckmyn "`cat deckmyn.c`" "KF m44c4 c4 g4 g4 : a4 a4 g2 :; " > short_bass.pbm
```
If you have macOS you can open the image like:
-```sh
+```
open short_bass.pbm
```
diff --git a/2012/deckmyn/deckmyn.html b/2012/deckmyn/deckmyn.html
index dec702532..6d918bcaf 100644
--- a/2012/deckmyn/deckmyn.html
+++ b/2012/deckmyn/deckmyn.html
@@ -124,7 +124,7 @@
This minimalistic music notator expects two command line arguments. The first is
the font description embedded in the source code. Notice that you don’t pass the
@@ -186,7 +186,7 @@ clef. "K" followed by any other letter will just default to a stand
Examples
Blank music paper (with G clef):
-
./deckmyn"`cat deckmyn.c`""sz sa x s1 x s1 x s1 x s1 x s1 "> blank.pbm
+
./deckmyn "`cat deckmyn.c`" "sz sa x s1 x s1 x s1 x s1 x s1 "> blank.pbm
With an F clef:
./deckmyn "`cat deckmyn.c`" "KF sz sa x s1 x s1 x s1 x s1 x s1 "> blank.pbm
Notice how only the first staff (or any staff) needs to have the full length.
diff --git a/2012/deckmyn/deckmyn.md b/2012/deckmyn/deckmyn.md
index d4abfc72c..aad09ef7c 100644
--- a/2012/deckmyn/deckmyn.md
+++ b/2012/deckmyn/deckmyn.md
@@ -3,7 +3,7 @@
## Calling the program
-```sh
+```
./deckmyn "`cat deckmyn.c`" "`cat musicfile`" > output.pbm
```
@@ -85,7 +85,7 @@ musical element of a line is only 2 characters!
Blank music paper (with G clef):
-```sh
+```
./deckmyn "`cat deckmyn.c`" "sz sa x s1 x s1 x s1 x s1 x s1 "> blank.pbm
```
diff --git a/2012/deckmyn/index.html b/2012/deckmyn/index.html
index 365b7d385..fefe82e17 100644
--- a/2012/deckmyn/index.html
+++ b/2012/deckmyn/index.html
@@ -141,15 +141,15 @@ Location: BE - Kingdom of Belgium
The C of this entry is definitely sharp. The program cleverly uses its own
source at runtime to define the notes, time signature and accidental bitmaps.
@@ -168,14 +168,14 @@ is not done in the author’s remarks, however.
You need the source code and example input (either one of the example files, or
manual input as below) ready and a program capable of showing .pbm bitmap
format images.
… otherwise, you’ll have to open it in your viewer of choice how you would
normally open an image.
Description
diff --git a/2012/dlowe/README.md b/2012/dlowe/README.md
index 11db8ad08..e43821d11 100644
--- a/2012/dlowe/README.md
+++ b/2012/dlowe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2012 dlowe bugs](../../bugs.html#2012_dlowe).
## To use:
-```sh
+```
./dlowe
```
## Try:
-```sh
+```
./dlowe
```
diff --git a/2012/dlowe/index.html b/2012/dlowe/index.html
index 5acb40183..ee710ddb1 100644
--- a/2012/dlowe/index.html
+++ b/2012/dlowe/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
Watch for a while if you like, then press a key within the window.
Use up and down keys to escape death.
Judges’ remarks:
diff --git a/2012/endoh1/README.md b/2012/endoh1/README.md
index e04f7c43b..5c293ad15 100644
--- a/2012/endoh1/README.md
+++ b/2012/endoh1/README.md
@@ -1,5 +1,5 @@
-```sh
+```
make
```
@@ -14,7 +14,7 @@ section below for more details.
## To use:
-```sh
+```
./endoh1 < file
```
@@ -25,7 +25,7 @@ see what this looks like not going so fast then you might wish to try the
## Try:
-```sh
+```
./try.bw.sh endoh1.c
./try.sh endoh1.c
@@ -50,7 +50,7 @@ the fluid and change the behaviour of the fluid. The file
For the default values, try:
-```sh
+```
make alt
```
@@ -59,13 +59,13 @@ one can more easily go through the list of files to see them all in succession,
for fun. That is controlled by the variable `TIMER` at compilation.
For instance if you wish to change the value to 5:
-```sh
+```
make clobber TIMER=5 alt
```
If you want to disable the alarm time, set it to 0:
-```sh
+```
make clobber TIMER=0 alt
```
@@ -76,7 +76,7 @@ see and to not flash too quickly. The code protects against a value < 0 and
defaults to 12321 but you can change it to. For instance to slow it down you
could increase the sleep time from `12321` to `50000`:
-```sh
+```
make clobber SLEEP=50000 alt
```
@@ -84,7 +84,7 @@ could increase the sleep time from `12321` to `50000`:
If you wish to speed it up you might decrease the sleep time from `12321` to
`9999`:
-```sh
+```
make clobber SLEEP=9999 alt
```
@@ -97,7 +97,7 @@ viscosity factor, you should redefine the values `GRAVITY`, `PRESSURE` and/or
`VISCOSITY` macros, respectively. For instance if you wish to change the
viscosity and pressure factors but leave the other values alone:
-```sh
+```
make clobber VISCOSITY=X PRESSURE=Y alt
```
@@ -111,13 +111,13 @@ You might also wish to try redefining the macros `G`, `P` and/or `V`. For
instance:
-```sh
+```
make clobber GRAVITY=5 PRESSURE=5 VISCOSITY=5 alt
```
You might try even:
-```sh
+```
make clobber GRAVITY=I alt
```
@@ -141,7 +141,7 @@ and `endoh1_color` above.
To see two different ways run on the source file and each of the text files,
try:
-```sh
+```
./try.alt.sh
```
@@ -149,7 +149,7 @@ The second run of each will be with the gravity factor set to `I`.
To see the same thing but in the original uncoloured version, try:
-```sh
+```
./try.alt.bw.sh
```
@@ -178,7 +178,7 @@ entry](https://web.archive.org/web/20230711134609/https://whatif.xkcd.com/6/).
**DO NOT FORGET** `-DG=1 -DP=4 -DV=8` and make your terminal window larger
than 80 x 25.
-```sh
+```
cc endoh1.c -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -o endoh1 -lm
./endoh1 < endoh1.c
./endoh1 < logo.txt
@@ -246,7 +246,7 @@ to build with no warning. Under these conditions, it should be portable.
At least, recent compilers with `-std=c99 -Wall -W -Wextra -pedantic` say
nothing.
-```sh
+```
gcc -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.c
clang -DG=1 -DP=4 -DV=8 -D_BSD_SOURCE -std=c99 -Wall -W -Wextra -pedantic endoh1.c
diff --git a/2012/endoh1/index.html b/2012/endoh1/index.html
index 593e4ac9e..00248180a 100644
--- a/2012/endoh1/index.html
+++ b/2012/endoh1/index.html
@@ -140,7 +140,7 @@ Location: JP - Japan
-
make
+
make
There are two alt versions that let you control the compile time variables that
control the fluid behaviour and the added variables to speed up or slow down the
fluid as well as setting a timeout (if not 0): one for the original black and
@@ -149,19 +149,19 @@ judges at the time of the contest). Another version is the deobfuscated version
provided by the author as well. See the Alternate code
section below for more details.
To use:
-
./endoh1< file
+
./endoh1 < file
WARNING: if you’re sensitive to/don’t like flashing colours/text or just want to
see what this looks like not going so fast then you might wish to try the
Alternate code instead.
The files endoh1.alt.c and
endoh1_color.alt.c correspond to endoh1.c and
@@ -170,39 +170,39 @@ the fluid and change the behaviour of the fluid. The file
endoh1.alt2.c is deobfuscated and was provided by the author.
Alternate build:
For the default values, try:
-
make alt
+
make alt
In the alt versions a default time of 10 seconds is set as an alarm so that
one can more easily go through the list of files to see them all in succession,
for fun. That is controlled by the variable TIMER at compilation.
For instance if you wish to change the value to 5:
-
make clobber TIMER=5 alt
+
make clobber TIMER=5 alt
If you want to disable the alarm time, set it to 0:
-
make clobber TIMER=0 alt
+
make clobber TIMER=0 alt
It cannot be < 0 or > 60 (arbitrarily selected).
The SLEEP variable is to delay the time between updates to make it easier to
see and to not flash too quickly. The code protects against a value < 0 and
defaults to 12321 but you can change it to. For instance to slow it down you
could increase the sleep time from 12321 to 50000:
-
make clobber SLEEP=50000 alt
+
make clobber SLEEP=50000 alt
If you wish to speed it up you might decrease the sleep time from 12321 to
9999:
-
make clobber SLEEP=9999 alt
+
make clobber SLEEP=9999 alt
WARNING: the lower the value the faster it will flash so be careful if you’re
sensitive to this.
If you wish to change the gravity factor, pressure factor and/or
viscosity factor, you should redefine the values GRAVITY, PRESSURE and/or
VISCOSITY macros, respectively. For instance if you wish to change the
viscosity and pressure factors but leave the other values alone:
-
make clobber VISCOSITY=X PRESSURE=Y alt
+
make clobber VISCOSITY=X PRESSURE=Y alt
where X and Y are numbers or the letter I and which are, respectively, the
viscosity and pressure factors. There is no attempt to check the value or type
because doing so prevents the macros from being defined to I which would
prevent the author’s remarks about it from being done.
You might also wish to try redefining the macros G, P and/or V. For
instance:
-
make clobber GRAVITY=5 PRESSURE=5 VISCOSITY=5 alt
+
make clobber GRAVITY=5 PRESSURE=5 VISCOSITY=5 alt
You might try even:
-
make clobber GRAVITY=I alt
+
make clobber GRAVITY=I alt
See the author’s remarks for details on these macros where:
G = GRAVITY
P = PRESSURE
@@ -213,10 +213,10 @@ and endoh1_color above.
Alternate try:
To see two different ways run on the source file and each of the text files,
try:
-
./try.alt.sh
+
./try.alt.sh
The second run of each will be with the gravity factor set to I.
To see the same thing but in the original uncoloured version, try:
,___. ,. ,. ,. ,___. ,. ,. ,.
|/--' || `' || |/--' `' || |\_.
@@ -284,9 +284,9 @@ comments. It also uses usleep(3), which may require -D_BSD_SO
to build with no warning. Under these conditions, it should be portable.
At least, recent compilers with -std=c99 -Wall -W -Wextra -pedantic say
nothing.
-
warning, it requires two C99 features: allow string literal to be more than 509
characters and not requiring a return in main(). In fact, recent compilers
with -std=c99 -Wall -W -Wextra -pedantic would say nothing.
-
You can do make everything for the process (with no cat).
Note: The executable may return a failure (non-zero) exit status
unless -std=c99 option is given.
diff --git a/2012/grothe/README.md b/2012/grothe/README.md
index 2c570f5f3..ed8e02736 100644
--- a/2012/grothe/README.md
+++ b/2012/grothe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -9,7 +9,7 @@
To create a shared secret shared among `M` people with `N+1` needed to reconstruct:
-```sh
+```
./grothe -secret 1-/dev/urandom 2-/dev/urandom ... \
N-/dev/urandom 1+shared1 2+shared2 ... M+sharedM
```
@@ -17,14 +17,14 @@ To create a shared secret shared among `M` people with `N+1` needed to reconstru
To reconstruct the original (an arbitrary combination of `N+1` or
more shared files with their proper numbers):
-```sh
+```
./grothe I-sharedI J-sharedJ K-sharedK ... +reconstructed
```
## Try:
-```sh
+```
./try.sh
```
@@ -75,7 +75,7 @@ To share a secret. For example:
To split a secret into 4 pieces of which at least 3 will be needed to get it (in
this case the cookie recipe) back:
-```sh
+```
./grothe \
-cookie_recipe.txt\
1-/dev/urandom 2-/dev/urandom\
@@ -84,7 +84,7 @@ this case the cookie recipe) back:
To put the recipe back together using the first, second and fourth pieces:
-```sh
+```
./grothe \
1-cookie_piece1.dat 2-cookie_piece2.dat 4-cookie_piece4.dat
+cookie_recipe_restore.txt
diff --git a/2012/grothe/index.html b/2012/grothe/index.html
index 25c9864fb..f7c2c2d66 100644
--- a/2012/grothe/index.html
+++ b/2012/grothe/index.html
@@ -144,16 +144,16 @@ Location: FR - French Republic (
To build:
-
make
+
make
To use:
To create a shared secret shared among M people with N+1 needed to reconstruct:
Also known as ‘Best abuse of the judging process’.
The IOCCC 2012 submission page didn’t enforce the 2048 meaningful character
@@ -184,14 +184,14 @@ into 3 parts and require two of them be available to extract the original recipe
Example usage
To split a secret into 4 pieces of which at least 3 will be needed to get it (in
this case the cookie recipe) back:
The program is limited to 256 input and output files and will slow down
dramatically when you get past 20-50 inputs and outputs.
diff --git a/2012/hamano/README.md b/2012/hamano/README.md
index eb2504327..c1a283eae 100644
--- a/2012/hamano/README.md
+++ b/2012/hamano/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./hamano < textfile > output.pdf
```
## Try:
-```sh
+```
./try.sh
```
@@ -30,7 +30,7 @@ README.md!
That procedure looks like:
-```sh
+```
./hamano < README.md > hint.pdf
cc -xc hint.pdf -o hint
./hint
@@ -40,7 +40,7 @@ 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
+```
echo 'int main(){puts("Hello World!");}' | ./hamano > hello.pdf
cc -xc hello.pdf -o hello
./hello | cc -Wno-implicit-function-declaration -xc - -o ./hello2
diff --git a/2012/hamano/index.html b/2012/hamano/index.html
index 2f24a4c77..411e2181f 100644
--- a/2012/hamano/index.html
+++ b/2012/hamano/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./hamano< textfile > output.pdf
+
./hamano < textfile > output.pdf
Try:
-
./try.sh
+
./try.sh
The script will generate a number of PDF files and it will suggest you look at
them as well. You can read hint.pdf with a PDF reader like acroread hint.pdf
or evince hint.pdf. With macOS you can do open hint.pdf which by default
@@ -155,17 +155,17 @@ directly instead.
the PDF file will then be compiled as C (itself!) and executed so that it shows
README.md!
That procedure looks like:
-
./hamano< README.md > hint.pdf
-cc-xc hint.pdf -o hint
-./hint
+
./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:
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:
diff --git a/2012/hou/README.md b/2012/hou/README.md
index 4e6394a86..19e567c29 100644
--- a/2012/hou/README.md
+++ b/2012/hou/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./hou syntax-file file-to-process
```
## Try:
-```sh
+```
./try.sh
```
@@ -80,7 +80,7 @@ The following regular expression operators are supported:
For example, one can use the following expression to match a certain declaration
statement in [hou.c](hou.c):
-```re
+```
"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;
```
@@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point,
hang for the competing Perl engine while matching itself. Try to compare these
two engines:
-```sh
+```
./hou ansi.txt ansi.txt
perl patho.pl < ansi.txt
```
diff --git a/2012/hou/hint.html b/2012/hou/hint.html
index 55e16949f..5a7b599f2 100644
--- a/2012/hou/hint.html
+++ b/2012/hou/hint.html
@@ -124,9 +124,9 @@
Judges’ comments:
To build:
-
make hou
+
make hou
To run:
-
./hou syntax-file file-to-process
+
./hou syntax-file file-to-process
Try (Unix):
The results are best viewed in a 80x25 console with ANSI colors.
less hou.c
@@ -170,12 +170,12 @@ in the regular expression by escaping it with [] or ““.
The following regular expression operators are supported:
() [] * + ? | ""
For example, one can use the following expression to match a certain declaration statement in hou.c:
The regex engine is also algorithmically efficient. To illustrate the point,
ansi.txt contains a pathological expression [2] that guarantees a hang for the
competing Perl engine while matching itself. Try to compare these two engines:
The only escape sequence supported is and it doesn’t work in [].
diff --git a/2012/hou/hint.md b/2012/hou/hint.md
index 7fb416b18..64124bc35 100644
--- a/2012/hou/hint.md
+++ b/2012/hou/hint.md
@@ -2,13 +2,13 @@
### To build:
-```sh
+```
make hou
```
### To run:
-```sh
+```
./hou syntax-file file-to-process
```
@@ -81,7 +81,7 @@ The following regular expression operators are supported:
For example, one can use the following expression to match a certain declaration statement in hou.c:
-```c
+```
"char"[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*(,[ *]*[a-zA-Z_][0-9a-zA-Z_]*[ ]*((=[0-9a-zA-Z_ ]+)|(\[[0-9a-zA-Z_ ]*\]))?[ ]*)*;
```
@@ -89,7 +89,7 @@ The regex engine is also algorithmically efficient. To illustrate the point,
ansi.txt contains a pathological expression [2] that guarantees a hang for the
competing Perl engine while matching itself. Try to compare these two engines:
-```sh
+```
./hou ansi.txt ansi.txt
perl patho.pl < ansi.txt
```
diff --git a/2012/hou/index.html b/2012/hou/index.html
index 00ba9ac2c..ba46b41f6 100644
--- a/2012/hou/index.html
+++ b/2012/hou/index.html
@@ -141,11 +141,11 @@ Location: CN - People’s Republic of C
To build:
-
make
+
make
To use:
-
./hou syntax-file file-to-process
+
./hou syntax-file file-to-process
Try:
-
./try.sh
+
./try.sh
View the remarks.htm file in your web browser.
The result is best viewed in a 80x25 console with ANSI colors.
Try (Windows):
@@ -183,13 +183,13 @@ in the regular expression by escaping it with [] or ""
() [] * + ? | ""
For example, one can use the following expression to match a certain declaration
statement in hou.c:
The regex engine is also algorithmically efficient. To illustrate the point,
ansi.txt contains a pathological expression 1 that guarantees a
hang for the competing Perl engine while matching itself. Try to compare these
two engines:
diff --git a/2012/kang/README.md b/2012/kang/README.md
index 44bf535ce..708428292 100644
--- a/2012/kang/README.md
+++ b/2012/kang/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ See [Alternate code](#alternate-code) below for the (fun) rationale here.
## To use:
-```sh
+```
echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang
```
## Try:
-```sh
+```
./try.sh # try various languages
./en.sh # English 0 through 13
@@ -43,14 +43,14 @@ subtlety of this entry even more.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang.alt
echo vier | ./kang.alt
@@ -61,7 +61,7 @@ subtlety of this entry even more.
### Alternate try:
-```sh
+```
./try.alt.sh # try various languages
./en.alt.sh # English 0 through 13
@@ -88,13 +88,13 @@ We've added a linefeed to the print format for convenience.
Can you explain why:
-```sh
+```
echo f hundr|./kang
```
correctly reports 500 but:
-```sh
+```
echo hundr|./kang
```
diff --git a/2012/kang/index.html b/2012/kang/index.html
index 67dbb256f..e50d09433 100644
--- a/2012/kang/index.html
+++ b/2012/kang/index.html
@@ -141,17 +141,17 @@ Location: KR - Republic of Korea (
To build:
-
make
+
make
There is alternate code which fixes some German at the expense of other German.
See Alternate code below for the (fun) rationale here.
To use:
-
echo"full spelling of an English cardinal numeral less than a quadrillion"|./kang
+
echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang
Try:
-
./try.sh# try various languages
-
-./en.sh# English 0 through 13
-
-./de.sh# German 0 through 13 with both umlauts and without (additional 'e')
+
./try.sh # try various languages
+
+ ./en.sh # English 0 through 13
+
+ ./de.sh # German 0 through 13 with both umlauts and without (additional 'e')
How does it have no u or o in a string in the source code and yet it gets
uno right?
Alternate code:
@@ -164,19 +164,19 @@ deal with it :-) It also breaks other words too and this happens only for one
letter change. With this one should hopefully be able to really appreciate the
subtlety of this entry even more.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
echo"full spelling of an English cardinal numeral less than a quadrillion"|./kang.alt
-
-echo vier |./kang.alt
-
-echo uno |./kang.alt
+
echo "full spelling of an English cardinal numeral less than a quadrillion" | ./kang.alt
+
+ echo vier | ./kang.alt
+
+ echo uno | ./kang.alt
Alternate try:
-
./try.alt.sh# try various languages
-
-./en.alt.sh# English 0 through 13
-
-./de.alt.sh# German 0 through 13 with both umlauts and without (additional 'e')
+
./try.alt.sh # try various languages
+
+ ./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
original entry without the change of f to v?
Finally why does it get wrong what it gets wrong?
@@ -188,9 +188,9 @@ German, Italian, Russian, and Spanish numerals.
colloquial year numbers of the last millennium.
We’ve added a linefeed to the print format for convenience.
Can you explain why:
-
echo f hundr|./kang
+
echo f hundr|./kang
correctly reports 500 but:
-
echo hundr|./kang
+
echo hundr|./kang
does not report 100, instead printing 0?
Author’s remarks:
Synopsis
diff --git a/2012/konno/README.md b/2012/konno/README.md
index 26e23b138..e5e962e3f 100644
--- a/2012/konno/README.md
+++ b/2012/konno/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./konno N
```
## Try:
-```sh
+```
./try.sh
# you can also specify numbers to try before the random and preselected ones:
@@ -36,7 +36,7 @@ This alternate code is an unobfuscated version of the winning code.
### Alternate build:
-```sh
+```
make alt
```
@@ -64,7 +64,7 @@ patterns.
Try:
-```sh
+```
./konno 30
./konno 90
./konno 102
@@ -79,13 +79,13 @@ There are 256 (from 0 through 255) possible rules.
This program uses bit operations. I think
-```c
+```
7&O<>!o+29
```
is an interesting operation. This isn't equal to
-```c
+```
7&O>>29
```
diff --git a/2012/konno/index.html b/2012/konno/index.html
index a99b7b092..8ee6dfef5 100644
--- a/2012/konno/index.html
+++ b/2012/konno/index.html
@@ -141,23 +141,23 @@ Location: JP - Japan
To build:
-
make
+
make
There is an unobfuscated version of this entry. See Alternate
code below.
To use:
-
./konno N
+
./konno N
Try:
-
./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.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 a number of times as the first part randomly
selects ten numbers to try.
Alternate code:
An alternate version of this entry, konno.alt.c, is provided.
This alternate code is an unobfuscated version of the winning code.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use konno.alt as you would konno above.
Judges’ remarks:
@@ -170,17 +170,17 @@ This alternate code is an unobfuscated version of the winning code.
automaton
patterns.
There are 256 (from 0 through 255) possible rules.
Obfuscation
This program uses bit operations. I think
-
7&O<<!o>>!o+29
+
7&O<<!o>>!o+29
is an interesting operation. This isn’t equal to
-
7&O>>29
+
7&O>>29
operation. What is the operation doing?
Limitation
This program assumes that the size of int is 4.
diff --git a/2012/omoikane/README.md b/2012/omoikane/README.md
index c1c427f9a..50820868c 100644
--- a/2012/omoikane/README.md
+++ b/2012/omoikane/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -12,7 +12,7 @@ theoretically work with Windows which distinguishes binary and text. See
## To use:
-```sh
+```
./nyaruko [seed.txt] < original.bin > output.c
bash output.c > key.c
perl output.c > data.c
@@ -30,7 +30,7 @@ binary itself.
## Try:
-```sh
+```
./try.sh
```
@@ -53,13 +53,13 @@ binary mode on `stdin` and `stdout`.
For the first version:
-```sh
+```
make alt
```
For the second version:
-```sh
+```
make alt2
```
@@ -73,7 +73,7 @@ Use `nyaruko.alt` or `nyaruko.alt2` as you would `nyaruko` above.
For the first alternate version:
-```sh
+```
./try.alt.sh
```
@@ -93,7 +93,7 @@ The judges have nothing to add that has not already been written about in the
`Nyaruko` is a binary to text filter. Given some input on `stdin`,
`Nyaruko` will produce C code that reproduces this input on `stdout`:
-```sh
+```
./nyaruko < original.bin > output.c
gcc output.c -o output
./output > regenerated.bin
@@ -102,7 +102,7 @@ The judges have nothing to add that has not already been written about in the
Output is encrypted, but both key and data are included in the output.
To separate the key from the data, run these commands:
-```sh
+```
bash output.c > key.c
perl output.c > data.c
```
@@ -114,7 +114,7 @@ why the code is formatted the way it is.
To combine the key and data, concatenate them together in either
order:
-```sh
+```
cat key.c data.c > output.c
cat data.c key.c > output.c
```
@@ -123,7 +123,7 @@ By default, `Nyaruko` generates a unique random key for every message,
using `/dev/urandom` as the seed. If given an extra command line
argument, `Nyaruko` will seed using that file instead of `/dev/urandom`:
-```sh
+```
./nyaruko seed.txt < input.bin > output.c
```
diff --git a/2012/omoikane/index.html b/2012/omoikane/index.html
index 09df3b63e..9a37122da 100644
--- a/2012/omoikane/index.html
+++ b/2012/omoikane/index.html
@@ -141,25 +141,25 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version that will read from the compiled file itself, in
case you don’t have a /dev/urandom file. There is also a version that should
theoretically work with Windows which distinguishes binary and text. See
alternate code below.
NOTE: if your OS does not have /dev/urandom then you should specify a seed
file or use the alternate version which reads in the compiled
binary itself.
Try:
-
./try.sh
+
./try.sh
The script try.sh will check if you have perl before trying to use the
perl parts of the script.
Alternate code:
@@ -171,14 +171,14 @@ is like the first except it also should theoretically work with Windows, setting
binary mode on stdin and stdout.
Alternate build:
For the first version:
-
make alt
+
make alt
For the second version:
-
make alt2
+
make alt2
Alternate use:
Use nyaruko.alt or nyaruko.alt2 as you would nyaruko above.
Alternate try:
For the first alternate version:
-
./try.alt.sh
+
./try.alt.sh
We have no way to test the second version, sorry (tm Canada :-) )!
Judges’ remarks:
The judges have nothing to add that has not already been written about in the
@@ -187,24 +187,24 @@ binary mode on stdin and stdout.
Usage
Nyaruko is a binary to text filter. Given some input on stdin,
Nyaruko will produce C code that reproduces this input on stdout:
Output is encrypted, but both key and data are included in the output.
To separate the key from the data, run these commands:
-
bash output.c > key.c
-perl output.c > data.c
+
bash output.c > key.c
+ perl output.c > data.c
The key-less data.c still compiles, but produces a different message
on stdout instead of the original input. This message is a hint to
why the code is formatted the way it is.
To combine the key and data, concatenate them together in either
order:
By default, Nyaruko generates a unique random key for every message,
using /dev/urandom as the seed. If given an extra command line
argument, Nyaruko will seed using that file instead of /dev/urandom:
-
./nyaruko seed.txt < input.bin > output.c
+
./nyaruko seed.txt < input.bin > output.c
This makes the output key deterministic, allowing the same key to be shared
across different files. On operating systems that do not have /dev/urandom,
users should always specify this extra seed argument to avoid indeterministic
diff --git a/2012/tromp/README.md b/2012/tromp/README.md
index 56362ffbe..e14d41860 100644
--- a/2012/tromp/README.md
+++ b/2012/tromp/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all # On a 64-bit machine (default)
make tromp32 # On a 32-bit machine
@@ -20,7 +20,7 @@ For more detailed information see [2012 tromp bugs](../../bugs.html#2012_tromp).
## To use:
-```sh
+```
./tromp [-b]
```
@@ -29,7 +29,7 @@ Use `./tromp32` as you would `./tromp` if on a 32-bit machine.
## To use:
-```sh
+```
cat ascii-prog.blc data | ./tromp -b
cat binary-prog.Blc data | ./tromp
```
@@ -37,7 +37,7 @@ Use `./tromp32` as you would `./tromp` if on a 32-bit machine.
## Try:
-```sh
+```
./try.sh
```
@@ -113,7 +113,7 @@ identity function. When its encoding `0010` is fed into the universal machine,
it will simply copy the input to the output (well, not that simply, since each
byte is smashed to bits and rebuilt from scratch). Voila: a half byte cat:
-```sh
+```
$ echo " Hello, world" | ./tromp
Hello, world
```
@@ -122,7 +122,7 @@ Since the least significant 4 bits of the first byte are just arbitrary padding
that is ignored by the program, any character from ASCII 32 (space) through 47
(`/`) will do, e.g.:
-```sh
+```
$ echo "*Hello, world" | ./tromp
Hello, world
```
@@ -134,7 +134,7 @@ If the input doesn't start with a valid program, that is,
if the interpreter reaches end-of-file during program parsing,
it will crash in some way. E.g. the following might dump core:
-```sh
+```
echo -n "U" | ./tromp
```
@@ -143,7 +143,7 @@ closed, that is, variable `n` can only appear within at least `n` enclosing
lambdas. For instance, here the term `\ 5` is not closed, causing the
interpreter to crash when looking into a null-pointer environment:
-```sh
+```
echo ">Hello, world" | ./tromp
```
@@ -200,7 +200,7 @@ The byte oriented BLC8 version weighs in at 43 bytes (shown in hexadecimal).
```
-```sh
+```
$ (cat uni8.Blc; echo " Ni hao") | ./tromp
Ni hao
```
@@ -225,7 +225,7 @@ Even shorter than the self-interpreter is this prime number sieve in 167 bits
The `n`th bit in the output indicates whether n is prime:
-```sh
+```
$ cat primes.blc | ./tromp -b | head -c 70
0011010100010100010100010000010100000100010100010000010000010100000100
```
@@ -265,7 +265,7 @@ The program `hilbert.Blc`, at 143 bytes, is a very twisty "one-liner" (shown in
It expects `n` arbitrary characters of input, and draws a space filling [Hilbert
curve](https://en.wikipedia.org/wiki/Hilbert_curve) of order `n`:
-```sh
+```
$ (cat hilbert.Blc; echo -n "1") | ./tromp
_
| |
@@ -344,7 +344,7 @@ Writing BLC programs can be made slightly less painful with this parser that
translates single-letter-variable lambda calculus into BLC:
-```sh
+```
$ echo "\f\x f (f (f x))" > three
$ cat parse.Blc three | ./tromp
000001110011100111010
@@ -358,21 +358,21 @@ into BLC8:
So we could assemble an input reversing program as
-```sh
+```
echo "\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c)" > reverse
cat parse.Blc reverse | ./tromp > reverse.blc
```
and change it to BLC8 with
-```sh
+```
$ cat deflate.Blc reverse.blc | ./tromp > rev.Blc
$ wc rev.Blc
0 1 9 rev.Blc
```
and then try it out with:
-```sh
+```
$ cat rev.Blc - | ./tromp
Hello, world!
^D
@@ -384,7 +384,7 @@ and then try it out with:
BLC8 program `symbolic.Blc` shows individual reduction steps on symbolic lambda terms.
Here it is used to show the calculation of 2^3 in Church numerals:
-```sh
+```
$ echo "(\f\x f (f (f x))) (\f\x f (f x))" > threetwo
$ cat parse.Blc threetwo | ./tromp > threetwo.blc
$ cat symbolic.Blc threetwo.blc | ./tromp
@@ -412,7 +412,7 @@ Taking only the first line of output gives us a sort of BLC disassembler, an
exact inverse of the above assembler. The prime number sieve disassembles as
follows:
-```sh
+```
$ cat symbolic.Blc primes.blc | ./tromp | head -1
\a (\b b (b ((\c c c) (\c \d \e e (\f \g g) ((\f c c f ((\g g g) (\g f (g g)))) (\f \g \h \i i g (h (d f))))) (\c \d \e b (e c))))) (\b \c c (\d \e d) b)
```
@@ -421,7 +421,7 @@ Hardly any less obfuscated...
The last line of
-```sh
+```
cat symbolic.Blc primes.blc | ./tromp | head -16
```
@@ -459,7 +459,7 @@ under the interpreter perform much worse than that same program written in Haske
Our interpreter copes well with extra levels of interpretation:
-```sh
+```
$ time cat primes.blc | ./tromp -b | head -c 210 > /dev/null
real 0m0.043s
$ time cat uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
diff --git a/2012/tromp/index.html b/2012/tromp/index.html
index 4303c1a0b..a8870d1cc 100644
--- a/2012/tromp/index.html
+++ b/2012/tromp/index.html
@@ -141,21 +141,21 @@ Location: US - United States of America
To build:
-
make all # On a 64-bit machine (default)
-
-make tromp32 # On a 32-bit machine
+
make all # On a 64-bit machine (default)
+
+ make tromp32 # On a 32-bit machine
Use ./tromp32 as you would ./tromp if on a 32-bit machine.
To use:
-
cat ascii-prog.blc data |./tromp-b
-cat binary-prog.Blc data |./tromp
+
cat ascii-prog.blc data | ./tromp -b
+ cat binary-prog.Blc data | ./tromp
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
The judges dare to say that the data files this entry is processing
are more obfuscated than the entry itself.
@@ -206,23 +206,23 @@ notation) which is the
identity function. When its encoding 0010 is fed into the universal machine,
it will simply copy the input to the output (well, not that simply, since each
byte is smashed to bits and rebuilt from scratch). Voila: a half byte cat:
-
$ echo " Hello, world"|./tromp
-Hello, world
+
$ echo " Hello, world" | ./tromp
+ Hello, world
Since the least significant 4 bits of the first byte are just arbitrary padding
that is ignored by the program, any character from ASCII 32 (space) through 47
(/) will do, e.g.:
-
$ echo "*Hello, world"|./tromp
-Hello, world
+
$ echo "*Hello, world" | ./tromp
+ Hello, world
Bad programs
If the input doesn’t start with a valid program, that is,
if the interpreter reaches end-of-file during program parsing,
it will crash in some way. E.g. the following might dump core:
-
echo-n"U"|./tromp
+
echo -n "U" | ./tromp
Furthermore, the interpreter requires the initial encoded lambda term to be
closed, that is, variable n can only appear within at least n enclosing
lambdas. For instance, here the term \ 5 is not closed, causing the
interpreter to crash when looking into a null-pointer environment:
-
echo">Hello, world"|./tromp
+
echo ">Hello, world" | ./tromp
will likely dump core.
Since these properties can be checked when creating
BLC programs,
@@ -265,8 +265,8 @@ as a self interpreter in BLC it is downright minuscule at 232 bits (29 bytes):
0b7fb 00cf6
7bb03 91a1a
-
$(cat uni8.Blc;echo" Ni hao")|./tromp
-Ni hao
+
$ (cat uni8.Blc; echo " Ni hao") | ./tromp
+ Ni hao
A prime number sieve
Even shorter than the self-interpreter is this prime number sieve in 167 bits
(under 21 bytes):
@@ -281,8 +281,8 @@ as a self interpreter in BLC it is downright minuscule at 232 bits (29 bytes):
0000110110
The nth bit in the output indicates whether n is prime:
For those who prefer to digest their primes in decimal, there is oddindices.Blc,
which will print the indices of all odd characters (with
LSB = 1)
@@ -308,43 +308,43 @@ separated by a given character:
60 8191a00167fb cbcfdf65f7c0 a20
It expects n arbitrary characters of input, and draws a space filling Hilbert
curve of order n:
The smallest known BF interpreter is written in… you guessed it,
BLC,
@@ -370,56 +370,56 @@ followed by a ], followed by the input for the Brainfuck program.
A BLC assembler
Writing BLC programs can be made slightly less painful with this parser that
translates single-letter-variable lambda calculus into BLC:
-
$ echo "\f\x f (f (f x))"> three
-$ cat parse.Blc three |./tromp
-000001110011100111010
+
$ echo "\f\x f (f (f x))" > three
+ $ cat parse.Blc three | ./tromp
+ 000001110011100111010
Converting between bits and bytes
The program inflate.Blc and its inverse deflate.Blc allow us to translate between
BLC and BLC8. If you assemble a byte oriented program, you’ll need to compact it
into BLC8:
So we could assemble an input reversing program as
-
echo"\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c)"> reverse
-cat parse.Blc reverse |./tromp> reverse.blc
+
echo "\a a ((\b b b) (\b \c \d \e d (b b) (\f f c e))) (\b \c c)" > reverse
+ cat parse.Blc reverse | ./tromp > reverse.blc
BLC8 program symbolic.Blc shows individual reduction steps on symbolic lambda terms.
Here it is used to show the calculation of 2^3 in Church numerals:
-
$ echo "(\f\x f (f (f x))) (\f\x f (f x))"> threetwo
-$ cat parse.Blc threetwo |./tromp> threetwo.blc
-$ cat symbolic.Blc threetwo.blc |./tromp
-(\a\b a (a(a b)))(\a\b a (a b))
-\a(\b\c b (b c))((\b\c b (b c))((\b\c b (b c))a))
-\a\b(\c\d c (c d))((\c\d c (c d))a)((\c\d c (c d))((\c\d c (c d))a)b)
-\a\b(\c(\d\e d (d e))a((\d\e d (d e))a c))((\c\d c (c d))((\c\d c (c d))a)b)
-\a\b(\c\d c (c d))a((\c\d c (c d))a((\c\d c (c d))((\c\d c (c d))a)b))
-\a\b(\c a (a c))((\c\d c (c d))a((\c\d c (c d))((\c\d c (c d))a)b))
-\a\b a (a((\c\d c (c d))a((\c\d c (c d))((\c\d c (c d))a)b)))
-\a\b a (a((\c a (a c))((\c\d c (c d))((\c\d c (c d))a)b)))
-\a\b a (a(a(a((\c\d c (c d))((\c\d c (c d))a)b))))
-\a\b a (a(a(a((\c(\d\e d (d e))a((\d\e d (d e))a c))b))))
-\a\b a (a(a(a((\c\d c (c d))a((\c\d c (c d))a b)))))
-\a\b a (a(a(a((\c a (a c))((\c\d c (c d))a b)))))
-\a\b a (a(a(a(a(a((\c\d c (c d))a b))))))
-\a\b a (a(a(a(a(a((\c a (a c))b))))))
-\a\b a (a(a(a(a(a(a(a b)))))))
+
$ echo "(\f\x f (f (f x))) (\f\x f (f x))" > threetwo
+ $ cat parse.Blc threetwo | ./tromp > threetwo.blc
+ $ cat symbolic.Blc threetwo.blc | ./tromp
+ (\a \b a (a (a b))) (\a \b a (a b))
+ \a (\b \c b (b c)) ((\b \c b (b c)) ((\b \c b (b c)) a))
+ \a \b (\c \d c (c d)) ((\c \d c (c d)) a) ((\c \d c (c d)) ((\c \d c (c d)) a) b)
+ \a \b (\c (\d \e d (d e)) a ((\d \e d (d e)) a c)) ((\c \d c (c d)) ((\c \d c (c d)) a) b)
+ \a \b (\c \d c (c d)) a ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b))
+ \a \b (\c a (a c)) ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b))
+ \a \b a (a ((\c \d c (c d)) a ((\c \d c (c d)) ((\c \d c (c d)) a) b)))
+ \a \b a (a ((\c a (a c)) ((\c \d c (c d)) ((\c \d c (c d)) a) b)))
+ \a \b a (a (a (a ((\c \d c (c d)) ((\c \d c (c d)) a) b))))
+ \a \b a (a (a (a ((\c (\d \e d (d e)) a ((\d \e d (d e)) a c)) b))))
+ \a \b a (a (a (a ((\c \d c (c d)) a ((\c \d c (c d)) a b)))))
+ \a \b a (a (a (a ((\c a (a c)) ((\c \d c (c d)) a b)))))
+ \a \b a (a (a (a (a (a ((\c \d c (c d)) a b))))))
+ \a \b a (a (a (a (a (a ((\c a (a c)) b))))))
+ \a \b a (a (a (a (a (a (a (a b)))))))
As expected, the resulting normal form is Church
numeral 8.
Taking only the first line of output gives us a sort of BLC disassembler, an
exact inverse of the above assembler. The prime number sieve disassembles as
follows:
-
$ cat symbolic.Blc primes.blc |./tromp|head-1
-\a(\b b (b((\c c c)(\c\d\e e (\f\g g)((\f c c f ((\g g g)(\g f (g g))))(\f\g\h\i i g (h(d f)))))(\c\d\e b (e c)))))(\b\c c (\d\e d)b)
+
$ cat symbolic.Blc primes.blc | ./tromp | head -1
+ \a (\b b (b ((\c c c) (\c \d \e e (\f \g g) ((\f c c f ((\g g g) (\g f (g g)))) (\f \g \h \i i g (h (d f))))) (\c \d \e b (e c))))) (\b \c c (\d \e d) b)
Hardly any less obfuscated…
The last line of
-
cat symbolic.Blc primes.blc |./tromp|head-16
+
cat symbolic.Blc primes.blc | ./tromp | head -16
starts out as
\a \b b (\c \d c) (\c c (\d \e d) (\d d (\e \f f) (\e e (\f \g g) ((\f (\g \h \i
The \a is for ignoring the rest of the input (to which the universal machine
@@ -444,16 +444,16 @@ Syntax which relies on the highly optimized
Haskell runtime system for evaluation. Of course individual BLC programs running
under the interpreter perform much worse than that same program written in Haskell.
Our interpreter copes well with extra levels of interpretation:
$ time cat primes.blc | ./tromp -b | head -c 210 > /dev/null
+ real 0m0.043s
+ $ time cat uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+ real 0m0.191s
+ $ time cat uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+ real 0m1.919s
+ $ time cat uni.blc uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+ real 0m23.514s
+ $ time cat uni.blc uni.blc uni.blc uni.blc primes.blc | ./tromp -b | head -c 210 > /dev/null
+ real 4m52.700s
Obfuscation
Obfuscation is due entirely to conciseness. Some questions to ponder:
Which of the term space codes 0, 1, 2, 3 serve multiple purposes?
diff --git a/2012/vik/README.md b/2012/vik/README.md
index bf71396a2..3e6a8450a 100644
--- a/2012/vik/README.md
+++ b/2012/vik/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -25,38 +25,38 @@ For more detailed information see [2012 vik bugs](../../bugs.html#2012_vik).
To embed text (from file or command line):
-```sh
+```
./vik e base.png filename > encodedimg.png
```
or
-```sh
+```
./vik e base.png SomeRandomText > encodedimg.png
```
To extract the embedded text:
-```sh
+```
./vik d encodedimg.png
```
To embed a PNG into another:
-```sh
+```
./vik e base.png source.png > encodedimg.png
```
To extract the embedded PNG:
-```sh
+```
./vik d encodedimg.png > restored.png
```
## Try:
-```sh
+```
./try.sh
```
@@ -68,7 +68,7 @@ For those few who might use Windows this alternate code might work.
### Alternate build:
-```sh
+```
make alt
```
@@ -116,7 +116,7 @@ possible to get the bitmap data from the extracted image, and run it through any
of the previous winning brainfuck interpreters, but I thought it would be easier
to include an interpreter in the program to avoid the hassle:
-```sh
+```
./vik e ioccc.png chocolate.png > encodedimg.png
./vik b encodedimg.png
```
@@ -125,7 +125,7 @@ It is of course also possible to embed a
[brainfuck](https://en.wikipedia.org/wiki/Brainfuck) program as a text file
(as explained above) and decode it, e.g.:
-```sh
+```
./vik e ioccc.png .+[.+] > encodedimg.png
./vik b encodedimg.png
```
@@ -154,7 +154,7 @@ compile the program on this platform, the following line can be added after
the variable declarations in the main declaration in order to run
correctly:
-```c
+```
_setmode(_fileno(stdout), 0x8000);
```
diff --git a/2012/vik/index.html b/2012/vik/index.html
index 2db153246..76d85455d 100644
--- a/2012/vik/index.html
+++ b/2012/vik/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
For those few who might use Windows this alternate code might work.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use vik.alt as you would vik above.
Judges’ remarks:
@@ -196,13 +196,13 @@ into another image and extracted, the bitmap data is also a valid
possible to get the bitmap data from the extracted image, and run it through any
of the previous winning brainfuck interpreters, but I thought it would be easier
to include an interpreter in the program to avoid the hassle:
-
./vik e ioccc.png chocolate.png > encodedimg.png
-./vik b encodedimg.png
+
./vik e ioccc.png chocolate.png > encodedimg.png
+ ./vik b encodedimg.png
It is of course also possible to embed a
brainfuck program as a text file
(as explained above) and decode it, e.g.:
-
./vik e ioccc.png .+[.+]> encodedimg.png
-./vik b encodedimg.png
+
./vik e ioccc.png .+[.+] > encodedimg.png
+ ./vik b encodedimg.png
Obfuscation
I really wanted to keep the program simple, so instead of adding multiple macros
or helper methods that can be confusing, I placed all functionality in the
@@ -221,7 +221,7 @@ binary data to stdout.
compile the program on this platform, the following line can be added after
the variable declarations in the main declaration in order to run
correctly:
-
The program doesn’t have many error checks so passing in invalid arguments
diff --git a/2012/zeitak/README.md b/2012/zeitak/README.md
index 09c2eaef3..af170b91f 100644
--- a/2012/zeitak/README.md
+++ b/2012/zeitak/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./zeitak < file
```
@@ -21,7 +21,7 @@ text files that are not code.
## Try:
-```sh
+```
make test
```
@@ -38,7 +38,7 @@ understand this extremely subtle entry.
### Alternate build:
-```sh
+```
make alt
```
@@ -92,7 +92,7 @@ around it's position.
* Ignores parenthesis inside strings or character constants, so no errors
will be detected in the following line:
-```c
+```
printf(")");
```
@@ -104,7 +104,7 @@ around it's position.
* Escapes (e.g. `\"`) are ignored, so the following line will produce
an error:
-```c
+```
printf("\"");
```
diff --git a/2012/zeitak/index.html b/2012/zeitak/index.html
index 8e61349b1..caa66c1b6 100644
--- a/2012/zeitak/index.html
+++ b/2012/zeitak/index.html
@@ -141,16 +141,16 @@ Location: IL - State of Israel (
To build:
-
make
+
make
There is an alternate version that is slightly deobfuscated. See alternate
code below.
To use:
-
./zeitak< file
+
./zeitak < file
where file is the file to be checked for nesting errors. For example, you may
try incorrect.c and the program itself. You may also run it on
text files that are not code.
Try:
-
make test
+
make test
NOTE: the program prints an error and exits on the first nesting error so it
will not detect multiple issues.
Alternate code:
@@ -158,7 +158,7 @@ will not detect multiple issues.
deobfuscated by the author. You may find reading it helpful in your attempt to
understand this extremely subtle entry.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use zeitak.alt as you would zeitak above.
Judges’ remarks:
@@ -188,7 +188,7 @@ around it’s position.
Ignores parenthesis inside strings or character constants, so no errors
will be detected in the following line:
@@ -197,7 +197,7 @@ will be detected in the following line:
Escapes (e.g. \") are ignored, so the following line will produce
an error:
-
printf("\"");
+
printf("\"");
Obfuscation
IOCCC entries already contain entries without digits, control-flow
keywords and certain operators in their source. This entry has an
diff --git a/2013/README.md b/2013/README.md
index 7b830f0cc..b9960cb1d 100644
--- a/2013/README.md
+++ b/2013/README.md
@@ -43,13 +43,13 @@ had to print a value 2053 or less when the `-i` flag was used.
Several people discovered an undocumented feature in that
certain comments such as:
-```c
+```
///*
```
or:
-```c
+```
*\
/
```
diff --git a/2013/birken/README.md b/2013/birken/README.md
index c0f903d53..e6b3901a7 100644
--- a/2013/birken/README.md
+++ b/2013/birken/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make alt
```
@@ -11,7 +11,7 @@ version see the [original code](#original-code) section below.
## To use:
-```sh
+```
./birken.alt < 17_columns_wide_paint_by_numbers_file
```
@@ -30,7 +30,7 @@ it should you wish (see below).
To see the program run on each text file, try:
-```sh
+```
./try.alt.sh
```
@@ -44,7 +44,7 @@ other entries where this was made an alternate version it is configurable at
compile time. If you wish to speed it up by 100% you can instead do:
-```sh
+```
make clobber SLEEP=7500 alt
```
@@ -55,7 +55,7 @@ If you wish to speed that up 200% (300% total) you can use instead try
ctrl-c to terminate the program early but note that the terminal is likely to be
messed up. In that case try:
-```sh
+```
reset
```
@@ -70,7 +70,7 @@ hard to see the art of the entry but you may do so if you wish.
### Original build:
-```sh
+```
make all
```
@@ -84,7 +84,7 @@ Use `birken` as you would `birken.alt` above.
To use the demo script with the original code, try:
-```sh
+```
./try.sh
```
@@ -96,7 +96,7 @@ PLEASE be careful if you are sensitive to flashing colours!
This program also wins the "Most amusing abuse of the iocccsize tool" award;
although not the absolute best: it is possible to achieve 0 by writing:
-```c
+```
/* *\
/....
```
@@ -319,7 +319,7 @@ This program demonstrates how to exploit a bug in IOCCC size tool version
If that line is added to the top of any program, the tool will report a size of 8.
-```sh
+```
$ ./iocccsize -i < prog.c
8
```
@@ -327,7 +327,7 @@ If that line is added to the top of any program, the tool will report a size of
When that line is deleted from this program, the tool properly reports the
secondary size limit of the program as 2048.
-```sh
+```
$ ./iocccsize -i < birken.c
2048
```
@@ -357,7 +357,7 @@ Carefully selected variable names also yielded wonderful expressions like `l=0`,
`O=0`, `O=1` and `while(O)`. `"Tetris"` also makes a second appearance of
sorts:
-```c
+```
[T][e][t]--; while(R+i) { s
```
diff --git a/2013/birken/index.html b/2013/birken/index.html
index d02aeee5c..0c3c55d2c 100644
--- a/2013/birken/index.html
+++ b/2013/birken/index.html
@@ -141,12 +141,12 @@ Location: US - United States of America
To build:
-
make alt
+
make alt
We recommend that you use the alt version first to see what this entry looked
like back in 2013 (with a configurable speed). If you wish to use the original
version see the original code section below.
NOTE: if your terminal is messed up after running this (perhaps from exiting
before it finishes) try using reset to restore the terminal. This will clear
the screen.
@@ -157,7 +157,7 @@ be problematic for some people, can be configured to different speeds by way of
the value used in usleep(3). The default is 13500 but you can reconfigure
it should you wish (see below).
To see the program run on each text file, try:
-
./try.alt.sh
+
./try.alt.sh
If you have perl installed it will also try a random run.
Finding the ‘right’ default value was a fine line; the default, 15000
microseconds (0.015 seconds), will take quite a while to finish but it allows
@@ -165,30 +165,30 @@ one to more easily see what is going on. Even easier to see would be 25000 but
these values make it quite slow and one could easily lose interest. Like some
other entries where this was made an alternate version it is configurable at
compile time. If you wish to speed it up by 100% you can instead do:
-
make clobber SLEEP=7500 alt
+
make clobber SLEEP=7500 alt
and then try birken.alt as above.
If you wish to speed that up 200% (300% total) you can use instead try
SLEEP=3750. Doing this you might find the right value to your liking; use
ctrl-c to terminate the program early but note that the terminal is likely to be
messed up. In that case try:
-
reset
+
reset
to make it sane again (running to completion will do that for you).
Original code:
The original code will run faster with modern systems which is likely to make it
hard to see the art of the entry but you may do so if you wish.
Original build:
-
make all
+
make all
Original use:
Use birken as you would birken.alt above.
Original try:
To use the demo script with the original code, try:
-
./try.sh
+
./try.sh
PLEASE be careful if you are sensitive to flashing colours!
Judges’ remarks:
This program also wins the “Most amusing abuse of the iocccsize tool” award;
although not the absolute best: it is possible to achieve 0 by writing:
-
/* *\
- /....
+
/* *\
+ /....
The game of Tetris had been used in many endeavors, from studying algorithmic
complexity to treating
PTSD and
@@ -346,12 +346,12 @@ call to fflush(3) (N.B: see birken.alt.c2013-07-30-v17. The first line of the program is reproduced below.
char_ = “’”“/”;
If that line is added to the top of any program, the tool will report a size of 8.
-
$ ./iocccsize -i< prog.c
-8
+
$ ./iocccsize -i < prog.c
+ 8
When that line is deleted from this program, the tool properly reports the
secondary size limit of the program as 2048.
-
$ ./iocccsize -i< birken.c
-2048
+
$ ./iocccsize -i < birken.c
+ 2048
Although this bug provides an easy means of circumventing contest rule 2, as
demonstrated from the size value, this entry is not necessarily striving for a
‘worst abuse of the rules’ award.
@@ -371,7 +371,7 @@ Pajitnov’s original 1984
Carefully selected variable names also yielded wonderful expressions like l=0,
O=0, O=1 and while(O). "Tetris" also makes a second appearance of
sorts:
-
[T][e][t]--;while(R+i){ s
+
[T][e][t]--; while(R+i) { s
The source is formatted to resemble the
Tetris play-field mid-game. It is also
an homage to all the past IOCCC entries formatted as a compact
diff --git a/2013/cable1/README.md b/2013/cable1/README.md
index 235235141..60ccaaaba 100644
--- a/2013/cable1/README.md
+++ b/2013/cable1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./cable1 name group1 group2
```
## Try:
-```sh
+```
./try.sh
```
@@ -26,39 +26,39 @@ We need not limit ourselves to the two major political parties in the US today.
Let us consider:
-```sh
+```
./cable1 Cooper Mac PC
```
Simon works for Apple, so you would expect Mac. :-)
Landon is a long time Mac user:
-```sh
+```
./cable1 Noll Mac PC
```
That works too! Now Leo brings PCs to the IOCCC judging for cross-platform
testing:
-```sh
+```
./cable1 Broukhis Mac PC
```
We can test other people. The late Steve Jobs:
-```sh
+```
./cable1 Jobs Mac PC
```
That works! How about Bill?
-```sh
+```
./cable1 Gates Mac PC
```
A PC guy as expected. What about that other Steve?
-```sh
+```
./cable1 Ballmer Mac PC
```
diff --git a/2013/cable1/index.html b/2013/cable1/index.html
index c8628621a..522b95ae6 100644
--- a/2013/cable1/index.html
+++ b/2013/cable1/index.html
@@ -141,28 +141,28 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./cable1 name group1 group2
+
./cable1 name group1 group2
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Partisan may be defined as a strong supporter of a cause, party or person.
We need not limit ourselves to the two major political parties in the US today.
Let us consider:
-
./cable1 Cooper Mac PC
+
./cable1 Cooper Mac PC
Simon works for Apple, so you would expect Mac. :-)
Landon is a long time Mac user:
-
./cable1 Noll Mac PC
+
./cable1 Noll Mac PC
That works too! Now Leo brings PCs to the IOCCC judging for cross-platform
testing:
-
./cable1 Broukhis Mac PC
+
./cable1 Broukhis Mac PC
We can test other people. The late Steve Jobs:
-
./cable1 Jobs Mac PC
+
./cable1 Jobs Mac PC
That works! How about Bill?
-
./cable1 Gates Mac PC
+
./cable1 Gates Mac PC
A PC guy as expected. What about that other Steve?
-
./cable1 Ballmer Mac PC
+
./cable1 Ballmer Mac PC
Humm .. maybe there is a hidden reason he is leaving the late Micro$oft? :-)
Why late? Because:
diff --git a/2013/cable2/README.md b/2013/cable2/README.md
index 2c90d9ac5..fceb15381 100644
--- a/2013/cable2/README.md
+++ b/2013/cable2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2013 cable2 bugs](../../bugs.html#2013_cable2
## To use:
-```sh
+```
./cable2 file.bmp [color]
```
@@ -27,7 +27,7 @@ For more detailed information see [2013 cable2 bugs](../../bugs.html#2013_cable2
For different OCR examples:
-```sh
+```
./try.sh
```
diff --git a/2013/cable2/index.html b/2013/cable2/index.html
index 23f3e1b2d..4a91727d0 100644
--- a/2013/cable2/index.html
+++ b/2013/cable2/index.html
@@ -141,16 +141,16 @@ Location: US - United States of America
We can confirm that this is the first time the IOCCC has been used
to peer-review a new research. We had quite a bit of fun with a sharpie and a
diff --git a/2013/cable3/README.md b/2013/cable3/README.md
index dc211d824..b3c876d8e 100644
--- a/2013/cable3/README.md
+++ b/2013/cable3/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ available. See the [Alternate code](#alternate-code) section below.
## To use:
-```sh
+```
./cable3 bios-image-file floppy-image-file [harddisk-image-file]
```
## Try:
-```sh
+```
./cable3.sh
```
@@ -46,7 +46,7 @@ An alternate version, which should compile in Windows, is provided.
Assuming `make` is available and will function:
-```sh
+```
make alt
```
@@ -173,7 +173,7 @@ non-UNIX platforms. For example, for Windows/MS Visual Studio, instead of the
Makefile definition of KB, use something slightly different - add the following
entry to the Preprocessor Definitions list in the Project Properties page:
-```c
+```
KB=(kb=H(8),kbhit())&&(r[1190]=getch(),H(7))
```
@@ -189,7 +189,7 @@ offsets) this is not the case, and to run successfully on these systems, you
will need to explicitly declare these functions by adding the appropriate
include to the top of the source:
-```c
+```
#include
```
@@ -197,7 +197,7 @@ NOTE: this has been done in [cable3.c](cable3.c).
### Usage
-```sh
+```
./cable3 bios-image-file floppy-image-file [harddisk-image-file]
```
@@ -205,7 +205,7 @@ PLEASE NOTE that under Unices the keyboard must be in raw mode for the emulator
to work properly. Therefore the emulator is best run from a shell script that
looks something like:
-```sh
+```
stty cbreak raw -echo min 0
./cable3 bios floppy.img harddisk.img
stty cooked echo
@@ -223,7 +223,7 @@ 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
[cable3.sh](cable3.sh)):
-```sh
+```
stty cbreak raw -echo min 0
./cable3 bios fd.img
stty cooked echo
@@ -237,7 +237,7 @@ whole bunch of software which is in the included file `hd.img`.
For the more adventurous, you can start off with (for example) a blank 40MB
image file called hd.img made using e.g. Makefile. Then use:
-```sh
+```
stty cbreak raw -echo min 0
./cable3 bios fd.img hd.img
stty cooked echo
diff --git a/2013/cable3/index.html b/2013/cable3/index.html
index 4609a6b90..62718c749 100644
--- a/2013/cable3/index.html
+++ b/2013/cable3/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
To build:
-
make
+
make
An alternate version that should compile in Windows/MS Visual Studio is
available. See the Alternate code section below.
NOTE: to quit the program type QUITEMU. You might have to be at the top level
directory of the drive, A: or C:.
To send an Alt+XXX key combination, press (^A / Ctrl+A) then the key, so
@@ -162,7 +162,7 @@ combinations are left for the discovery of the user.
An alternate version, which should compile in Windows, is provided.
Alternate build:
Assuming make is available and will function:
-
make alt
+
make alt
Alternate use:
Use cable3.alt as you would cable3 above.
Judges’ remarks:
@@ -264,7 +264,7 @@ has no stty. Therefore the Makefile includes a -D opti
non-UNIX platforms. For example, for Windows/MS Visual Studio, instead of the
Makefile definition of KB, use something slightly different - add the following
entry to the Preprocessor Definitions list in the Project Properties page:
The code as supplied uses implicit function declarations for POSIX file I/O and
@@ -273,16 +273,16 @@ architecture. For some systems (e.g. 32-bit Mac OS X, which uses 64-bit file
offsets) this is not the case, and to run successfully on these systems, you
will need to explicitly declare these functions by adding the appropriate
include to the top of the source:
PLEASE NOTE that under Unices the keyboard must be in raw mode for the emulator
to work properly. Therefore the emulator is best run from a shell script that
looks something like:
-
stty cbreak raw -echo min 0
-./cable3 bios floppy.img harddisk.img
-stty cooked echo
+
stty cbreak raw -echo min 0
+ ./cable3 bios floppy.img harddisk.img
+ stty cooked echo
The simplest use of the emulator is with a single floppy boot disk image, like
@@ -291,17 +291,17 @@ the fd.img provided, which is a FreeDOS boot disk.
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
cable3.sh):
-
stty cbreak raw -echo min 0
-./cable3 bios fd.img
-stty cooked echo
+
stty cbreak raw -echo min 0
+ ./cable3 bios fd.img
+ stty cooked echo
To use the emulator - floppy + HD mode
Easiest to start with is to try a ready-made 40MB hard disk image containing a
whole bunch of software which is in the included file hd.img.
For the more adventurous, you can start off with (for example) a blank 40MB
image file called hd.img made using e.g. Makefile. Then use:
-
stty cbreak raw -echo min 0
-./cable3 bios fd.img hd.img
-stty cooked echo
+
stty cbreak raw -echo min 0
+ ./cable3 bios fd.img hd.img
+ stty cooked echo
Preparing the hard disk for use in the emulator is done just like a real PC.
Boot the emulator, and use FDISK to partition the hard disk. When it’s done
FDISK will reboot the emulator. Then you can use FORMAT C: and you are done. The
diff --git a/2013/dlowe/README.md b/2013/dlowe/README.md
index ca89a1feb..2bc4747e9 100644
--- a/2013/dlowe/README.md
+++ b/2013/dlowe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2013 dlowe bugs](../../bugs.html#2013_dlowe).
## To use:
-```sh
+```
./dlowe [number...]
```
@@ -27,13 +27,13 @@ where `[number...]` is one or more number, space separated.
## Try:
-```sh
+```
./try.sh
```
What is different about the above if you do something like:
-```sh
+```
echo 'IOCCC winning entry 2013/dlowe' > ioccc.txt
./try.sh
rm -f ioccc.txt
@@ -43,7 +43,7 @@ What is different about the above if you do something like:
To make it simpler to see try showing just the different line like:
-```sh
+```
./diff.sh
```
@@ -58,7 +58,7 @@ with one argument or when all arguments are equal?
For extra fun, compile and run [fun.c](fun.c):
-```c
+```
#include
int main() {
printf("%d %d %d\n", (int)(-1.0/0.0), (int)(0.0/0.0), (int)(1.0/0.0));
@@ -91,7 +91,7 @@ Which one is correct? :)
NOTE: `make all` will compile [fun.c](fun.c) but to provide a different compiler
you can do something like:
-```sh
+```
make CC=clang fun
```
@@ -105,7 +105,7 @@ A tiny implementation of command-line
### Synopsis
-```sh
+```
$ ./sparkl 0 1 2 3 4 5 6 7
▁▂▃▄▅▆▇▉
@@ -115,7 +115,7 @@ A tiny implementation of command-line
NOTE: this has been provided in [slflen.sh](slflen.sh) so you can try:
-```sh
+```
./slflen.sh
```
diff --git a/2013/dlowe/index.html b/2013/dlowe/index.html
index f6206ae06..fece14ead 100644
--- a/2013/dlowe/index.html
+++ b/2013/dlowe/index.html
@@ -141,33 +141,33 @@ Location: US - United States of America
This is a handy little tool for visualizing numeric series from the
diff --git a/2013/endoh1/README.md b/2013/endoh1/README.md
index ea5c9b256..e6308563d 100644
--- a/2013/endoh1/README.md
+++ b/2013/endoh1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,20 +18,20 @@ For more detailed information see [2013 endoh1 bugs](../../bugs.html#2013_endoh1
## To use:
-```sh
+```
./endoh1 [file.lazy]
```
## Try:
-```sh
+```
./try.sh
```
You might also enjoy running:
-```sh
+```
cc -E endoh1.c | less
```
@@ -50,7 +50,7 @@ This entry can be considered an abuse of the GCC's optimizer; it takes GCC about
### Remarks
-```sh
+```
less endoh1.c
gcc -o endoh1 endoh1.c
./endoh1
@@ -66,7 +66,7 @@ especially, [Lazy K][2].
This program will shine when it is used as a library. For example,
[hello.lazy](hello.lazy) is a "Hello world" program written in Lazy K.
-```sh
+```
$ lazy hello.lazy
Hello, world!
```
@@ -75,7 +75,7 @@ where `lazy` is [a reference implementation of Lazy K][3]. At the same time,
[hello.lazy](hello.lazy) is *a valid C program* that uses [endoh1.c](endoh1.c)
as a library.
-```sh
+```
$ gcc -o hello -xc hello.lazy
$ ./hello
Hello, world!
@@ -136,7 +136,7 @@ I confirmed that the program successfully worked with the following compilers:
Recent compilers with `-Wall -W -Wextra -pedantic` say nothing.
-```sh
+```
gcc -Wall -W -Wextra -pedantic prog.c
clang -Wall -W -Wextra -pedantic prog.c
tcc -Wall -W -Wextra -pedantic prog.c
@@ -173,7 +173,7 @@ combinator calculus. The rewriting rules are shown in the shape of the code.
Consider a sequence of function applications in C:
-```c
+```
s(x)(x)(x)(x)...
```
@@ -182,7 +182,7 @@ type", such as `typedef f (*f)();`.
So, I used a heavily nested function pointer type:
-```c
+```
typedef void *(*(*(*...(*(f))()...)())())
```
@@ -207,7 +207,7 @@ However, no type in C is callable and has a reference at the same time.
So, I addressed this issue by generating many function definitions
statically by (ab)using macros:
-```c
+```
void *x1; void f1(void *y) { return apply(x1, y); }
void *x2; void f2(void *y) { return apply(x2, y); }
void *x3; void f3(void *y) { return apply(x3, y); }
diff --git a/2013/endoh1/index.html b/2013/endoh1/index.html
index 505ac2017..80a75356b 100644
--- a/2013/endoh1/index.html
+++ b/2013/endoh1/index.html
@@ -141,17 +141,17 @@ Location: JP - Japan
We liked this entry because it can serve as a standalone program as well as an
include file; and, as usual, because its input data is at least as obfuscated as
@@ -160,23 +160,23 @@ the program itself.
4x longer to compile it with -O3 than without, compared to clang’s 2x.
I think it will work on almost all platforms. I confirmed:
Ubuntu Linux
@@ -235,11 +235,11 @@ evaluates it.
combinator calculus. The rewriting rules are shown in the shape of the code.
Abuse of function pointers
Consider a sequence of function applications in C:
-
s(x)(x)(x)(x)...
+
s(x)(x)(x)(x)...
What type should s have? Unfortunately, C does not provide a “recursive
type”, such as typedef f (*f)();.
So, I used a heavily nested function pointer type:
-
typedefvoid*(*(*(*...(*(f))()...)())())
+
typedef void *(*(*(*...(*(f))()...)())())
This limits how many arguments one function can be consecutively applied to.
But you can increase the number by tweaking the definition of macro p.
Code duplication by macros
@@ -255,11 +255,11 @@ environment which is a reference to non-local variable.
(It is feasible by dynamic code generation, but it is far from portable.)
So, I addressed this issue by generating many function definitions
statically by (ab)using macros:
and by allotting each of them when a closure is needed.
This leads to another limitation: the number of pre-defined closures limits how
many identifiers (SKI) one program can use.
diff --git a/2013/endoh2/README.md b/2013/endoh2/README.md
index c50d13277..21ba12f91 100644
--- a/2013/endoh2/README.md
+++ b/2013/endoh2/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
make check
```
@@ -23,7 +23,7 @@ download one or both before exiting.
## Try:
-```sh
+```
less jpeg.c
```
diff --git a/2013/endoh2/index.html b/2013/endoh2/index.html
index 010651feb..b9f6c66bd 100644
--- a/2013/endoh2/index.html
+++ b/2013/endoh2/index.html
@@ -141,9 +141,9 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
make check
+
make check
You’ll need to have both Ruby and
ImageMagick installed to run all the automated
checks.
@@ -152,7 +152,7 @@ section to enjoy the entry. The Makefilecheck
Try:
-
less jpeg.c
+
less jpeg.c
Next look at jpeg.jpg in an image viewer program.
Judges’ remarks:
This is a program which, when fed its own source, generates a program that
diff --git a/2013/endoh3/README.md b/2013/endoh3/README.md
index 8a09ac4f8..9bf023360 100644
--- a/2013/endoh3/README.md
+++ b/2013/endoh3/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2013 endoh3 bugs](../../bugs.html#2013_endoh3
## To use:
-```sh
+```
./endoh3
```
@@ -29,7 +29,7 @@ system up for this or if you want to verify that everything is oky.
## Try:
-```sh
+```
./try.sh
./try.sh ABC
@@ -75,7 +75,7 @@ notation](http://en.wikipedia.org/wiki/ABC_notation).
Try:
-```sh
+```
cc -o endoh3 endoh3.c
echo "CDEFGABc" | ./endoh3 > /dev/dsp
```
@@ -83,20 +83,20 @@ Try:
If `/dev/dsp` is not available on your system, use an OSS sound wrapper such
as `padsp` or `aoss`:
-```sh
+```
echo "CDEFGABc" | ./endoh3 | padsp tee /dev/dsp > /dev/null
```
If you are using Mac OS X, try [sox](http://sox.sourceforge.net/) like so:
-```sh
+```
echo "CDEFGABc" | ./endoh3 | sox -q -traw -r8000 -b8 -e unsigned-integer - -tcoreaudio
```
If that does not work, use the attached script to convert the output into a wave
file format:
-```sh
+```
echo "CDEFGABc" | ./endoh3 | ruby wavify.rb > cde.wav
```
@@ -107,7 +107,7 @@ You can also enjoy some music scores that I attached. With `/dev/dsp` you can
do so like:
-```sh
+```
cat twinkle.abc | ./endoh3 > /dev/dsp
cat menuet.abc | ./endoh3 > /dev/dsp
```
@@ -185,7 +185,7 @@ You know, it is ["the famous song"](http://en.wikipedia.org/wiki/4%E2%80%B233%E2
Here is a magical expression which I found by brute-force:
-```c
+```
(c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22
```
@@ -228,7 +228,7 @@ frequency by multiplying the value by `n` times.
Finally, the following code generates a saw wave:
-```c
+```
for(c = 0; c < len; c++) putchar(a = n * D);
```
diff --git a/2013/endoh3/index.html b/2013/endoh3/index.html
index d9215a9b9..e9ecb5719 100644
--- a/2013/endoh3/index.html
+++ b/2013/endoh3/index.html
@@ -141,24 +141,24 @@ Location: JP - Japan
The script will check for SoX first and next padsp from PulseAudio and
finally if neither are found if you have ruby(1) installed it’ll use the
included ruby script to convert it to a WAV file for you to play.
@@ -180,21 +180,21 @@ will remain the same for historical purposes.
but you should be able to modify it a way to meet your system requirements as
described above.
Obfuscation
@@ -257,7 +257,7 @@ But I do not attach it to protect you from W****r.
You know, it is “the famous song”.
Spoiler
Here is a magical expression which I found by brute-force:
-
(c %32+5)*9/5%13+ n /32*12-22
+
(c % 32 + 5) * 9 / 5 % 13 + n / 32 * 12 - 22
Interestingly, it converts an ASCII number of ABC notes
to the corresponding tone number.
'C' (ASCII 67) => 3
@@ -287,7 +287,7 @@ found this approximation by using the
for(c =0; c < len; c++) putchar(a = n * D);
+
for(c = 0; c < len; c++) putchar(a = n * D);
where D is a frequency and a is a variable whose type is char. By
assigning float to char variable, the implicit type conversion is performed
from float to char (modulo 256).
diff --git a/2013/endoh4/README.md b/2013/endoh4/README.md
index 7931913a8..926ebb01b 100644
--- a/2013/endoh4/README.md
+++ b/2013/endoh4/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -8,7 +8,7 @@ If you wish to change the size (see the [Author's remarks](#authors-remarks)
below) you can do so with the `SIZE` variable. For instance you can do:
-```sh
+```
make clobber SIZE=50,50 all
```
@@ -29,7 +29,7 @@ For more detailed information see [2013 endoh4 bugs](../../bugs.html#2013_endoh4
## To use:
-```sh
+```
./endoh4 < file
./endoh4.sh file
```
@@ -41,7 +41,7 @@ line it will feed to the program [endoh4.c](endoh4.c).
## Try:
-```sh
+```
./endoh4.sh cube.txt
```
@@ -51,13 +51,13 @@ The author recommends the use of xterm.
For an example, if you are a football/soccer fan, try:
-```sh
+```
./endoh4.sh solids/archimedian-solid/a11-truncated-icosahedron.txt
```
You can provide more than one file:
-```sh
+```
./endoh4.sh solids/archimedian-solid/a11-truncated-icosahedron.txt cube.txt
```
@@ -66,7 +66,7 @@ Hit ctrl-c/intr to go to the next file.
If you wish to change the size to `50,50` without passing any arg:
-```sh
+```
SIZE=50,50 ./endoh4.sh
```
@@ -115,7 +115,7 @@ clang, and tcc. It should not trigger warnings with `-pedantic` and `-Wextra`.
You may want to use `tput` to hide the terminal cursor.
-```sh
+```
tput civis
./endoh4 < cube.txt
tput cnorm
@@ -123,7 +123,7 @@ You may want to use `tput` to hide the terminal cursor.
or
-```sh
+```
./endoh4.sh cube.txt
```
@@ -131,14 +131,14 @@ or
You can change the screen size. Let the aspect ratio be about 3:1.
-```sh
+```
cc -DS=120,40 -o endoh4 endoh4.c
```
The shape of this code is the geometric net of a regular tetrahedron.
So, try:
-```sh
+```
./endoh4 < endoh4.c # or ./endoh4.sh
```
diff --git a/2013/endoh4/index.html b/2013/endoh4/index.html
index 8c2d04e2b..333487111 100644
--- a/2013/endoh4/index.html
+++ b/2013/endoh4/index.html
@@ -141,10 +141,10 @@ Location: JP - Japan
To build:
-
make
+
make
If you wish to change the size (see the Author’s remarks
below) you can do so with the SIZE variable. For instance you can do:
-
make clobber SIZE=50,50 all
+
make clobber SIZE=50,50 all
but you can also do this directly with the endoh4.sh script as
described below.
The second form is preferable as it will temporarily make the cursor invisible
as recommended by the author. If no file is specified in the ./endoh4.sh command
line it will feed to the program endoh4.c.
Try:
-
./endoh4.sh cube.txt
+
./endoh4.sh cube.txt
Hit ctrl-c to end the program.
The author recommends the use of xterm.
For an example, if you are a football/soccer fan, try:
If you wish to change the size to 50,50 without passing any arg:
-
SIZE=50,50 ./endoh4.sh
+
SIZE=50,50 ./endoh4.sh
Not specifying a file feeds endoh4.c to the program.
Judges’ remarks:
This program is formatted as the net for a tetrahedron (hint: try feeding the
@@ -203,17 +203,17 @@ triangulated)
clang, and tcc. It should not trigger warnings with -pedantic and -Wextra.
Tips
You may want to use tput to hide the terminal cursor.
-
tput civis
-./endoh4< cube.txt
-tput cnorm
+
tput civis
+ ./endoh4 < cube.txt
+ tput cnorm
or
-
./endoh4.sh cube.txt
+
./endoh4.sh cube.txt
Bonuses
You can change the screen size. Let the aspect ratio be about 3:1.
-
cc-DS=120,40 -o endoh4 endoh4.c
+
cc -DS=120,40 -o endoh4 endoh4.c
The shape of this code is the geometric net of a regular tetrahedron.
So, try:
-
./endoh4< endoh4.c # or ./endoh4.sh
+
./endoh4 < endoh4.c # or ./endoh4.sh
The solids/ directory includes various solid data:
diff --git a/2013/hou/README.md b/2013/hou/README.md
index 750552e6e..47e9ad813 100644
--- a/2013/hou/README.md
+++ b/2013/hou/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make all
```
@@ -18,7 +18,7 @@ For more detailed information see [2013 hou bugs](../../bugs.html#2013_hou).
## To use:
-```sh
+```
./hou [scene-file-name] [options]
```
@@ -29,7 +29,7 @@ effects should be more or less recognizable when you see 16.
## Try:
-```sh
+```
./try.sh
```
@@ -62,7 +62,7 @@ This program will loop infinitely while progressively refining a
NOTE: the author refers to [a.c](a.c), placed in a gzipped file `a.c.gz`. We do not
include it but it can be generated like:
-```sh
+```
cc -Wall hou.c -o hou -lm
./hou > a.c
```
@@ -78,7 +78,7 @@ needing to create a temporary file.
This program is a programmable rendering engine with a built-in default scene.
The standard command line is:
-```sh
+```
./hou [scene-file-name] [options]
```
diff --git a/2013/hou/index.html b/2013/hou/index.html
index e3033f503..67c6bc0cf 100644
--- a/2013/hou/index.html
+++ b/2013/hou/index.html
@@ -141,18 +141,18 @@ Location: CN - People’s Republic of C
Follow the instructions in stdout, preferably with an auto-refreshing PPM
image viewer ready. Refresh the image every time the output refreshes, all
effects should be more or less recognizable when you see 16.
Try:
-
./try.sh
+
./try.sh
Try opening the file noted by the program then let the program run a while and
every so often reopen the file, to see how it changes. The author suggests that
you leave the program running overnight to see what happens. If however you do
@@ -181,15 +181,15 @@ program.
NOTE: the author refers to a.c, placed in a gzipped file a.c.gz. We do not
include it but it can be generated like:
-
cc-Wall hou.c -o hou -lm
-./hou> a.c
+
cc -Wall hou.c -o hou -lm
+ ./hou > a.c
but there is no need to do this as the Makefile takes care of it without even
needing to create a temporary file.
Author’s remarks:
Using hou
This program is a programmable rendering engine with a built-in default scene.
The standard command line is:
-
./hou[scene-file-name][options]
+
./hou [scene-file-name] [options]
As hou runs, it writes a progressively refining image to a ppm file specified
in the scene. The initialization may take a while, but once it’s done, a rough
preview should be available in seconds. Leave hou running for the night, and you
diff --git a/2013/index.html b/2013/index.html
index 8cb8a403b..5028bcaf5 100644
--- a/2013/index.html
+++ b/2013/index.html
@@ -155,10 +155,10 @@ authors submitted very different styles of entries.
had to print a value 2053 or less when the -i flag was used.
Several people discovered an undocumented feature in that
certain comments such as:
-
///*
+
///*
or:
-
*\
-/
+
*\
+ /
were not correctly parsed by the tool. The guidelines stated:
In cases where the above summary and the algorithm implemented by
the IOCCC size tool source code conflict, the algorithm implemented
diff --git a/2013/mills/README.md b/2013/mills/README.md
index 074cf671b..1ef786457 100644
--- a/2013/mills/README.md
+++ b/2013/mills/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2013 mills bugs](../../bugs.html#2013_mills).
## To use:
-```sh
+```
./mills
```
## Try:
-```sh
+```
./mills &
```
@@ -61,7 +61,7 @@ while you are there, click on an ad. They could use the money.
It would be possible to fix this by adding
-```c
+```
n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&n,sizeof n),
```
diff --git a/2013/mills/index.html b/2013/mills/index.html
index a5b12c9cb..515044e05 100644
--- a/2013/mills/index.html
+++ b/2013/mills/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
@@ -170,7 +170,7 @@ doing so. For details as to why this is necessary, feel free to Google
"TIME_WAIT", "SO_REUSEADDR" and "SO_REUSEPORT" (with the quotes). And
while you are there, click on an ad. They could use the money.
at an appropriate spot in the code (an exercise left to the reader). However,
as this limitation is documented, it is not technically a bug.
Details of Operation
diff --git a/2013/misaka/README.md b/2013/misaka/README.md
index 559d9029c..26db6c50d 100644
--- a/2013/misaka/README.md
+++ b/2013/misaka/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ information on all of these builds.
## To use:
-```sh
+```
./horizontal_cat [files...] > [output]
./vertical_cat [files...] > [output]
```
@@ -20,19 +20,19 @@ information on all of these builds.
To understand the various intermediate source files that are built, try:
-```sh
+```
make understanding
```
Also try:
-```sh
+```
./try.sh
```
NOTE: Use - for standard input. For example:
-```sh
+```
./vertical_cat - -
```
@@ -69,7 +69,7 @@ judging this entry.
`Misaka` is a file concatenation utility, with at least two modes of
operation:
-```sh
+```
cc misaka.c -o horizontal_cat
./horizontal_cat [files...] > [output]
@@ -94,7 +94,7 @@ files vertically.
I thought the lack of horizontal concatenation must have been an oversight,
so I implemented this utility:
-```sh
+```
cc misaka.c -o horizontal_cat
./horizontal_cat files...
```
@@ -109,7 +109,7 @@ can specify `-` multiple times to get `stdin` multiplied horizontally. For
example, if you have `seq(1)` in your shell, you can add line numbers to both
sides of [misaka.c](misaka.c) like this:
-```sh
+```
seq -f ' %.0f ' 45 | ./horizontal_cat - misaka.c -
```
@@ -126,7 +126,7 @@ files vertically, so I included a vertical mode. But supporting vertical
mode with command line options would be no fun. Instead, vertical mode is
enabled by concatenating the source code horizontally:
-```sh
+```
./horizontal_cat misaka.c misaka.c > misaka2.c
gcc misaka2.c -o vertical_cat
./vertical_cat files...
@@ -135,7 +135,7 @@ enabled by concatenating the source code horizontally:
`vertical_cat` works more or less like `cat`, except you can use
`vertical_cat` to duplicate `stdin`:
-```sh
+```
./vertical_cat - -
```
@@ -147,7 +147,7 @@ was just more [cats](https://rationalwiki.org/wiki/Fun:Cat). So I implemented
one more mode, this one is enabled by concatenating [misaka.c](misaka.c)
vertically:
-```sh
+```
./vertical_cat misaka.c misaka.c > misaka3.c
gcc misaka3.c -o long_cat
./long_cat
@@ -157,7 +157,7 @@ vertically:
exponentially longer by concatenating more files vertically (up to 31 levels
high, depending on `sizeof(int)` for your compiler):
-```sh
+```
./vertical_cat misaka.c misaka.c misaka.c > misaka4.c
gcc misaka4.c -o loong_cat
@@ -171,7 +171,7 @@ high, depending on `sizeof(int)` for your compiler):
If your terminal has really thin fonts, you can also make this output fatter
by concatenating files horizontally:
-```sh
+```
./vertical_cat misaka.c misaka.c | ./horizontal_cat - - > misaka7.c
gcc misaka7.c -o long_fat_cat
@@ -182,7 +182,7 @@ by concatenating files horizontally:
Output width is determined by the first level of stacked programs, so a
triangle like the following will not have horizontally expanded output:
-```sh
+```
./horizontal_cat misaka.c misaka.c | ./vertical_cat misaka.c - > misaka9.c
gcc misaka9.c -o same_as_long_cat
```
@@ -192,7 +192,7 @@ together, you can feed the source to a
[brainfuck](https://en.wikipedia.org/wiki/Brainfuck) interpreter to get an
overview of how the programs are stacked. Example:
-```sh
+```
perl bf.pl misaka9.c
```
diff --git a/2013/misaka/index.html b/2013/misaka/index.html
index 8a78e5137..a11fa152f 100644
--- a/2013/misaka/index.html
+++ b/2013/misaka/index.html
@@ -141,19 +141,19 @@ Location: US - United States of America
To build:
-
make
+
make
This will build a bunch of versions of the code. See the author’s details for
information on all of these builds.
Where [files...] is a list of text file names. Use - to read from stdin.
Details
Horizontal cat
@@ -192,8 +192,8 @@ concatenating files, that function only seem to work if I wanted to concatenate
files vertically.
I thought the lack of horizontal concatenation must have been an oversight,
so I implemented this utility:
-
cc misaka.c -o horizontal_cat
-./horizontal_cat files...
+
cc misaka.c -o horizontal_cat
+ ./horizontal_cat files...
horizontal_cat concatenates files horizontally and write the output to
stdout. Each input file is padded with spaces on the right so that the
original text alignments are preserved.
@@ -202,7 +202,7 @@ Unlike cat, horizontal_cat loads all input to memory f
can specify - multiple times to get stdin multiplied horizontally. For
example, if you have seq(1) in your shell, you can add line numbers to both
sides of misaka.c like this:
-
Because horizontal_cat must know the maximum width of all files before
writing any output, all files must be processed at least twice. To support
@@ -212,47 +212,47 @@ writing any output, all files must be processed at least twice. To support
files vertically, so I included a vertical mode. But supporting vertical
mode with command line options would be no fun. Instead, vertical mode is
enabled by concatenating the source code horizontally:
vertical_cat works more or less like cat, except you can use
vertical_cat to duplicate stdin:
-
./vertical_cat--
+
./vertical_cat - -
Long cat
After horizontal_cat and vertical_cat, I thought, maybe all I really wanted
was just more cats. So I implemented
one more mode, this one is enabled by concatenating misaka.c
vertically:
long_cat outputs ASCII art of a cat to stdout. You can make this cat
exponentially longer by concatenating more files vertically (up to 31 levels
high, depending on sizeof(int) for your compiler):
Finally, if you lost track of how many misaka.c you have stacked
together, you can feed the source to a
brainfuck interpreter to get an
overview of how the programs are stacked. Example:
where YYYY is the four digit year, MM is the two digit month and DD is two
digit day of the month. The arrow keys control the shifting of the date as
follows:
@@ -154,7 +154,7 @@ follows:
Down : go backwards 20 days.
Try:
-
./try.sh
+
./try.sh
Use the same keys as described above to change the dates each time the program
window is in focus.
Judges’ remarks:
diff --git a/2013/morgan2/README.md b/2013/morgan2/README.md
index 3bb1022b4..71fde4f8f 100644
--- a/2013/morgan2/README.md
+++ b/2013/morgan2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -9,13 +9,13 @@
For the console version (ncurses):
-```sh
+```
./morgan2
```
For the graphical version (X11):
-```sh
+```
./morgan2 X
```
diff --git a/2013/morgan2/index.html b/2013/morgan2/index.html
index 4af053e2d..995583ac3 100644
--- a/2013/morgan2/index.html
+++ b/2013/morgan2/index.html
@@ -141,12 +141,12 @@ Location: FR - French Republic (
To build:
-
make
+
make
To use:
For the console version (ncurses):
-
./morgan2
+
./morgan2
For the graphical version (X11):
-
./morgan2 X
+
./morgan2 X
Judges’ remarks:
The judges enjoyed playing the game almost to completion; if we remember
correctly, we managed to place 59 or 60 dominoes. We wonder, what would be
diff --git a/2013/robison/README.md b/2013/robison/README.md
index 06ab26a79..64d09cef4 100644
--- a/2013/robison/README.md
+++ b/2013/robison/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./robison
# enter an expression
@@ -17,7 +17,7 @@
## Try:
-```sh
+```
./try.sh
```
diff --git a/2013/robison/index.html b/2013/robison/index.html
index c6bd3c42f..69c81236d 100644
--- a/2013/robison/index.html
+++ b/2013/robison/index.html
@@ -141,14 +141,14 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./robison
-# enter an expression
-
-echo expression |./robison
+
./robison
+ # enter an expression
+
+ echo expression | ./robison
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Of integers this prog does a lot,
plus minus, div times (and what not).
diff --git a/2014/birken/README.md b/2014/birken/README.md
index 11443e28b..0e877e99d 100644
--- a/2014/birken/README.md
+++ b/2014/birken/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,7 +11,7 @@ there is a firewall issue, and also lets you redefine the timing constant,
## To use:
-```sh
+```
./prog < some_secret_or_something
./prog http://host[:port]
@@ -20,19 +20,19 @@ there is a firewall issue, and also lets you redefine the timing constant,
## Try:
-```sh
+```
./prog < README.md
```
or maybe:
-```sh
+```
echo "IOCCC 2014!" | ./prog
```
Next, try in another terminal, as the above one is running:
-```sh
+```
./prog http://127.0.0.1:1701
```
@@ -55,13 +55,13 @@ described by the author. See [configuration](#configuration) below.
To specify the port to say, 31337, try:
-```sh
+```
make clobber PORT=31337 alt
```
To change the timing constant, `STARDATE`, try:
-```sh
+```
make clobber TIME=5000000 alt
```
@@ -101,26 +101,26 @@ the server.
## To use web server
-```sh
+```
./prog < secret_file_to_be_downloaded
```
Try using the program's source code as the secret file:
-```sh
+```
./prog < prog.c
```
## To use client-side downloader
-```sh
+```
./prog http://host[:port]
```
The optional port defaults to 1701. If the web server instance is started on
the same box, try:
-```sh
+```
./prog http://127.0.0.1:1701
```
@@ -246,7 +246,7 @@ numerical values.
For space considerations, the following include statements were dropped
resulting in compiler warnings:
-```c
+```
#include
#include
#include
diff --git a/2014/birken/index.html b/2014/birken/index.html
index 1a669a18c..dd9432f4e 100644
--- a/2014/birken/index.html
+++ b/2014/birken/index.html
@@ -144,20 +144,20 @@ Location: US - United States of America
To build:
-
make
+
make
There is alternate code that lets you redefine the port to bind to, in case
there is a firewall issue, and also lets you redefine the timing constant,
STARDATE. See Alternate code below.
Next, try in another terminal, as the above one is running:
-
./prog http://127.0.0.1:1701
+
./prog http://127.0.0.1:1701
What happens if you specify instead of a regular file something like
/dev/null ?
But there’s more! Try opening in a browser the same address and then see what
@@ -168,9 +168,9 @@ problem for some reason, and it also allows you to change the timing as
described by the author. See configuration below.
Alternate build:
To specify the port to say, 31337, try:
-
make clobber PORT=31337 alt
+
make clobber PORT=31337 alt
To change the timing constant, STARDATE, try:
-
make clobber TIME=5000000 alt
+
make clobber TIME=5000000 alt
You can combine them both of course.
Alternate use:
Use prog.alt as you would prog above. Remember that ports < 1024 are
@@ -194,14 +194,14 @@ a client-side downloader. The hidden transmitted data cannot be reconstructed
or even detected from the binary content of the traffic between the client and
the server.
To use web server
-
./prog< secret_file_to_be_downloaded
+
./prog < secret_file_to_be_downloaded
Try using the program’s source code as the secret file:
-
./prog< prog.c
+
./prog < prog.c
To use client-side downloader
-
./prog http://host[:port]
+
./prog http://host[:port]
The optional port defaults to 1701. If the web server instance is started on
the same box, try:
-
./prog http://127.0.0.1:1701
+
./prog http://127.0.0.1:1701
It will incrementally display the contents of the hidden file at a rate of
approximately 1 baud.
The client-side downloader will automatically terminate if the web server is
@@ -296,15 +296,15 @@ numerical values.
Compiler warnings
For space considerations, the following include statements were dropped
resulting in compiler warnings:
It may be necessary to restore some of these under certain environments.
make
```
@@ -12,14 +12,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./prog
```
@@ -36,7 +36,7 @@ recognisable and also to let you reconfigure the coordinates.
### Alternate build:
-```sh
+```
make alt
```
@@ -45,7 +45,7 @@ If you wish to redefine the coordinates you can do so by defining `X1`, `X2`,
For instance:
-```sh
+```
make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt
```
@@ -59,7 +59,7 @@ Use `prog.alt` as you would `prog`.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -94,7 +94,7 @@ The usage of recognizable elements from the C programming language in the
application source code is intentionally kept to a bare minimum. If this phrase
would not be true, the application would be the following:
-```c
+```
double _[]={-2
,1,-1.3 ,1.3, 0, 0,0,0
,0 ,0,50, 80, 0,0,0 ,255
diff --git a/2014/deak/index.html b/2014/deak/index.html
index 411177387..23d4020de 100644
--- a/2014/deak/index.html
+++ b/2014/deak/index.html
@@ -141,15 +141,15 @@ Location: ZZ - Unknown location
To build:
-
make
+
make
There is an alternate version that the author provided but fixed in 2023 to
compile with modern systems and to allow one to reconfigure the constants X1,
X2, Y1 and Y2 (which were magic numbers). See Alternate
code below.
To use:
-
./prog
+
./prog
Try:
-
./prog
+
./prog
Try changing bounding box coordinates in the source to explore
various regions of the fractal.
Alternate code:
@@ -157,16 +157,16 @@ various regions of the fractal.
easily see the difference in what it might look like if the C was more
recognisable and also to let you reconfigure the coordinates.
Alternate build:
-
make alt
+
make alt
If you wish to redefine the coordinates you can do so by defining X1, X2,
Y1 and/or Y2, which default to: -2, 1, -1.3 and 1.3 respectively.
For instance:
-
make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt
+
make clobber X1=-3 X2=2 Y1=-2.3 Y2=2.3 alt
You may pick and choose which ones to redefine.
Alternate use:
Use prog.alt as you would prog.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
We consider this entry a tribute to all “Abuse of the C preprocessor”
and Mandelbrot fractal drawing entries we’ve seen over the years.
@@ -186,25 +186,25 @@ drawer. There are tools much better suited for drawing fractals.
The usage of recognizable elements from the C programming language in the
application source code is intentionally kept to a bare minimum. If this phrase
would not be true, the application would be the following:
The application expects no parameters, the only way you can change the behaviour
is to modify the source code at the indicated location: the line
/* <-- Configure here: X1, X2, Y1, Y2 */ is intentionally not obfuscated so
diff --git a/2014/endoh1/README.md b/2014/endoh1/README.md
index cc5cac99b..d00af19ec 100644
--- a/2014/endoh1/README.md
+++ b/2014/endoh1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog > foo.c
```
## Try:
-```sh
+```
./try.sh
```
@@ -36,14 +36,14 @@ What is the difference between running `./prog` and `main`?
Big terminals with tiny fonts have their uses in certain cases.
One of them is:
-```sh
+```
make treacl
./treacl
```
which is shorthand for:
-```sh
+```
./prog < prog.c > treacle.c
make treacle
./treacle
diff --git a/2014/endoh1/index.html b/2014/endoh1/index.html
index c681be18c..f2e8d1c8d 100644
--- a/2014/endoh1/index.html
+++ b/2014/endoh1/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./prog> foo.c
+
./prog > foo.c
Try:
-
./try.sh
+
./try.sh
The script will ask you if you wish to run make rake but this is not necessary
to fully enjoy the entry. make rake will run the rake.sh script and
then prog if all is built okay. If rake is not installed then it will check
@@ -159,12 +159,12 @@ build main.c.
Judges’ remarks:
Big terminals with tiny fonts have their uses in certain cases.
One of them is:
QR code error correction level is fixed to L (Low).
diff --git a/2014/endoh1/spoilers.md b/2014/endoh1/spoilers.md
index cbd9e6be5..9b6a7c5e8 100644
--- a/2014/endoh1/spoilers.md
+++ b/2014/endoh1/spoilers.md
@@ -18,7 +18,7 @@ Do you think that it is possible to write QR code encoder in C within *1kB*?
It is known that we can mitigate the quine restriction by `eval`.
For example, this is a quine written in Ruby:
-```ruby
+```
eval s="print 'eval s='; p s"
```
@@ -122,7 +122,7 @@ The compiler tool chain is the following.
You can run the process by `rake` command. `ruby-minisat` gem is needed.
-```sh
+```
$ gem install ruby-minisat
$ rake
```
@@ -145,7 +145,7 @@ but it appears to no longer exist.
You can use [tool.rb](tool.rb) to convert the output to a png file.
-```sh
+```
./main Hello | ruby tool.rb > hello.png
$ zbarimg -q hello.png
diff --git a/2014/endoh2/README.md b/2014/endoh2/README.md
index a50b8ac12..09de3a71d 100644
--- a/2014/endoh2/README.md
+++ b/2014/endoh2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog < input > output
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2014/endoh2/index.html b/2014/endoh2/index.html
index 4782ca187..f1836437e 100644
--- a/2014/endoh2/index.html
+++ b/2014/endoh2/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./prog< input > output
+
./prog < input > output
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
If you look closely at the source, you will see code that appears
to puts C code that includes itself. How and why? Perhaps it is
diff --git a/2014/maffiodo1/README.md b/2014/maffiodo1/README.md
index 4fc3a9559..9318eca63 100644
--- a/2014/maffiodo1/README.md
+++ b/2014/maffiodo1/README.md
@@ -3,7 +3,7 @@
This entry requires SDL to be installed. See [FAQ 3.8](../../faq.html#SDL) if you
don't know how to do this for your system.
-```sh
+```
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2014 maffiodo1 bugs](../../bugs.html#2014_maf
## To use:
-```sh
+```
cat game.level | ./prog 320 200 800 300 128 144 game.rgba game.wav 10343679
```
@@ -41,7 +41,7 @@ note on macOS.
## Try:
-```sh
+```
./giana.sh
./mario.sh
@@ -61,7 +61,7 @@ try:
If you wish to change the width and height, defaulting at 640 x 480, say to
800 x 800, try:
-```sh
+```
ROWS=800 COLS=800 ./mario.sh
ROWS=800 COLS=800 ./giana.sh
@@ -92,14 +92,14 @@ immediately take effect.
Use `tabsize=4` to see the magic.
-```sh
+```
expand -t 4 prog.c
```
The program returns 0 if the player wins or *non-zero* if the player loses so
you can test it and make something useful (or not), like this:
-```sh
+```
cat mario.level | ./prog 320 200 800 300 128 144 mario.rgba mario8.wav 10343679 && telnet telehack.com 23
```
@@ -228,7 +228,7 @@ You can input as many objects as you want but the maximum number of objects
handled by the program is 333. You can modify this value by editing the source
here:
-```c
+```
C[333*7],d=333;
```
diff --git a/2014/maffiodo1/index.html b/2014/maffiodo1/index.html
index 26f81ed02..58dd9b127 100644
--- a/2014/maffiodo1/index.html
+++ b/2014/maffiodo1/index.html
@@ -143,13 +143,13 @@ Location: IT - Italian Republic (<
To build:
This entry requires SDL to be installed. See FAQ 3.8 if you
don’t know how to do this for your system.
This is an engine for platform
game. It can be used to create
@@ -288,7 +288,7 @@ to create.
You can input as many objects as you want but the maximum number of objects
handled by the program is 333. You can modify this value by editing the source
here:
-
C[333*7],d=333;
+
C[333*7],d=333;
Each row has six columns:
Screen X : x position of the object in the level.
diff --git a/2014/maffiodo2/README.md b/2014/maffiodo2/README.md
index 263750a94..cd0256e5c 100644
--- a/2014/maffiodo2/README.md
+++ b/2014/maffiodo2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,14 +21,14 @@ For more detailed information see [2014 maffiodo2 bugs](../../bugs.html#2014_maf
## To use:
-```sh
+```
./prog arg
```
## Try:
-```sh
+```
./try.sh
```
@@ -41,14 +41,14 @@ as fun but it's 121 bytes instead of 140.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
cat image.rgb | ./prog.alt
```
@@ -91,7 +91,7 @@ The program will crash if run without parameters.
If you have a terminal geometry than is different from the common 80x25 you can
modify the *output width* by changing the value of the first variable:
-```c
+```
d=80,
```
@@ -99,14 +99,14 @@ modify the *output width* by changing the value of the first variable:
Type this:
-```sh
+```
cat image.rgb | ./prog " .:;Y0"
```
You can use your own image. Convert the image to a raw RGB image. Using
ImageMagick it's very simple:
-```sh
+```
convert -geometry 80x source.jpg image.rgb
```
@@ -116,7 +116,7 @@ program is the *conversion ramp*. You can use different ramps or create your own
These are some ramps you can try:
-```sh
+```
./prog " :1"
./prog " .:;Y0"
./prog " .:-=+*#%@"
@@ -127,7 +127,7 @@ These are some ramps you can try:
An alternative version of this program is only 121bytes long:
-```c
+```
d=80,e,j;g(){j+=getchar();}main(){for(;;){j=0;g();if(j<0)break;g(g());putchar(" .:#@"[j/3*5>>8]);if(!(++e%d))puts("");}}
```
diff --git a/2014/maffiodo2/index.html b/2014/maffiodo2/index.html
index 4db3fb827..2b31cc991 100644
--- a/2014/maffiodo2/index.html
+++ b/2014/maffiodo2/index.html
@@ -141,7 +141,7 @@ Location: IT - Italian Republic (<
To build:
-
make
+
make
There is a 121 byte version provided by the author. See Alternate
code below.
This shorter version is provided by the author. It has a fixed ramp and so not
as fun but it’s 121 bytes instead of 140.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
cat image.rgb |./prog.alt
+
cat image.rgb | ./prog.alt
Judges’ remarks:
On the face of it :-) given what this program does one might wonder what makes
this winning entry special. But when you realize the source is small enough for posting
@@ -185,24 +185,24 @@ from stdin and print the ASCII ART to stdout.
Screen size
If you have a terminal geometry than is different from the common 80x25 you can
modify the output width by changing the value of the first variable:
-
d=80,
+
d=80,
Something to try
Type this:
-
cat image.rgb |./prog" .:;Y0"
+
cat image.rgb | ./prog " .:;Y0"
You can use your own image. Convert the image to a raw RGB image. Using
ImageMagick it’s very simple:
-
convert-geometry 80x source.jpg image.rgb
+
convert -geometry 80x source.jpg image.rgb
This program require one parameter or it will crash. The parameter of the
program is the conversion ramp. You can use different ramps or create your own
(for example using some letters of your name).
This alternative version has a fixed ramp. It’s smaller but it’s not so fun to use…
make
```
## To use:
-```sh
+```
./prog [arg ..]
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2014/morgan/index.html b/2014/morgan/index.html
index 52bd24006..f7ead3afd 100644
--- a/2014/morgan/index.html
+++ b/2014/morgan/index.html
@@ -141,11 +141,11 @@ Location: FR - French Republic (
To build:
-
make
+
make
To use:
-
./prog [arg ..]
+
./prog [arg ..]
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Think of this as a Maker Faire’s make. :-)
It works reasonably well. While not super ultra-featured, it does fair well
diff --git a/2014/sinon/README.md b/2014/sinon/README.md
index 4ab27d50e..21fca6b31 100644
--- a/2014/sinon/README.md
+++ b/2014/sinon/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./hecate.sh
./glock.sh
@@ -16,7 +16,7 @@
## Try:
-```sh
+```
./try.sh
```
@@ -41,7 +41,7 @@ under one minute.
To start, compile and run the program. To resume, compile and run the
output repeatedly until you have won/lost the game. For example:
-```sh
+```
cp prog.c run.c
gcc -O0 run.c -o run && ./run | tee run.c
gcc -O2 run.c -o run && ./run | tee run.c
@@ -106,7 +106,7 @@ a primary input.
that there are no files named "run" and "run.c" in current directory
(they will be overwritten) and run:
-```sh
+```
perl prog.c | bash
```
diff --git a/2014/sinon/index.html b/2014/sinon/index.html
index 3f0da5d4e..75412c006 100644
--- a/2014/sinon/index.html
+++ b/2014/sinon/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./hecate.sh
-
-./glock.sh
+
./hecate.sh
+
+ ./glock.sh
Try:
-
./try.sh
+
./try.sh
This script will ask you if you wish to try again after each run. Type in any
character other than y or Y to exit at this point.
Judges’ remarks:
@@ -160,10 +160,10 @@ or unspecified behavior?
under one minute.
To start, compile and run the program. To resume, compile and run the
output repeatedly until you have won/lost the game. For example:
-
cp prog.c run.c
-gcc-O0 run.c -o run &&./run|tee run.c
-gcc-O2 run.c -o run &&./run|tee run.c
-...
+
cp prog.c run.c
+ gcc -O0 run.c -o run && ./run | tee run.c
+ gcc -O2 run.c -o run && ./run | tee run.c
+ ...
Details
Sinon is played by compiling and running the output repeatedly. Two
factors determine what actions are taken:
@@ -211,7 +211,7 @@ a primary input.
Sinon has a demo mode that plays the game automatically. Make sure
that there are no files named “run” and “run.c” in current directory
(they will be overwritten) and run:
-
perl prog.c |bash
+
perl prog.c | bash
File size and CRC32 of prog.c are embedded in line 7.
Process for making Sinon is included in spoiler.html.
Layout of this code is based on Asada Shino, also known as “Sinon”,
diff --git a/2014/skeggs/README.md b/2014/skeggs/README.md
index e3f6a624d..450b1f4d6 100644
--- a/2014/skeggs/README.md
+++ b/2014/skeggs/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
diff --git a/2014/skeggs/index.html b/2014/skeggs/index.html
index 61990b927..83e11cfba 100644
--- a/2014/skeggs/index.html
+++ b/2014/skeggs/index.html
@@ -141,9 +141,9 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./prog
+
./prog
HINT: Try pressing the left and right arrow keys as needed.
Also try pressing space/enter to select options.
Pressing Q or Escape may end the fun before you are ready. :-)
diff --git a/2014/vik/README.md b/2014/vik/README.md
index 4cee168f8..117183dd4 100644
--- a/2014/vik/README.md
+++ b/2014/vik/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -22,7 +22,7 @@ For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik).
## To use:
-```sh
+```
echo foo | ./prog > audio_file.raw
echo foo | ./prog | mplayer -demuxer rawaudio -
@@ -31,7 +31,7 @@ For more detailed information see [2014 vik bugs](../../bugs.html#2014_vik).
## Try:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ instructions on how to get it to work with Windows.
### Alternate build:
-```sh
+```
make alt
```
@@ -59,13 +59,13 @@ Use `prog.alt` as you would `prog` above as well as below.
This program sets a new tone for obfuscation. But do you understand
what it says about obfuscation? Perhaps:
-```sh
+```
./prog < prog.c > prog.raw
```
might speak to your coding style? If not, then perhaps:
-```sh
+```
./prog < README.md | mplayer -demuxer rawaudio -
```
@@ -87,7 +87,7 @@ Don't forget the last '`-`' as it makes `mplayer(1)` read from `stdin`.
## Convert audio file with Morse signals to text
-```sh
+```
./prog e < audio_file.raw
```
@@ -106,7 +106,7 @@ Microsoft compilers add a carriage return to newlines, and to compile the
program with this platform, the following line can be added to `main()` before
any code in order for the program to run correctly:
-```c
+```
_setmode(_fileno(stdout), 0x8000);
```
diff --git a/2014/vik/index.html b/2014/vik/index.html
index cec2d9147..f069e3609 100644
--- a/2014/vik/index.html
+++ b/2014/vik/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version that will theoretically work with Windows
compilers (if anything in Windows works :-) ). See the Alternate
code section below.
The alternate code, prog.alt.c, is based on the author’s
instructions on how to get it to work with Windows.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above as well as below.
Judges’ remarks:
This program sets a new tone for obfuscation. But do you understand
what it says about obfuscation? Perhaps:
-
./prog< prog.c > prog.raw
+
./prog < prog.c > prog.raw
might speak to your coding style? If not, then perhaps:
-
./prog< README.md |mplayer-demuxer rawaudio -
+
./prog < README.md | mplayer -demuxer rawaudio -
might help? :-)
Author’s remarks:
Remarks
@@ -177,7 +177,7 @@ I can tell, there are at least six chocolate references in this program.
Via streaming to mplayer(1), you can listen to the Morse audio.
Don’t forget the last ‘-’ as it makes mplayer(1) read from stdin.
Convert audio file with Morse signals to text
-
./prog e < audio_file.raw
+
./prog e < audio_file.raw
or alternatively pass a .wav file as input.
The preferred input format 44.1kHz stereo, but it does a decent job on mono
input and different frequencies as well.
@@ -187,7 +187,7 @@ the program relies on writing binary data to stdout.
Microsoft compilers add a carriage return to newlines, and to compile the
program with this platform, the following line can be added to main() before
any code in order for the program to run correctly:
The program uses a quite simple algorithm for detecting tone on and off events
diff --git a/2014/wiedijk/README.md b/2014/wiedijk/README.md
index 12785a580..a5b70fe87 100644
--- a/2014/wiedijk/README.md
+++ b/2014/wiedijk/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -22,7 +22,7 @@ By default that will use `indent(1)` found by the shell `type -P indent` and
`sed(1)` found by the shell `type -P sed` but if you want to change these, say
to try a different beautifier, you can do it like:
-```sh
+```
INDENT=bcpp ./try.sh
```
diff --git a/2014/wiedijk/index.html b/2014/wiedijk/index.html
index 10b81cb71..3a43b987b 100644
--- a/2014/wiedijk/index.html
+++ b/2014/wiedijk/index.html
@@ -141,15 +141,15 @@ Location: NL - Kingdom of the Netherlan
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
./try.sh
+
./try.sh
By default that will use indent(1) found by the shell type -P indent and
sed(1) found by the shell type -P sed but if you want to change these, say
to try a different beautifier, you can do it like:
-
INDENT=bcpp ./try.sh
+
INDENT=bcpp ./try.sh
which would change it to use bcpp(1) instead of indent(1). Do similar for
sed(1) only use the name SED.
Judges’ remarks:
diff --git a/2015/burton/README.md b/2015/burton/README.md
index 7e336f4d6..cb6fcc0bc 100644
--- a/2015/burton/README.md
+++ b/2015/burton/README.md
@@ -1,19 +1,19 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog "expression"
```
or:
-```sh
+```
./prog
```
@@ -22,13 +22,13 @@ Type in expressions on standard input.
## Try:
-```sh
+```
./try.sh
```
Notice how the script reads in from a file. If you type just:
-```sh
+```
./prog
```
@@ -37,7 +37,7 @@ it will prompt you in the same way. Send ctrl-c to exit.
Finally, if you wish to read the man page:
-```sh
+```
man ./calc.1
```
@@ -51,7 +51,7 @@ author's remarks below.
### Alternate build:
-```sh
+```
make alt
```
@@ -109,7 +109,7 @@ Yes, this is another calculator program.
However, unlike any other calculator source code the author is aware of,
this one contains no digits. At all. Anywhere. As in
-```sh
+```
grep '[0-9]' prog.c || echo no digits!
```
@@ -222,7 +222,7 @@ With `-Wall -std=c99`, both are quite noisy, and all can be ignored:
If the program name begins with an `e`, it echoes `stdin` to `stdout`.
This allows for a convenient test suite:
-```sh
+```
ln -sf prog eprog
PATH=. eprog < test.in | diff - test.out
```
diff --git a/2015/burton/index.html b/2015/burton/index.html
index 1d410a944..687a19a71 100644
--- a/2015/burton/index.html
+++ b/2015/burton/index.html
@@ -141,25 +141,25 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./prog"expression"
+
./prog "expression"
or:
-
./prog
+
./prog
Type in expressions on standard input.
Try:
-
./try.sh
+
./try.sh
Notice how the script reads in from a file. If you type just:
-
./prog
+
./prog
it will prompt you in the same way. Send ctrl-c to exit.
Finally, if you wish to read the man page:
-
man ./calc.1
+
man ./calc.1
Alternate code:
An alternate version of this entry, prog.alt.c, is provided.
This alternate code is discussed in the “prog.c vs prog.alt.c” section of the
author’s remarks below.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -189,7 +189,7 @@ corrected by adding -fsigned-char to the compile line.
Yes, this is another calculator program.
However, unlike any other calculator source code the author is aware of,
this one contains no digits. At all. Anywhere. As in
-
grep'[0-9]' prog.c ||echo no digits!
+
grep '[0-9]' prog.c || echo no digits!
Nor are the digits simply obfuscated. There are no character constants. There
is only one single, short string, and it does not contain any obfuscated digits.
And yet the output is in decimal and hexadecimal, and it accepts octal, decimal,
@@ -265,8 +265,8 @@ To stifle these complaints:
Test Suite:
If the program name begins with an e, it echoes stdin to stdout.
This allows for a convenient test suite:
If you do not want to puzzle out how it works, see spoilers.html.
make
```
To change the dimensions you can use the `WIDTH` and `HEIGHT` variables when
compiling (default 1024 x 800):
-```sh
+```
make clobber WIDTH=640 HEIGHT=480
```
@@ -22,14 +22,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./prog
```
@@ -77,7 +77,7 @@ This alt version does this for you.
### Alternate build:
-```sh
+```
make alt
```
@@ -174,7 +174,7 @@ important support of up to 32 function keys keyboards without spilling over the
size limit, and allows us to use such fun expression for arrow view control as
the following:
-```c
+```
*(a&1?&C:&B)-=(.05 -a/2%2*.1)*!(a-1&4092^3920)
```
diff --git a/2015/dogon/index.html b/2015/dogon/index.html
index b94523632..17a1afcd0 100644
--- a/2015/dogon/index.html
+++ b/2015/dogon/index.html
@@ -141,19 +141,19 @@ Location: IL - State of Israel (
To build:
-
make
+
make
To change the dimensions you can use the WIDTH and HEIGHT variables when
compiling (default 1024 x 800):
-
make clobber WIDTH=640 HEIGHT=480
+
make clobber WIDTH=640 HEIGHT=480
to make the game 640 x 480. Obviously changing it to non numbers or negative
numbers or too large numbers will cause problems.
There is an alternate version that is based on the author’s suggestion to change
a value in order to see a bug that they avoided in their entry. See Alternate
code below.
To use:
-
./prog
+
./prog
Try:
-
./prog
+
./prog
Press and hold the Left Arrow key until you turn 90-degrees to the left.
When you see a long tunnel, press the function key F2.
Use the Up, Down, Left and Right keys to change your path.
@@ -176,7 +176,7 @@ again.
direction of the main tunnel.
This alt version does this for you.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
@@ -246,7 +246,7 @@ important support of up to 32 function keys keyboards without spilling over the
size limit, and allows us to use such fun expression for arrow view control as
the following:
-
*(a&1?&C:&B)-=(.05-a/2%2*.1)*!(a-1&4092^3920)
+
*(a&1?&C:&B)-=(.05 -a/2%2*.1)*!(a-1&4092^3920)
Precision issues:
The entry, on purpose, (see the section about SIMD below) does not use enough
bits of precision, so sometimes the ray will miss the intersection of two voxel
diff --git a/2015/duble/README.md b/2015/duble/README.md
index b93c41b44..a66439c62 100644
--- a/2015/duble/README.md
+++ b/2015/duble/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ See [Alternate code](#alternate-code) below.
## To use:
-```sh
+```
echo Some text | ./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -34,7 +34,7 @@ author in the '[prog.c](prog.c) vs [prog.alt.c](prog.alt.c)' section of their re
### Alternate build:
-```sh
+```
make alt
```
@@ -84,13 +84,13 @@ been shortened in this file.
If you have `clang`:
-```sh
+```
CC=clang make -e
```
Otherwise (gcc):
-```sh
+```
make
```
@@ -116,7 +116,7 @@ needed in this case).
#### Basic mode:
-```sh
+```
$ echo 'I am testing this thing.' | ./prog
[... rendering ...]
@@ -127,7 +127,7 @@ needed in this case).
#### Interactive mode:
-```sh
+```
$ ./prog
> hello world!!!
[... rendering ...]
@@ -206,7 +206,7 @@ simple text documents.
Thus, if you try for example:
-```sh
+```
$ ./prog < prog.c
```
@@ -219,7 +219,7 @@ you are curious. :)
Defining an environment variable called `DRAFT` will enable the 'draft-mode'.
Try for example:
-```sh
+```
$ echo 'testing the draft mode' | DRAFT=1 ./prog
```
diff --git a/2015/duble/index.html b/2015/duble/index.html
index d0819b66a..13373cfae 100644
--- a/2015/duble/index.html
+++ b/2015/duble/index.html
@@ -141,13 +141,13 @@ Location: FR - French Republic (
To build:
-
make
+
make
There is an alternate version of this entry, discussed in the author’s remarks.
See Alternate code below.
To use:
-
echo Some text |./prog
+
echo Some text | ./prog
Try:
-
./try.sh
+
./try.sh
As the script says if you want to move to the next command at any point
(lorem-ipsum.txt takes a while to print in particular) you may do so by hitting
ctrl-c/sending intr.
@@ -155,7 +155,7 @@ ctrl-c/sending intr.
This alternate code, provided by the author, is discussed in more detail by the
author in the ‘prog.c vs prog.alt.c’ section of their remarks.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -181,9 +181,9 @@ with other compilers or optimization levels). These have been fixed in
been shortened in this file.
How to build
If you have clang:
-
CC=clang make-e
+
CC=clang make -e
Otherwise (gcc):
-
make
+
make
(You will get a few warnings in this case.)
How to use it
You need a terminal configured to handle a UTF-8 encoding and a font including
@@ -196,16 +196,16 @@ configuration was needed.
I also tested it on FreeBSD 9.3 32bits (font and encoding configuration was
needed in this case).
Basic mode:
-
$ echo 'I am testing this thing.'|./prog
-[... rendering ...]
-
-$ ./prog < lorem-ipsum.txt
-[... rendering ...]
Finally, open http://127.0.0.1:10333/ in a modern browser supporting HTML5.
You can use the mouse cursor to place drops into the Petri
dish interactively.
diff --git a/2015/endoh2/README.md b/2015/endoh2/README.md
index 7193fc798..4c03bea91 100644
--- a/2015/endoh2/README.md
+++ b/2015/endoh2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -31,7 +31,7 @@ At this point you might be wondering, [WTF](http://acronyms.thefreedictionary.co
How is this code obfuscated? Well look again:
-```sh
+```
less prog.c
more prog.c
@@ -49,7 +49,7 @@ If you are still puzzled, look at [prog.c](prog.c) with your favorite text edito
**Follow these instructions literally!**
-```sh
+```
cat prog.c
gcc -w -o prog prog.c
./prog
diff --git a/2015/endoh2/index.html b/2015/endoh2/index.html
index fac413246..950828a5c 100644
--- a/2015/endoh2/index.html
+++ b/2015/endoh2/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
Where did those underscores come from? Well RTFS!**
** Read the Freaking Source (polite form)
** Read The Freaking Screen (polite form)
If you are still puzzled, look at prog.c with your favorite text editor.
Author’s remarks:
Follow these instructions literally!
-
cat prog.c
-gcc-w-o prog prog.c
-./prog
+
cat prog.c
+ gcc -w -o prog prog.c
+ ./prog
You will do a double take.
Hint 1: Do less prog.c. You will see an emphasized string if your
terminal supports bold.
diff --git a/2015/endoh3/README.md b/2015/endoh3/README.md
index 70ad55fa8..6fe56a12b 100644
--- a/2015/endoh3/README.md
+++ b/2015/endoh3/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
@@ -16,7 +16,7 @@
To see the original [mullender](mullender.c) in action:
-```sh
+```
./try.sh
```
@@ -26,7 +26,7 @@ like at the end. Send INTR to end the program.
More generally use:
-```sh
+```
cc -o prog prog.c foo.c
./prog
^C # if necessary, where ^C is ctrl-C, interrrupt
@@ -71,7 +71,7 @@ Read it upside down.)
You got it? This program is supposed to be used in this way:
-```sh
+```
wget https://www.ioccc.org/1984/mullender.c
clang -o prog prog.c mullender.c
./prog
diff --git a/2015/endoh3/index.html b/2015/endoh3/index.html
index 6740a5d56..8458cbe2a 100644
--- a/2015/endoh3/index.html
+++ b/2015/endoh3/index.html
@@ -141,19 +141,19 @@ Location: JP - Japan
Observe what happens when you hit enter or another character! You might even try
typing out, one character at a time, 1984/mullender, and then see what it looks
like at the end. Send INTR to end the program.
More generally use:
-
cc-o prog prog.c foo.c
-./prog
-^C# if necessary, where ^C is ctrl-C, interrrupt
+
cc -o prog prog.c foo.c
+ ./prog
+ ^C # if necessary, where ^C is ctrl-C, interrrupt
to compile and run prog as whatever foo.c is in the joke PDP-11 emulator.
Judges’ remarks:
Like Marty and
@@ -181,9 +181,9 @@ the source code from all angles..
This program is a joke PDP-11 emulator. (“ll-dpd” is embedded in the code.
Read it upside down.)
You got it? This program is supposed to be used in this way:
There is an alt version which is the originally submitted entry. See Alternate
code below for details.
To use:
-
./prog<a number of arguments>
+
./prog <a number of arguments>
Try:
-
./try.sh
+
./try.sh
Alternate code:
An alternate version of this entry, prog.alt.c, is provided.
This alternate code does not contain improvements suggested by Gil
Dogon; it is the author’s original entry.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -163,14 +163,14 @@ run out of command line argument space? How could you modify the program to
experiment with numbers that have more or larger factors?
A good start for understanding this entry might be
rfc1321.txt. How does it compute this using only a
@@ -159,11 +159,11 @@ algorithm is about 355 lines of code, yet this entry is only 199 lines with
one statement per line and it isn’t using lots of macro expansion tricks like
the reference code!
What happens with a large file? Something over 256K.
-
./prog< large_file
+
./prog < large_file
Where does that message come from?
Author’s remarks:
This looks like a normal C program.
diff --git a/2015/howe/README.md b/2015/howe/README.md
index 5e49afbd7..4d741f51b 100644
--- a/2015/howe/README.md
+++ b/2015/howe/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ below.
## To use:
-```sh
+```
./prog file1 file2
./prog -d file1 file2
@@ -19,7 +19,7 @@ below.
## Try:
-```sh
+```
./try.sh
```
@@ -32,7 +32,7 @@ entry but was changed to be the alt version.
### Alternate build:
-```sh
+```
make alt
```
diff --git a/2015/howe/index.html b/2015/howe/index.html
index 162456e7a..b01943aeb 100644
--- a/2015/howe/index.html
+++ b/2015/howe/index.html
@@ -141,20 +141,20 @@ Location: CA - Canada
To build:
-
make
+
make
There is an alternate version provided. See Alternate code
below.
To use:
-
./prog file1 file2
-
-./prog-d file1 file2
+
./prog file1 file2
+
+ ./prog -d file1 file2
Try:
-
./try.sh
+
./try.sh
Alternate code:
This alternate version does not use a 64-bit FNV hash. This was the original
entry but was changed to be the alt version.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
diff --git a/2015/mills1/README.md b/2015/mills1/README.md
index c9bec2e96..bdfd62035 100644
--- a/2015/mills1/README.md
+++ b/2015/mills1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./prog
```
@@ -27,13 +27,13 @@ Did you find that mobile application game a bit frustrating?
Well you can adjust the Makefile parameters to make life a
bit easier for you:
-```sh
+```
./try.sh
```
which runs:
-```sh
+```
make clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150
./prog
```
@@ -147,13 +147,13 @@ to make some changes to the `Makefile` to get emojis to work on your system.
To help you get started, I've included some example substitutions for emojis
sprites and instruction text; for example, type
-```sh
+```
make EMOJI=beer LANGUAGE=spanish
```
or
-```sh
+```
make EMOJI=globe
```
diff --git a/2015/mills1/index.html b/2015/mills1/index.html
index a3f046538..06efc3166 100644
--- a/2015/mills1/index.html
+++ b/2015/mills1/index.html
@@ -141,20 +141,20 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
./prog
+
./prog
Press the up arrow and the down arrow at the right time.
Judges’ remarks:
Did you find that mobile application game a bit frustrating?
Well you can adjust the Makefile parameters to make life a
bit easier for you:
-
./try.sh
+
./try.sh
which runs:
-
make clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150
-./prog
+
make clobber all DW=199999 DW=22 DH=16 DA=50 DI=-150
+ ./prog
From the Makefile:
# Game parameters
#
@@ -240,9 +240,9 @@ characters (needed for UTF-8 support, which is needed for emojis), you may need
to make some changes to the Makefile to get emojis to work on your system.
To help you get started, I’ve included some example substitutions for emojis
sprites and instruction text; for example, type
-
make EMOJI=beer LANGUAGE=spanish
+
make EMOJI=beer LANGUAGE=spanish
or
-
make EMOJI=globe
+
make EMOJI=globe
for some examples (the full list of options is in the Makefile). Don’t forget
to make clobber first (or use make -B). If the output doesn’t look right,
you may need to link with the “wide” version of ncurses. On MacOSX 10.11, it
diff --git a/2015/mills2/README.md b/2015/mills2/README.md
index eda7f95de..0151a9a8c 100644
--- a/2015/mills2/README.md
+++ b/2015/mills2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2015 mills2 bugs](../../bugs.html#2015_mills2
## To use:
-```sh
+```
./prog compressed_file.Z
```
## Try:
-```sh
+```
./try.sh
```
@@ -39,7 +39,7 @@ for a `compress(1)`-like compressor using a similar idea.
Why is the sad smiley on line 12 in that particular place?
-```c
+```
c=0) :( O
```
@@ -66,7 +66,7 @@ on the command line. On the odd chance you don't have `compress(1)` hanging abo
on your system, I've provided compressed copies of this year's IOCCC rules
and guidelines files. To print them, just do
-```sh
+```
./prog ioccc_guidelines.txt.Z
./prog ioccc_rules.txt.Z
```
diff --git a/2015/mills2/index.html b/2015/mills2/index.html
index f9f814716..19f86d034 100644
--- a/2015/mills2/index.html
+++ b/2015/mills2/index.html
@@ -141,22 +141,22 @@ Location: US - United States of America
Without ASCII art, the source code of this entry would have been exactly 256
bytes. Compared to 1990/jaw, it is very
impressive, even taking into account the missing atob functionality. Now we wish
for a compress(1)-like compressor using a similar idea.
Why is the sad smiley on line 12 in that particular place?
-
c=0):( O
+
c=0) :( O
Author’s remarks:
The Program
This program is an implementation of the unix zcat(1) command for printing
@@ -174,8 +174,8 @@ single function and a few ints.
on the command line. On the odd chance you don’t have compress(1) hanging about
on your system, I’ve provided compressed copies of this year’s IOCCC rules
and guidelines files. To print them, just do
The basic cleverness here comes from realizing that the compressed data is
itself an encoded version of the code dictionary. When the encoder sees
diff --git a/2015/muth/README.md b/2015/muth/README.md
index 2a3a97bf0..2f325f02b 100644
--- a/2015/muth/README.md
+++ b/2015/muth/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
```
## Try:
-```sh
+```
./try.sh
```
@@ -68,13 +68,13 @@ files for examples.
Every symbol used (except `_`) must be explicitly declared using
-```c
+```
#define sym_SYMBOL(sym, _SYMBOL) sym
```
Example:
-```c
+```
#define sym_1(sym, _1) sym
```
@@ -84,7 +84,7 @@ Example:
The initial content of the tape must be defined in the tape header using a
triple like:
-```c
+```
#define tape ((((,),...l2), l1), c, (r1, (r2..., (,))))
```
@@ -119,7 +119,7 @@ machine.
To halt the machine, use the keyword `break` as in
-```c
+```
#define A_1 (2, break)
```
diff --git a/2015/muth/index.html b/2015/muth/index.html
index b9d3699b7..d957f0c57 100644
--- a/2015/muth/index.html
+++ b/2015/muth/index.html
@@ -141,11 +141,11 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
To use:
-
make-B[MACHINE=your_machine.h][TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
+
make -B [MACHINE=your_machine.h] [TAPE=your_tape.h] [X=[0|1|2|3|4|5|6|7|8|9]] [V=[0|1|2]] run
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
This is something we were fearing all along: that the C preprocessor is Turing-complete
even without conditionals and recursive file inclusion as some kind of a
@@ -179,13 +179,13 @@ macros in the output.
files for examples.
Tape Symbols
Every symbol used (except _) must be explicitly declared using
-
#define sym_SYMBOL(sym, _SYMBOL) sym
+
#define sym_SYMBOL(sym, _SYMBOL) sym
Example:
-
#define sym_1(sym, _1) sym
+
#define sym_1(sym, _1) sym
Tape
The initial content of the tape must be defined in the tape header using a
triple like:
There must be a state A defined, which becomes the initial state of the
machine.
To halt the machine, use the keyword break as in
-
#define A_1 (2,break)
+
#define A_1 (2, break)
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2015 schweikhardt bugs](../../bugs.html#2015_
## To use:
-```sh
+```
./prog n
```
@@ -30,7 +30,7 @@ doing something else. The author explains this in more details.
## Try:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ where zeroes move to the right.
This code is clean. When you compile with all warnings enabled,
such as with clang:
-```sh
+```
cc -Weverything -pedantic -std=c11 -Dtyp=uint64\_t -O3 prog.c -o prog
```
@@ -73,7 +73,7 @@ the [Collatz conjecture](https://en.wikipedia.org/wiki/Collatz_conjecture).
You may explore this famous conjecture using this entry:
-```sh
+```
./prog 2410
./prog abfff
./prog 27f8cebf
@@ -158,7 +158,7 @@ prefix) as the first argument. The program prints the given number in
zero-padded hex and each iteration along with a line count in decimal.
The example above looks like this (compiled with 64 bit word size):
-```sh
+```
$ ./prog 6
0000000000000006
0000000000000003 1
@@ -175,7 +175,7 @@ The size of `n` is only limited by the argument size limit of your
shell/OS (the program implements arbitrary size `bignum`s).
To query this on your POSIX system, run
-```sh
+```
$ getconf ARG_MAX
262144
```
@@ -187,7 +187,7 @@ Fear not,
[bc(1)](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/bc.html)
to the rescue:
-```sh
+```
$ printf 'obase=16;10^100\n' | bc
1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F1000000000\
0000000000000000
@@ -333,7 +333,7 @@ hard, I could use `__LINE__` and `stdio.h` macros `EOF`, `L_tmpnam`,
Another identity operation. I've done it for you already. Use this
`.indent.pro` with FreeBSD indent:
-```sh
+```
$ cat .indent.pro
-bad /* blank line after decls */
-bap /* blank line after functions */
@@ -383,7 +383,7 @@ Spoilers ahead. Duh!
Pseudocode, with comments matching those in the C source:
-```c
+```
/* run */
if (non-NULL and nonempty argv[1]) {
n = convert(argv[1])
@@ -404,7 +404,7 @@ Pseudocode, with comments matching those in the C source:
`Bignum`s are represented as the two member `struct`s:
-```c
+```
typedef struct {
size_t places; /* number of places in base 2 to the power of (8*sizeof(type)) */
type *number; /* dynamically allocated memory for number */
@@ -438,7 +438,7 @@ into a starting number (which is output as the first line), and starts
crunching. Nothing stops you from executing
-```sh
+```
./prog "$(cat prog.c)" # Kind of quine?
./prog "$(cat rules guidelines)" # A jackpot? Maybe next year...
./prog "$(cat /bin/ls)" # Number cut short at first NUL byte.
@@ -473,7 +473,7 @@ The open source static checker [cppcheck](http://cppcheck.sourceforge.net/)
checks various problems with respect to style, performance, portability
and general fishiness. To enable all checks, run
-```sh
+```
cppcheck --enable=all --force -I/usr/include -Dtyp=uint32_t prog.c
```
@@ -486,7 +486,7 @@ checks various problems with respect to security like buffer overflows,
function arguments to known troublemaker functions and more. It doesn't need to
pre-process code, so can be run without the `typ` macro being defined:
-```sh
+```
$ flawfinder prog.c
Flawfinder version 1.31, (C) 2001-2014 David A. Wheeler.
Number of rules (primarily dangerous function names) in C/C++ ruleset: 169
@@ -592,7 +592,7 @@ use for checking your C programs and I highly recommend trying it. For a start,
paste the well know first program in the form and press "Analyze Code". Note
the FlexeLint configuration options in comments (no space between `/*` and `lint`).
-```c
+```
/*lint -w4 turn on everything */
/*lint +esym(534,*) no demonstrator defaults */
/*lint -e966 indirectly included header file not used */
@@ -705,7 +705,7 @@ expressions other than assignments to `char` objects. A consequence is
that printing digits with `'0' + digit` is not allowed (even though
`'0'` is technically an `int`!) so I am forced to output hex digits with
-```c
+```
printf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2))));
```
@@ -730,7 +730,7 @@ precedence rules in expressions." This requires parentheses for almost
all expressions involving more than one operator, especially those for which
a cast is required, leading to hard to understand expressions such as
-```c
+```
const ser glx = (ser)((asx > (ser)64u) ? (ser)((ser)asx + (ser)8u + (ser)1u) : (ser)asx);
not.not[leu] = (and)((and)not.not[leu] | (and)(((and)glx % (and)16u) << (and)lys));
```
@@ -747,7 +747,7 @@ MISRA 16.10: "If a function returns error information, then that error
information shall be tested." A cast to `void` would draw a lint warning, so
I use the `printf(3)` result in expressions,
-```c
+```
lys -= 4 * printf("%c", (met)tyr + 32 + 16 + ((8 + EOF) * ((met)tyr / (8 + 2))));
val += printf("\n") / ((__LINE__ * L_tmpnam) + TMP_MAX);
val -= (printf(" %d\n", val) > BUFSIZ) ? FILENAME_MAX : EOF;
@@ -755,7 +755,7 @@ I use the `printf(3)` result in expressions,
which are, in the absence of errors, equivalent to
-```c
+```
lys -= 4;
/*nop*/
++val;
@@ -772,7 +772,7 @@ declared as pointer to `const` if the pointer is not used to modify the
addressed object." in conjunction with lint's "Note 952: Parameter could
be declared `const`" causes `const`-poisoning for all functions,
-```c
+```
static void phe(const ala not);
static void gly(ala *const not, const and his);
met main(met val, const pro *const his[]);
@@ -792,13 +792,13 @@ up :-) (humor really helps!)"
If your compiler supports a 128 bit wide type (e.g. clang, gcc) then
you can use it via the `typ` macro:
-```sh
+```
clang -Dtyp=__uint128_t -o prog prog.c
```
Indeed, the program can use (and lints clean for) all of
-```sh
+```
clang -Dtyp=uint8_t -o prog8 prog.c
clang -Dtyp=uint16_t -o prog16 prog.c
clang -Dtyp=uint32_t -o prog32 prog.c
diff --git a/2015/schweikhardt/index.html b/2015/schweikhardt/index.html
index 27cd588ef..be701333a 100644
--- a/2015/schweikhardt/index.html
+++ b/2015/schweikhardt/index.html
@@ -141,25 +141,25 @@ Location: DE - Federal Republic of Germ
NOTE: although it’s supposed to be a base 16 number nothing will stop you from
doing something else. The author explains this in more details.
Try:
-
./try.sh
+
./try.sh
After running it once to see what commands are run, you might wish to run it a
second time and just hold down space to see a fun scroll of numbers especially
where zeroes move to the right.
Judges’ remarks:
This code is clean. When you compile with all warnings enabled,
such as with clang:
NOTE: try.sh runs these for you, filtered through less(1).
When you first look at the source, the code looks fairly straightforward.
But look again. Like the Collatz conjecture, simplicity is deceptive!
@@ -238,33 +238,33 @@ and stops at 1. The number n is specified in hexadecim
prefix) as the first argument. The program prints the given number in
zero-padded hex and each iteration along with a line count in decimal.
The example above looks like this (compiled with 64 bit word size):
The size of n is only limited by the argument size limit of your
shell/OS (the program implements arbitrary size bignums).
To query this on your POSIX system, run
-
$ getconf ARG_MAX
-262144
+
$ getconf ARG_MAX
+ 262144
which reports the limit in bytes, here 256KB. This allows to test
whether a Googol, which is
10100, satisfies the conjecture. But what is a googol in hex?
Fear not,
bc(1)
to the rescue:
$ printf 'obase=16;10^100\n' | bc
+ 1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F1000000000\
+ 0000000000000000
+ $ ./prog 1249AD2594C37CEB0B2784C4CE0BF38ACE408E211A7CAAB24308A82E8F10000000000000000000000000 \
+ | less
+ [...]
Observe how the first 100 iterations melt the zeros to the right. Can you explain
why?
For a given n the program behavior is one of the following 3:
@@ -373,24 +373,24 @@ hard, I could use __LINE__ and stdio.h macros EO
Run it through a C beautifier
Another identity operation. I’ve done it for you already. Use this
.indent.pro with FreeBSD indent:
-
$ cat .indent.pro
--bad /* blank line after decls */
--bap /* blank line after functions */
--br /* braces on if line */
--i8 /* indent */
--l999 /* line length */
--npcs /* no space after function call names */
--npsl /* don't break procedure type */
- -ut /* use tabs */
- -ce /* cuddle else */
- -nip /* no parameter indentation */
- -di1 /* declaration indent */
- -Tand
- -Tmet
- -Tthr
- -Tpro
- -Tser
- -Tala
+
$ cat .indent.pro
+ -bad /* blank line after decls */
+ -bap /* blank line after functions */
+ -br /* braces on if line */
+ -i8 /* indent */
+ -l999 /* line length */
+ -npcs /* no space after function call names */
+ -npsl /* don't break procedure type */
+ -ut /* use tabs */
+ -ce /* cuddle else */
+ -nip /* no parameter indentation */
+ -di1 /* declaration indent */
+ -Tand
+ -Tmet
+ -Tthr
+ -Tpro
+ -Tser
+ -Tala
It looks like a perfect program should have:
two and a half #includes of non-suspicious standard headers
@@ -415,27 +415,27 @@ to be.
Examine the algorithm
Spoilers ahead. Duh!
Pseudocode, with comments matching those in the C source:
-
/* run */
-if(non-NULL and nonempty argv[1]){
- n = convert(argv[1])
- print n /* 2hx */
-while(n !=1){/* one */
-if(n is odd){/* odd */
- m = deep copy of n /* cpy */
- n <<=1/* shl */
- n += m /* add */
- increment n /* inc */
-}else{/* eve */
- n >>=1/* shr */
-}
- print n /* 2hx */
-}
-}
+
/* run */
+ if (non-NULL and nonempty argv[1]) {
+ n = convert(argv[1])
+ print n /* 2hx */
+ while (n != 1) { /* one */
+ if (n is odd) { /* odd */
+ m = deep copy of n /* cpy */
+ n <<= 1 /* shl */
+ n += m /* add */
+ increment n /* inc */
+ } else { /* eve */
+ n >>= 1 /* shr */
+ }
+ print n /* 2hx */
+ }
+ }
Bignums are represented as the two member structs:
-
typedefstruct{
-size_t places;/* number of places in base 2 to the power of (8*sizeof(type)) */
- type *number;/* dynamically allocated memory for number */
-} bignum
+
typedef struct {
+ size_t places; /* number of places in base 2 to the power of (8*sizeof(type)) */
+ type *number; /* dynamically allocated memory for number */
+ } bignum
Compile it (with flags to enable all warnings)
Here’s where the program shines brighter than a gamma-ray
burst!
@@ -452,9 +452,9 @@ expected.
This means however, that the program accepts any string, turns it
into a starting number (which is output as the first line), and starts
crunching. Nothing stops you from executing
-
./prog"$(cat prog.c)"# Kind of quine?
-./prog"$(cat rules guidelines)"# A jackpot? Maybe next year...
-./prog"$(cat /bin/ls)"# Number cut short at first NUL byte.
+
./prog "$(cat prog.c)" # Kind of quine?
+ ./prog "$(cat rules guidelines)" # A jackpot? Maybe next year...
+ ./prog "$(cat /bin/ls)" # Number cut short at first NUL byte.
In a certain way, the program is character set and encoding agnostic.
Assumptions made
@@ -475,20 +475,20 @@ use 8 * sizeof(typ) bits per place. It does not work when CHA
The open source static checker cppcheck
checks various problems with respect to style, performance, portability
and general fishiness. To enable all checks, run
The open source static checker flawfinder
checks various problems with respect to security like buffer overflows,
function arguments to known troublemaker functions and more. It doesn’t need to
pre-process code, so can be run without the typ macro being defined:
-
$ flawfinder prog.c
-Flawfinder version 1.31, (C)2001-2014 David A. Wheeler.
-Number of rules (primarily dangerous function names)inC/C++ ruleset: 169
-Examining prog.c
-FINAL RESULTS:
-ANALYSIS SUMMARY:
-No hits found.
+
$ flawfinder prog.c
+ Flawfinder version 1.31, (C) 2001-2014 David A. Wheeler.
+ Number of rules (primarily dangerous function names) in C/C++ ruleset: 169
+ Examining prog.c
+ FINAL RESULTS:
+ ANALYSIS SUMMARY:
+ No hits found.
valgrind
The open source dynamic checker valgrind runs an
executable and verifies all memory accesses and (de)allocations for proper
@@ -572,18 +572,18 @@ demonstrator you can
use for checking your C programs and I highly recommend trying it. For a start,
paste the well know first program in the form and press “Analyze Code”. Note
the FlexeLint configuration options in comments (no space between /* and lint).
-
/*lint -w4 turn on everything */
-/*lint +esym(534,*) no demonstrator defaults */
-/*lint -e966 indirectly included header file not used */
-/*lint -esym(9058,_*) tag not used outside typedef */
-/*lint -misra(2) */
-
-#include <stdio.h>
-int main(void)
-{
- printf("hello, world\n");
-return0;
-}
+
/*lint -w4 turn on everything */
+ /*lint +esym(534,*) no demonstrator defaults */
+ /*lint -e966 indirectly included header file not used */
+ /*lint -esym(9058,_*) tag not used outside typedef */
+ /*lint -misra(2) */
+
+ #include <stdio.h>
+ int main(void)
+ {
+ printf("hello, world\n");
+ return 0;
+ }
Possible checks include those for MISRA 2004 compliance verification.
The Motor Industry Software Reliability
Association
@@ -675,7 +675,7 @@ use of character values.” This forbids using character constants in
expressions other than assignments to char objects. A consequence is
that printing digits with '0' + digit is not allowed (even though
'0' is technically an int!) so I am forced to output hex digits with
because of the “no magic numbers other than powers of two” rule. How is this
an improvement over printf("%c", '0' + tyr + 7 * (tyr / 10), MISRA?
MISRA 6.3: “typedefs that indicate size and signedness should be used in
@@ -691,8 +691,8 @@ redundant casting ensues. It gets worse with the next rule…
precedence rules in expressions.” This requires parentheses for almost
all expressions involving more than one operator, especially those for which
a cast is required, leading to hard to understand expressions such as
-
const ser glx =(ser)((asx >(ser)64u)?(ser)((ser)asx +(ser)8u+(ser)1u):(ser)asx);
- not.not[leu]=(and)((and)not.not[leu]|(and)(((and)glx %(and)16u)<<(and)lys));
MISRA 14.7: “A function shall have a single point of exit at the end of
the function.” Sigh. Since I must use eloquent prototypes (8.1, 16.3,
16.4) and static functions (8.10, 8.11), I can only use a few functions.
@@ -703,22 +703,22 @@ too high for a sane function.
MISRA 16.10: “If a function returns error information, then that error
information shall be tested.” A cast to void would draw a lint warning, so
I use the printf(3) result in expressions,
which are, in the absence of errors, equivalent to
-
lys -=4;
-/*nop*/
-++val;
+
lys -= 4;
+ /*nop*/
+ ++val;
MISRA 13.1: “Assignment operators shall not be used in expressions that
yield a Boolean value.” Forbids the idiomatic if ((p = malloc(n)) == NULL) and requires separate statements, in other words, bloat.
MISRA 16.7: “A pointer parameter in a function prototype should be
declared as pointer to const if the pointer is not used to modify the
addressed object.” in conjunction with lint’s “Note 952: Parameter could
be declared const” causes const-poisoning for all functions,
-
staticvoid phe(const ala not);
-staticvoid gly(ala *const not,const and his);
- met main(met val,const pro *const his[]);
+
static void phe(const ala not);
+ static void gly(ala *const not, const and his);
+ met main(met val, const pro *const his[]);
and quite a number of automatic variables.
Why the “laugh” and “throw up” messages?
The guidelines state “We like programs that: make us laugh and/or throw
@@ -726,13 +726,13 @@ up :-) (humor really helps!)”
If you have a 128 bit type
If your compiler supports a 128 bit wide type (e.g. clang, gcc) then
you can use it via the typ macro:
-
clang-Dtyp=__uint128_t -o prog prog.c
+
clang -Dtyp=__uint128_t -o prog prog.c
Indeed, the program can use (and lints clean for) all of
This works because the program has no need for corresponding SCN or PRI
macros to do the scanning and printing of variables of these types. With a 128
bit type the program can represent numbers up to
diff --git a/2015/yang/README.md b/2015/yang/README.md
index 9116877a7..304af9a2c 100644
--- a/2015/yang/README.md
+++ b/2015/yang/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
echo Some text | ./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -37,7 +37,7 @@ so you need not worry about this.
`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 on `stdout`.
-```sh
+```
cc -O3 -std=c90 fuuko.c -lm -o fuuko_c90
echo IOCCC | ./fuuko_c90 > output_c90.c
```
@@ -45,7 +45,7 @@ her some input through `stdin` to get lots of sea star patterns on `stdout`.
If you compile with a C99 compiler instead of C90, the sea stars will
have eyes.
-```sh
+```
cc -O3 -std=c99 fuuko.c -lm -o fuuko_c99
echo IOCCC | ./fuuko_c99 > output_c99.c
```
@@ -53,7 +53,7 @@ have eyes.
Don't like [sea stars](https://en.wikipedia.org/wiki/Starfish)? Use a C++98
compiler to get a [dango](https://en.wikipedia.org/wiki/Dango) instead.
-```sh
+```
g++ -O3 -std=c++98 fuuko.c -lm -o fuuko_cpp98
echo IOCCC | ./fuuko_cpp98 > output_cpp98.c
```
@@ -63,7 +63,7 @@ compiler to get just [circles](https://en.wikipedia.org/wiki/Circle) (or [Swiss
cheese](https://en.wikipedia.org/wiki/Swiss_cheeses_and_dairy_products), if you
prefer that).
-```sh
+```
g++ -O3 -std=c++11 fuuko.c -lm -o fuuko_cpp11
echo IOCCC | ./fuuko_cpp11 > output_cpp11.c
```
@@ -71,7 +71,7 @@ prefer that).
Don't like any of these patterns? Use a C11 compiler and there will be
no extra pattern.
-```sh
+```
cc -O3 -std=c11 fuuko.c -lm -o fuuko_c11
echo IOCCC | ./fuuko_c11 > output_c11.c
```
diff --git a/2015/yang/index.html b/2015/yang/index.html
index 567b9d1b1..3d9e4b2f0 100644
--- a/2015/yang/index.html
+++ b/2015/yang/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
echo Some text |./prog
+
echo Some text | ./prog
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Before analysing the code in detail we were able to guess two out of four tests
this entry uses to tell the 5 languages/flavors apart. Can you find all four?
@@ -157,26 +157,26 @@ so you need not worry about this.
Author’s remarks:
Fuuko is a sea star generator. Feed
her some input through stdin to get lots of sea star patterns on stdout.
Regardless of which of these C/C++ dialects you choose, the output
will all be valid C90 code that reproduces original input on stdout,
filled with pointer dereferences (C stars).
diff --git a/2018/algmyr/README.md b/2018/algmyr/README.md
index f97116b54..290432773 100644
--- a/2018/algmyr/README.md
+++ b/2018/algmyr/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -22,7 +22,7 @@ For more detailed information see [2018 algmyr bugs](../../bugs.html#2018_algmyr
## To use:
-```sh
+```
./prog < prog.c # Print garbage: might mess up your terminal
./prog > out.raw
./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
@@ -31,7 +31,7 @@ For more detailed information see [2018 algmyr bugs](../../bugs.html#2018_algmyr
## Try:
-```sh
+```
./try.sh
```
@@ -164,13 +164,13 @@ standards compliant). This is used to print the usage instructions.
Compiling using
-```sh
+```
gcc -Wall -Wextra -pedantic
```
gives only `-Wmisleading-indentation` which is sensible considering the source code. While
-```sh
+```
clang -Wall -Wextra -pedantic
```
@@ -179,7 +179,7 @@ bodies), `-Wstring-plus-int` (since apparently some people think string+`int` is
concatenation) and one of the weirder warnings I have seen from me splitting a
negative constant with whitespace. Compiling using
-```sh
+```
clang -Wall -Wextra -pedantic -Weverything
```
diff --git a/2018/algmyr/index.html b/2018/algmyr/index.html
index d9736f462..c8b0196e5 100644
--- a/2018/algmyr/index.html
+++ b/2018/algmyr/index.html
@@ -141,7 +141,7 @@ Location: SE - Kingdom of Sweden (
./prog< prog.c # Print garbage: might mess up your terminal
-./prog<file1><file2>> out.raw
-./prog-d 2 0 out.raw # Decode the first (0th) channel out of two
+
./prog < prog.c # Print garbage: might mess up your terminal
+ ./prog <file1> <file2> > out.raw
+ ./prog -d 2 0 out.raw # Decode the first (0th) channel out of two
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Be warned, this is not your garden variety text-to-speech program! Earplugs are advised,
or at least a handy and well-tested volume knob.
@@ -242,14 +242,14 @@ additional logic? Answer: ungetc(3) into stdin, one
Compilation warnings
Compiling using
-
gcc-Wall-Wextra-pedantic
+
gcc -Wall -Wextra -pedantic
gives only -Wmisleading-indentation which is sensible considering the source code. While
-
clang-Wall-Wextra-pedantic
+
clang -Wall -Wextra -pedantic
is a bit more pessimistic and gives -Wempty-body (I like loops without
bodies), -Wstring-plus-int (since apparently some people think string+int is a
concatenation) and one of the weirder warnings I have seen from me splitting a
negative constant with whitespace. Compiling using
-
clang-Wall-Wextra-pedantic-Weverything
+
clang -Wall -Wextra -pedantic -Weverything
produces a few page faults of warnings and makes me feel generally bad about
myself. :(
Misc
diff --git a/2018/anderson/README.md b/2018/anderson/README.md
index e95cef1d8..313369022 100644
--- a/2018/anderson/README.md
+++ b/2018/anderson/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ code](#alternate-code) below for more details.
## To use:
-```sh
+```
./prog < textfile
```
## Try:
-```sh
+```
./try.sh
```
@@ -31,7 +31,7 @@ it was not the shape of the Roman V that we, or the compiler, didn't like.
### Alternate build:
-```sh
+```
make alt
```
@@ -43,7 +43,7 @@ Use `prog.alt` as you would `prog` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -58,7 +58,7 @@ down](http://en.wikipedia.org/wiki/River_%28typography%29)!
### Compiling the program:
-```sh
+```
cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog
```
diff --git a/2018/anderson/index.html b/2018/anderson/index.html
index e26fc1522..d6c52c91d 100644
--- a/2018/anderson/index.html
+++ b/2018/anderson/index.html
@@ -141,29 +141,29 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version of this entry. See Alternate
code below for more details.
To use:
-
./prog< textfile
+
./prog < textfile
Try:
-
./try.sh
+
./try.sh
Alternate code:
Compare prog.c and prog.alt.c and find out why we had to
modify the entry, and what confused the author (see the author’s remarks). No,
it was not the shape of the Roman V that we, or the compiler, didn’t like.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
With this entry, you won’t need to turn your monitor upside
down!
cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog
Also works with a standard of C99, but C90/C89 will not compile due to
for loop initial declarations, along with additional warnings about
variable length arrays and lack of a return statement.
diff --git a/2018/bellard/README.md b/2018/bellard/README.md
index 429e5f379..f2edcdcfd 100644
--- a/2018/bellard/README.md
+++ b/2018/bellard/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog > lena.ppm
```
@@ -21,7 +21,7 @@ First open [Lenna.png](Lenna.png) in your graphics viewer of choice. Next, after
running the above command (`./prog > lena.ppm`), open `lena.ppm` in your
graphics viewer of choice. After that try:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ for Windows.
### Alternate build:
-```sh
+```
make alt
```
@@ -99,7 +99,7 @@ Although the program was optimized to decompress its built-in image,
it accepts to decompress image files from its standard
input. Examples:
-```sh
+```
./prog d < lena512.bin > lena512.ppm
./prog d < fruits.bin > fruits.ppm
./prog d < vintage_cars.bin > vintage_cars.ppm
diff --git a/2018/bellard/index.html b/2018/bellard/index.html
index 4faf34ef3..1b4788a14 100644
--- a/2018/bellard/index.html
+++ b/2018/bellard/index.html
@@ -141,16 +141,16 @@ Location: FR - French Republic (
To build:
-
make
+
make
There is an alternate version that should work with Windows. See Alternate
code below.
To use:
-
./prog> lena.ppm
+
./prog > lena.ppm
Try:
First open Lenna.png in your graphics viewer of choice. Next, after
running the above command (./prog > lena.ppm), open lena.ppm in your
graphics viewer of choice. After that try:
-
./try.sh
+
./try.sh
NOTE: the script uses the tools pngtopam(1) (or pngtopnm(1) for older
versions) and pnmscale come from the netpbm project and cjpeg(1) comes from
libjpeg-turbo. If you don’t have these tools already see FAQ 3.15 - How do I
@@ -163,7 +163,7 @@ it?.
The prog.alt.c is based on the author’s remarks and it should work
for Windows.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog.
Judges’ remarks:
@@ -200,9 +200,9 @@ as the algorithms already have a significant complexity.
Although the program was optimized to decompress its built-in image,
it accepts to decompress image files from its standard
input. Examples:
-
./prog d < lena512.bin > lena512.ppm
-./prog d < fruits.bin > fruits.ppm
-./prog d < vintage_cars.bin > vintage_cars.ppm
+
./prog d < lena512.bin > lena512.ppm
+ ./prog d < fruits.bin > fruits.ppm
+ ./prog d < vintage_cars.bin > vintage_cars.ppm
The original images for fruits and vintage cars come from
Wikipedia and were resized to a width of 1024 pixels.
The program should be portable on any Unix system. On Windows the line
diff --git a/2018/burton1/README.md b/2018/burton1/README.md
index c98896bb8..e947c8bb6 100644
--- a/2018/burton1/README.md
+++ b/2018/burton1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog < any-file
```
## Try:
-```sh
+```
./try.sh
```
@@ -32,7 +32,7 @@ with `-Wno-` options.
### Alternate build:
-```sh
+```
make alt
```
@@ -82,7 +82,7 @@ and without bypassing the solution using `execve(2)`, or functions built upon it
E.g:
-```c
+```
main(){system("hd");} // it's turtles all the way down!
```
@@ -96,7 +96,7 @@ This solution is pleasing, but a true one-liner was the hoped-for goal.
Here is the 157 character version in it's entirety:
-```c
+```
char O,o[ 20];L(O){
putchar ( O+ 48+39 *(9<
O));} I(O) {L(~ 15);
@@ -115,7 +115,7 @@ The progression to the present size is interesting,
and it is interesting that the same algorithm can be expressed so differently
by slight rearrangement of its parts.
-```c
+```
// 119
char O,o[20];main(l){for(;~(l=getchar());O||puts(o))o[O++]=isprint(l)?l:46,O&=15,printf("%02x ",l);O[o]=0;O&&puts(o);}
// 116
@@ -139,7 +139,7 @@ These do not compete in the same category, since their output is materially diff
They are derived from the solutions above, but are still fascinating as concise utilities,
so here is their progression, for the curious:
-```c
+```
// 102
I;O(O){putchar(O+48+39*(9>4),O(l&15);O(-38);}
// 80
@@ -156,7 +156,7 @@ It is possible to reduce the size of each of these by one by eliding the trailin
This was not reported above since the newline kept getting appended by processing software,
and it is more interesting to remove characters by changing code than by filtering:
-```sh
+```
$ tr -d '\012' < 109.c | wc -c
108
$ tr -d '\012' < 76.c | wc -c
@@ -257,13 +257,13 @@ the expression within the ternary remains too complex.
Try:
-```sh
+```
cat prog.c prog.alt.c
```
or
-```sh
+```
cmp -b prog.c prog.alt.c
```
diff --git a/2018/burton1/index.html b/2018/burton1/index.html
index f977f41c1..9f52063a8 100644
--- a/2018/burton1/index.html
+++ b/2018/burton1/index.html
@@ -141,20 +141,20 @@ Location: US - United States of America
To build:
-
make
+
make
There is an alternate version of this entry. See Alternate
code below.
To use:
-
./prog< any-file
+
./prog < any-file
Try:
-
./try.sh
+
./try.sh
Alternate code:
An alternate version of this entry, prog.alt.c, is provided
This alternate code was supposed to compile without warnings, however
with modern compilers this is no longer the case so it will only cleanly compile
with -Wno- options.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog.
Judges’ remarks:
@@ -187,68 +187,68 @@ and without bypassing the solution using execve(2), or functions bu
(system(3), popen(3), etc).
E.g:
-
main(){system("hd");}// it's turtles all the way down!
+
main(){system("hd");} // it's turtles all the way down!
is not acceptable.
And, “output correctly” is the output format of this entry. QED.
Early attempts ended up at a reasonably short 157 characters.
This was too long for a one-liner, so it had to be formatted as something more interesting.
This solution is pleasing, but a true one-liner was the hoped-for goal.
Here is the 157 character version in it’s entirety:
While thinking about this in the shower (you are not the only one that does this!)
came the idea which reduced the code to just 119 chars.
This dramatic reduction started to feel close to minimal, and the hunt resumed.
The progression to the present size is interesting,
and it is interesting that the same algorithm can be expressed so differently
by slight rearrangement of its parts.
There are solutions without the ASCII sidebar that are significantly shorter.
These do not compete in the same category, since their output is materially different.
They are derived from the solutions above, but are still fascinating as concise utilities,
so here is their progression, for the curious:
It is possible to reduce the size of each of these by one by eliding the trailing newline.
This was not reported above since the newline kept getting appended by processing software,
and it is more interesting to remove characters by changing code than by filtering:
An obfuscated hex dump has been done before:
1986/bright is similar in function,
but it uses more characters in just setting up its obfuscation than this entire
@@ -321,9 +321,9 @@ perhaps – the smallest, clean-compiling version using clang or not
work with the original Ritchie PDP-11 C compiler, since
the expression within the ternary remains too complex.
Try:
-
cat prog.c prog.alt.c
+
cat prog.c prog.alt.c
or
-
cmp-b prog.c prog.alt.c
+
cmp -b prog.c prog.alt.c
to compare the differences (diff is not helpful on a one-liner).
make
```
## To use:
-```sh
+```
./prog [-tcksri] < file.c
```
## Try:
-```sh
+```
./try.sh
```
If you get really stuck, try:
-```sh
+```
man ./tac.1
```
@@ -113,7 +113,7 @@ There is one (known) remaining problem with detection:
* Comments between preprocessor hash and keyword are not replaced with whitespace;
the following counts #include as two tokens, `#` and `include` (not as a reserved word):
-```c
+```
#/*this will not be counted*/include/*correctly*/
```
@@ -128,14 +128,14 @@ counting words correctly absent `-k`.
`tac` was run over all 366 previous IOCCC winning entries:
-```sh
+```
find ~/src/obc -type f -name \*.c | wc
```
The discrepancies found are documented and explained in the file
[discrepancies.html](discrepancies.html).
-```sh
+```
find ~/src/obc -type f -a -name "*.c" | xargs ./spotcheck.sh ./prog | ./spotdiff.sh |
grep -v keep | diff -bw - discrep* | grep "[<>] cl "
```
@@ -181,14 +181,14 @@ For instance, here is a simple token counter, useful in finding repeated long to
frequency, or counting the references to identifiers, constants, or breadth of use of the
language:
-```sh
+```
#!/usr/bin/env bash
cat $* | ./prog -t | sort | uniq -c | sort -k1nr
```
And here is a C keyword frequency counter:
-```sh
+```
#!/usr/bin/env bash
function iskeyword {
awk 'BEGIN{f="c11";while(getline
#!/usr/bin/env bash
script='
BEGIN {
@@ -342,7 +342,7 @@ which is neither complete (`#define`, `#ifndef`, `#undef` are missing
-- yes, Virginia knows about `#define` omitted on purpose),
nor correct (many more are added: `I`, `true`, `bool`, `compl`, ...):
-```sh
+```
(sed -n '1p' c11; sed -n '2,$p' ioccc.kw.freq | sort) | comm -3 - c11
```
@@ -383,7 +383,7 @@ NB: This is *not* a portability concern, the one string holds only printable ASC
Thus:
-```sh
+```
cc -ansi -Wall -trigraphs -Wno-trigraphs -Wno-parentheses -Wno-empty-body -Wno-char-subscripts -Wno-pointer-sign -DU=O -DW=\"keywords\" -o prog prog.c
```
@@ -403,7 +403,7 @@ are not recognised when written as `-rs` in prose).
Try:
-```sh
+```
./manpage.sh tac
./manpage.sh -h
diff --git a/2018/burton2/index.html b/2018/burton2/index.html
index 4fd39c4c5..4a387a984 100644
--- a/2018/burton2/index.html
+++ b/2018/burton2/index.html
@@ -141,13 +141,13 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./prog[-tcksri]< file.c
+
./prog [-tcksri] < file.c
Try:
-
./try.sh
+
./try.sh
If you get really stuck, try:
-
man ./tac.1
+
man ./tac.1
Judges’ remarks:
They say size isn’t everything, and in the case of IOCCC
iocccsize.c that is saying something!
@@ -228,17 +228,17 @@ quote consumes everything until the next quote
Comments between preprocessor hash and keyword are not replaced with whitespace;
the following counts #include as two tokens, # and include (not as a reserved word):
-
#/*this will not be counted*/include/*correctly*/<stdio.h>
+
#/*this will not be counted*/include/*correctly*/<stdio.h>
Fixing this properly hampers backwards compatibility in counting. This requires
eliding comments during the translation phases (ISO 5.1.1.2, phase 3), and yet still
counting words correctly absent -k.
Backwards Compatibility:
tac was run over all 366 previous IOCCC winning entries:
-
find ~/src/obc -type f -name\*.c |wc
+
find ~/src/obc -type f -name \*.c | wc
The discrepancies found are documented and explained in the file
discrepancies.html.
In summary, there are only 6 unique entries out of 366 that have any variation
in Rule 2 counts; in all cases, the differences are due to bugs within
iocccsize, described in detail in the file
@@ -273,14 +273,14 @@ This feature enables interesting analyses of C (and C++) code that’s hard to g
For instance, here is a simple token counter, useful in finding repeated long tokens, or operator
frequency, or counting the references to identifiers, constants, or breadth of use of the
language:
#!/usr/bin/env bash
-function iskeyword{
-awk'BEGIN{f="c11";while(getline<f)k[$1]=0} {if($1 in k)k[$1]++}END{for(i in k)print k[i],i}'
-}
-cat$*|./prog-t|iskeyword|sort-k1nr
+
#!/usr/bin/env bash
+ function iskeyword {
+ awk 'BEGIN{f="c11";while(getline<f)k[$1]=0} {if($1 in k)k[$1]++}END{for(i in k)print k[i],i}'
+ }
+ cat $* | ./prog -t | iskeyword | sort -k1nr
This script was used to “optimize” the reserved word order so the most frequent IOCCC
winning entry keywords are checked first.
An interesting aside: as might be expected, obfuscation has changed the frequency of
@@ -299,47 +299,47 @@ handful of simple rules (and another use of the external keyword file). A more
refined version of this is included in the file unob.sh, but the
simple code below is a serviceable obfuscated C de-obfuscator in a scripting
language. It really is this easy with tac:
@@ -401,7 +401,7 @@ the IOJCC trash can.
which is neither complete (#define, #ifndef, #undef are missing
– yes, Virginia knows about #define omitted on purpose),
nor correct (many more are added: I, true, bool, compl, …):
-
(sed -n '1p' c11; sed -n '2,$p' ioccc.kw.freq | sort) | comm -3 - c11
That is an obfuscated way to say “diff”. But it also more clearly shows the, um, diffs.
The usage string is similarly externalized, providing a better usability string than
the limits would otherwise allow. If this is considered bending the rules too far,
@@ -429,7 +429,7 @@ for obfuscation. Thus -trigraphs -Wno-trigraphs (which is also humo
The code uses unsigned chars, but C strings are signed. Thus -Wno-pointer-sign.
NB: This is not a portability concern, the one string holds only printable ASCII characters.
Cody Boone Ferguson was relentless in his pursuit of bugs.
Thanks to his reports, the version of unob.sh is stronger,
@@ -442,12 +442,12 @@ works well on most inputs, but tends to need some raw nroff for more fancy
constructions, such as combined arguments (e.g. the -r and -s arguments to tac
are not recognised when written as -rs in prose).
diff --git a/2018/endoh1/README.md b/2018/endoh1/README.md
index e3d54e5fd..35ac6dd74 100644
--- a/2018/endoh1/README.md
+++ b/2018/endoh1/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog < textfile > output.gif
```
@@ -16,7 +16,7 @@
To see the input files and feed them to the program, redirecting to GIF files:
-```sh
+```
./try.sh
```
@@ -40,7 +40,7 @@ least 2MiB of memory to run in.
This program generates an animated GIF from a plain text. Run:
-```sh
+```
cc -o prog prog.c
./prog < invisible.txt > invisible.gif
```
@@ -51,14 +51,14 @@ letters that leave the mark and ones that do not?
Other examples:
-```sh
+```
./prog < golem.txt > golem.gif
./prog < smily.txt > smily.gif
```
The program itself has a hidden message.
-```sh
+```
./prog < prog.c > prog.gif
```
diff --git a/2018/endoh1/index.html b/2018/endoh1/index.html
index f429b12f4..58c6b42b2 100644
--- a/2018/endoh1/index.html
+++ b/2018/endoh1/index.html
@@ -141,12 +141,12 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./prog< textfile > output.gif
+
./prog < textfile > output.gif
Try:
To see the input files and feed them to the program, redirecting to GIF files:
-
./try.sh
+
./try.sh
Judges’ remarks:
To get the best experience, use a GIF viewer that can handle animated GIFs.
With macOS you can use Safari using open -a Safari smily.gif.
@@ -158,16 +158,16 @@ how does it know which characters are closed?
least 2MiB of memory to run in.
Author’s remarks:
This program generates an animated GIF from a plain text. Run:
cc -o prog prog.c
+ ./prog < invisible.txt > invisible.gif
Open invisible.gif with a GIF viewer that can show animated GIFs and then wait
a minute. You will see a hidden message. Can you tell the difference between
letters that leave the mark and ones that do not?
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2018/endoh2/index.html b/2018/endoh2/index.html
index 0c2a959dc..7ecb6a962 100644
--- a/2018/endoh2/index.html
+++ b/2018/endoh2/index.html
@@ -141,11 +141,11 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
./try.sh
+
./try.sh
NOTE: to interrupt the loops send intr (typically ctrl-C).
Judges’ remarks:
And now for something completely different: A program whose metabolic
diff --git a/2018/ferguson/README.md b/2018/ferguson/README.md
index 7c924755f..b2ff88d50 100644
--- a/2018/ferguson/README.md
+++ b/2018/ferguson/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,14 +10,14 @@ monkey Eric. See [Alternate code](#alternate-code) below.
## To use:
-```sh
+```
./weasel
```
## Try:
-```sh
+```
./try.sh
# For those who believe in '"intelligent" design' or want to see how easy it is
@@ -47,7 +47,7 @@ about this under the [keyboards](#keyboards) section, briefly referred to in the
### Alternate build:
-```sh
+```
make alt
```
@@ -59,7 +59,7 @@ Use `weasel.alt` as you would `weasel` above.
### Alternate try:
-```sh
+```
./try.alt.sh
# For those who believe in '"intelligent" design' or want to see how easy it is
@@ -80,7 +80,7 @@ detail in the [S, M and N Constants](#constants) section. The script above will
make use of some of these.
-```sh
+```
./try.alt.sh
```
@@ -107,7 +107,7 @@ while using more Cenozoic minded code migration, read [rpm.html](rpm.html).
If you find yourself in an evolutionary dead end, try:
-```sh
+```
man ./weasel.1
```
@@ -139,7 +139,7 @@ texts. To resolve this I think the best way is referencing the judges' remarks:
if you want a quick rundown of the entry try what they suggest and view the man
page (it explains all the options and describes the program briefly):
-```sh
+```
man ./weasel.man
```
@@ -444,7 +444,7 @@ has more than one word (that is it contains spaces) or anything else interpreted
specially by your shell e.g. parentheses. For instance if you just want to find
`METHINKS` you could do one of:
-```sh
+```
./weasel METHINKS
./weasel "METHINKS"
./weasel 'METHINKS'
@@ -452,14 +452,14 @@ specially by your shell e.g. parentheses. For instance if you just want to find
If you wanted `YOU ARE A MONKEY`:
-```sh
+```
./weasel "YOU ARE A MONKEY"
./weasel 'YOU ARE A MONKEY'
```
If you do one of:
-```sh
+```
./weasel "METHINKS IT IS A" "MONKEY"
./weasel METHINKS IT IS A MONKEY
```
@@ -472,7 +472,7 @@ If you actually do want to search for a string starting with a `-` you must
disable further parsing of options by using the `-` option itself; for
example if you were to do any of:
-```sh
+```
./weasel -q- -- -test
./weasel -q- -test
./weasel -q -- -test
@@ -480,7 +480,7 @@ example if you were to do any of:
The target string will be: `-TEST`. This means though that here:
-```sh
+```
./weasel -q -- -test -r5
```
@@ -498,7 +498,7 @@ are equivalent:
As for the caveat I referenced what does the following do?
-```sh
+```
./weasel -qr 5
```
@@ -510,7 +510,7 @@ note on the parsing of the `-` option; if the program is currently parsing
the other options are in the command line it might still parse the options. Thus
you have:
-```sh
+```
$ ./weasel -qr-r5
quiet output
mutation rate out of range
@@ -522,14 +522,14 @@ you have:
Similarly this would set quiet output, then an invalid mutation rate and then a
mutation rate of 5:
-```sh
+```
./weasel --qrr5
```
If you were instead to do one of (for example):
-```sh
+```
./weasel -q -- -r
./weasel -q -q- -r
```
@@ -568,7 +568,7 @@ requested? There are at least two ways to go about it: I took the monkey safe
('fool safe') method; *if you explicitly request monkey mode you cannot disable
it in the same invocation of `weasel`!
-```sh
+```
$ ./weasel -qr101r5r101r1r test
quiet output
mutation rate out of range
@@ -633,7 +633,7 @@ in monkey mode.
Another example:
-```sh
+```
$ ./weasel -q -r101 test -r5
quiet output
mutation rate out of range
@@ -649,7 +649,7 @@ which means that it'll use the genetic algorithm.
One more example of monkey mode:
-```sh
+```
$ ./weasel -q -mr101 test -r5
quiet output
mutation rate out of range
@@ -771,13 +771,13 @@ with.
Try:
-```sh
+```
make test
```
This will essentially make sure the program is compiled and then do:
-```sh
+```
chmod +x test.sh
./test.sh
```
@@ -793,7 +793,7 @@ processed).
You can pass additional options directly to the script but remember that it
stops when there are no more strings in the file - so if you try:
-```sh
+```
./test.sh -q test
```
@@ -825,7 +825,7 @@ program prints an error message and then exits (returning 1). But since the
keyboard doesn't have `'\n'` if you were to type a `'` and send a
`'\n'` before the closing `'` you might see something like:
-```sh
+```
$ ./weasel '!!
> '
@@ -858,7 +858,7 @@ as well as some C keywords.
2. The way `main()` is declared is:
-```c
+```
/* Special C main() handler (encapsulation): */
#define r(main) main
r(k main(k a, E **V)) {
@@ -952,7 +952,7 @@ somewhere!).
The Makefile simplifies how to reconfigure this value with the variable
`MAX_SIZE`:
-```sh
+```
make clobber MAX_SIZE=55 all
```
@@ -965,7 +965,7 @@ number attempts without waiting for a very long time.
The Makefile simplifies how to reconfigure this value with the variable
`MAX_ATTEMPTS`:
-```sh
+```
make clobber MAX_ATTEMPTS=100 all
```
@@ -982,7 +982,7 @@ and the larger the values the more memory it'll require.
The Makefile simplifies how to reconfigure this value with the variable
`OFFSPRING`:
-```sh
+```
make clobber OFFSPRING=55 all
```
@@ -993,7 +993,7 @@ Skip to [Portability](#portability).
The following options **must always be passed to the compiler:**
-```sh
+```
-DQ='typedef' -D'g(o)'='goto o;' -D'w(x)'="x:" -D'H(main)'='r(main)'
```
@@ -1003,13 +1003,13 @@ which running `make` will always do.
If you want to increase the number of offspring to `50` (`N`) and the size of the
chromosome to `75` (`S`) you would do:
-```sh
+```
make clobber OFFSPRING=50 MAX_SIZE=75 everything
```
If you wanted to change `N` to `3`:
-```sh
+```
make clobber OFFSPRING=3 everything
```
@@ -1020,7 +1020,7 @@ result. Remember too that `S` (`MAX_SIZE`) cannot be less than `38`. Both `S` an
If you wanted to change the maximum number attempts to 100 you could do:
-```sh
+```
make clobber MAX_ATTEMPTS=100 everything
```
@@ -1038,7 +1038,7 @@ Originally I tested it on the below systems.
#### Fedora 26:
-```sh
+```
$ clang --version|head -n1
clang version 4.0.1 (tags/RELEASE_401/final)
$ gcc --version|head -n1
@@ -1051,7 +1051,7 @@ Originally I tested it on the below systems.
#### CentOS Linux release 7.4.1708 (Core)
-```sh
+```
$ clang --version|head -n1
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
$ gcc --version|head -n1
@@ -1064,7 +1064,7 @@ Originally I tested it on the below systems.
#### Fedora 27:
-```sh
+```
$ clang --version|head -n1
clang version 5.0.1 (tags/RELEASE_501/final)
$ gcc --version|head -n1
@@ -1080,7 +1080,7 @@ Originally I tested it on the below systems.
System Version: macOS 10.13.4 (17E199)
Kernel Version: Darwin 17.5.0
-```sh
+```
$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.1)
@@ -1209,7 +1209,7 @@ When we found others were actually trying to programs with A, we quickly added
additional cryptic features and evolved into B, BCPL, and finally C. We stopped
when we got a clean compile on the following syntax:
-```c
+```
for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/
8)%2))P("|"+(*u/4)%2);
```
@@ -1252,7 +1252,7 @@ is a lack of common sense but since he was part of its creation I don't think
it's a bad thing; **on the contrary it makes all of us C programmers even more
talented! :)** I do wonder if he tested that bit of C code though:
-```c
+```
for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/
8)%2))P("|"+(*u/4)%2);
```
diff --git a/2018/ferguson/index.html b/2018/ferguson/index.html
index bf86d8f44..bf4d3416f 100644
--- a/2018/ferguson/index.html
+++ b/2018/ferguson/index.html
@@ -141,21 +141,21 @@ Location: US - United States of America
To build:
-
make
+
make
The author provided an alternate version which has a simpler keyboard for the
monkey Eric. See Alternate code below.
To use:
-
./weasel
+
./weasel
Try:
-
./try.sh
-
-# For those who believe in '"intelligent" design' or want to see how easy it is
-# to prove evolution is a proven fact:
-./id.sh
-
-# For those who want to see if Eric the monkey can type the word 'words' before
-# falling asleep or giving up:
-./monkey-words.sh
+
./try.sh
+
+ # For those who believe in '"intelligent" design' or want to see how easy it is
+ # to prove evolution is a proven fact:
+ ./id.sh
+
+ # For those who want to see if Eric the monkey can type the word 'words' before
+ # falling asleep or giving up:
+ ./monkey-words.sh
NOTE: the try.sh script will run the other two scripts but if the
first one, id.sh is terminated early in the try script, the second one,
monkey-words.sh will not be run.
@@ -167,26 +167,26 @@ make use of some of these.
about this under the keyboards section, briefly referred to in the
what it is section.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use weasel.alt as you would weasel above.
Alternate try:
-
./try.alt.sh
-
-# For those who believe in '"intelligent" design' or want to see how easy it is
-# to prove evolution is a proven fact:
-./id.alt.sh
-
-# For those who want to see if Eric the monkey can type the word 'words' before
-# falling asleep or giving up:
-./monkey-words.alt.sh
+
./try.alt.sh
+
+ # For those who believe in '"intelligent" design' or want to see how easy it is
+ # to prove evolution is a proven fact:
+ ./id.alt.sh
+
+ # For those who want to see if Eric the monkey can type the word 'words' before
+ # falling asleep or giving up:
+ ./monkey-words.alt.sh
NOTE: the try.alt.sh script will run the other two scripts but if the
first one, id.alt.sh is terminated early in the try script, the second one,
monkey-words.alt.sh will not be run.
You can reconfigure certain values. These are described by the author in more
detail in the S, M and N Constants section. The script above will
make use of some of these.
-
./try.alt.sh
+
./try.alt.sh
You can reconfigure certain values. These are described by the author in more
detail in the S, M and N Constants section. The script above will
make use of some of these.
@@ -203,7 +203,7 @@ from the phylogenetic tree of life.
If you wish your computer to maintain one branch in the Cretaceous C code era,
while using more Cenozoic minded code migration, read rpm.html.
If you find yourself in an evolutionary dead end, try:
-
man ./weasel.1
+
man ./weasel.1
Author’s remarks:
Preface
@@ -228,7 +228,7 @@ didn’t want to reveal as much publicly and many people don’t like to read lo
texts. To resolve this I think the best way is referencing the judges’ remarks:
if you want a quick rundown of the entry try what they suggest and view the man
page (it explains all the options and describes the program briefly):
-
man ./weasel.man
+
man ./weasel.man
If that isn’t sufficient I would recommend reading this section(and
possibly the next) where I attempt to give a brief explanation of the sections
to make reading it easier and faster. In addition I want to point out a few
@@ -461,26 +461,26 @@ it must be a single parameter which means you’ll need to quote the string if i
has more than one word (that is it contains spaces) or anything else interpreted
specially by your shell e.g. parentheses. For instance if you just want to find
METHINKS you could do one of:
./weasel"YOU ARE A MONKEY"
-./weasel'YOU ARE A MONKEY'
+
./weasel "YOU ARE A MONKEY"
+ ./weasel 'YOU ARE A MONKEY'
If you do one of:
-
./weasel"METHINKS IT IS A""MONKEY"
-./weasel METHINKS IT IS A MONKEY
+
./weasel "METHINKS IT IS A" "MONKEY"
+ ./weasel METHINKS IT IS A MONKEY
It will search for MONKEY in both cases; in other words it’s the last one.
If the string is too long given the value of S (see How to build) it will be truncated.
If you actually do want to search for a string starting with a - you must
disable further parsing of options by using the - option itself; for
example if you were to do any of:
The target string will be: -TEST. This means though that here:
-
./weasel-q---test-r5
+
./weasel -q -- -test -r5
The string to be searched would actually be -r5 and the mutation rate
will remain the default because after the - option is seen it will no
longer parse additional options: only target strings if anything left on the
@@ -490,7 +490,7 @@ are equivalent:
-q-\
-q --
As for the caveat I referenced what does the following do?
-
./weasel-qr 5
+
./weasel -qr 5
In fact it will set quiet output and set the target string to be ‘5’. So the
mutation rate will be out of range, thus enabling that Easter egg, but it will
likely come to an answer fairly quickly because it’s just a single character. A
@@ -498,18 +498,18 @@ note on the parsing of the - option; if the program is currently pa
argv[N], for example, and it encounters a -- then depending on where
the other options are in the command line it might still parse the options. Thus
you have:
-
$ ./weasel -qr-r5
-quiet output
-mutation rate out of range
-target'METHINKS IT IS LIKE A WEASEL'
-mutation rate 5
-Generation 440 Offspring 20: METHINKS IT IS LIKE A WEASEL
+
$ ./weasel -qr-r5
+ quiet output
+ mutation rate out of range
+ target 'METHINKS IT IS LIKE A WEASEL'
+ mutation rate 5
+ Generation 440 Offspring 20: METHINKS IT IS LIKE A WEASEL
Similarly this would set quiet output, then an invalid mutation rate and then a
mutation rate of 5:
-
./weasel--qrr5
+
./weasel --qrr5
If you were instead to do one of (for example):
-
./weasel-q---r
-./weasel-q-q--r
+
./weasel -q -- -r
+ ./weasel -q -q- -r
Then it would set quiet output then see the -- (the - option
itself) and then the target string would literally be set to -r because
it no longer cares about the - for option parsing. In other words options
@@ -536,15 +536,15 @@ monkey mode be disabled? If yes how do we know if monkey mode was specially
requested? There are at least two ways to go about it: I took the monkey safe
(‘fool safe’) method; *if you explicitly request monkey mode you cannot disable
it in the same invocation of weasel!
-
$ ./weasel -qr101r5r101r1r test
-quiet output
-mutation rate out of range
-mutation rate out of range
-mutation rate out of range
-target'test'
-mutation rate 0
-monkey at typewriter
-Generation 16844 Offspring 22: TEST
+
$ ./weasel -qr101r5r101r1r test
+ quiet output
+ mutation rate out of range
+ mutation rate out of range
+ mutation rate out of range
+ target 'test'
+ mutation rate 0
+ monkey at typewriter
+ Generation 16844 Offspring 22: TEST
So in this case I joined the options in the following order:
-q
@@ -575,24 +575,24 @@ matter
because of truncation but I do in any case specifically check for Given that it was a short string it did find the answer relatively quickly, even
in monkey mode.
Another example:
-
$ ./weasel -q-r101 test -r5
-quiet output
-mutation rate out of range
-target'test'
-mutation rate 5
-Generation 109 Offspring 13: TEST
+
$ ./weasel -q -r101 test -r5
+ quiet output
+ mutation rate out of range
+ target 'test'
+ mutation rate 5
+ Generation 109 Offspring 13: TEST
In this case I also enabled quiet mode but I didn’t join the options; the
-r101 reports that it’s out of range and sets monkey mode. I then specify
the target string and then set a valid mutation rate. This disabled monkey mode
which means that it’ll use the genetic algorithm.
One more example of monkey mode:
-
$ ./weasel -q-mr101 test -r5
-quiet output
-mutation rate out of range
-target'test'
-mutation rate 5
-monkey at typewriter
-Generation 465298 Offspring 10: TEST
+
$ ./weasel -q -mr101 test -r5
+ quiet output
+ mutation rate out of range
+ target 'test'
+ mutation rate 5
+ monkey at typewriter
+ Generation 465298 Offspring 10: TEST
Here I also requested quiet output and then explicitly requested that Eric the
monkey types. After this I set the mutation rate to be 101 which would have
set monkey mode (in this case only temporarily as I later set it to a valid
@@ -676,10 +676,10 @@ file and pass each string to the program itself. I’ve included a script
test.sh and a file of sample input test-strings.txt that you can play
with.
Try:
-
make test
+
make test
This will essentially make sure the program is compiled and then do:
-
chmod +x test.sh
-./test.sh
+
chmod +x test.sh
+ ./test.sh
The script will first try compiling the program (if necessary) and if it fails
for any reason it will exit; else it will read each line in the file
test-strings.txt (if the file doesn’t exist or can’t be read the script will
@@ -689,7 +689,7 @@ string it’ll sleep approximately 2 seconds and then read the next string
processed).
You can pass additional options directly to the script but remember that it
stops when there are no more strings in the file - so if you try:
-
./test.sh-q test
+
./test.sh -q test
The final string test won’t be searched for; it will however run the program
in all invocations with quiet output enabled. The following are some notes about
how the shell and the program interact with each other:
@@ -713,11 +713,11 @@ and the fact the program does not accept spaces other than a literal space
program prints an error message and then exits (returning 1). But since the
keyboard doesn’t have '\n' if you were to type a ' and send a
'\n' before the closing ' you might see something like:
-
$ ./weasel '!!
- > '
-
-'
- ' not in keyboard " !"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~"
+
$ ./weasel '!!
+ > '
+
+ '
+ ' not in keyboard " !"#$<%:>&'()*+,-./0123456789;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`{|}~"
I showed that ' is in the keyboard already; however the user sent a
\n (hence the secondary prompt > on line two) before literally typing the
closing ' (also line two). But in order to make it clear what character is invalid I
@@ -737,9 +737,9 @@ rather confusing and hard to read.
as well as some C keywords.
The way main() is declared is:
-
/* Special C main() handler (encapsulation): */
-#define r(main) main
- r(k main(k a, E **V)){
+
/* Special C main() handler (encapsulation): */
+ #define r(main) main
+ r(k main(k a, E **V)) {
It appears to be recursively defined but is it? And is it truly
encapsulation? And is it executing code of any kind? It mightn’t seem like it
isn’t encapsulation and also isn’t executing code but assuming it’s
@@ -813,7 +813,7 @@ won’t spoil; yes this ironically and amusingly means I’ve left a rotten egg
somewhere!).
The Makefile simplifies how to reconfigure this value with the variable
MAX_SIZE:
-
make clobber MAX_SIZE=55 all
+
make clobber MAX_SIZE=55 all
The next macro that can be reconfigured, M (or MAX_ATTEMPTS in the
Makefile), is the maximum attempts before giving up. This was added as another
feature in 2024 but it was not made an alt version because there already is an
@@ -821,7 +821,7 @@ alt version. This macro allows for seeing what happens when reaching the maximum
number attempts without waiting for a very long time.
The Makefile simplifies how to reconfigure this value with the variable
MAX_ATTEMPTS:
-
make clobber MAX_ATTEMPTS=100 all
+
make clobber MAX_ATTEMPTS=100 all
The final macro, N (or OFFSPRING in the Makefile), is the number of offspring
per generation.
Anything less than 4 will be set to 3 (that’s not a typo!) and this is part of
@@ -831,23 +831,23 @@ both individually and together the program will use varying amounts of memory
and the larger the values the more memory it’ll require.
The Makefile simplifies how to reconfigure this value with the variable
OFFSPRING:
If you want to increase the number of offspring to 50 (N) and the size of the
chromosome to 75 (S) you would do:
-
make clobber OFFSPRING=50 MAX_SIZE=75 everything
+
make clobber OFFSPRING=50 MAX_SIZE=75 everything
If you wanted to change N to 3:
-
make clobber OFFSPRING=3 everything
+
make clobber OFFSPRING=3 everything
Remember that it cannot be less than 3; more correctly if it’s less than
4 it’s redefined to 3 so you could have passed in -DN=2 (or MAX_SIZE=2) and have the same
result. Remember too that S (MAX_SIZE) cannot be less than 38. Both S and
N are capped at SIZE_MAX - 1 or whatever M (MAX_ATTEMPTS) is set to.
If you wanted to change the maximum number attempts to 100 you could do:
This entry requires at least C99 even if you translate digraphs. The program
@@ -857,43 +857,43 @@ smaller and this I believe includes SIZE_MAX). I don’t think Wind
ports would have many issues (if any) either but I have no way to test this.
Originally I tested it on the below systems.
Fedora 26:
-
$ clang --version|head-n1
-clang version 4.0.1 (tags/RELEASE_401/final)
-$ gcc --version|head-n1
-gcc(GCC)7.3.1 20180130 (Red Hat 7.3.1-2)
-$ /lib64/libc-2.25.so |head-n1|cut-d','-f1-1
-GNU C Library (GNU libc)stable release version 2.25
-$ lscpu |grep Endian
-Byte Order: Little Endian
+
$ clang --version|head -n1
+ clang version 4.0.1 (tags/RELEASE_401/final)
+ $ gcc --version|head -n1
+ gcc (GCC) 7.3.1 20180130 (Red Hat 7.3.1-2)
+ $ /lib64/libc-2.25.so |head -n1|cut -d',' -f1-1
+ GNU C Library (GNU libc) stable release version 2.25
+ $ lscpu |grep Endian
+ Byte Order: Little Endian
CentOS Linux release 7.4.1708 (Core)
-
$ clang --version|head-n1
-clang version 3.4.2 (tags/RELEASE_34/dot2-final)
-$ gcc --version|head-n1
-gcc(GCC)4.8.5 20150623 (Red Hat 4.8.5-16)
-$ /lib64/libc-2.17.so |head-n1|cut-d,-f1-1
-GNU C Library (GNU libc)stable release version 2.17
-$ lscpu |grep Endian
-Byte Order: Little Endian
+
$ clang --version|head -n1
+ clang version 3.4.2 (tags/RELEASE_34/dot2-final)
+ $ gcc --version|head -n1
+ gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
+ $ /lib64/libc-2.17.so |head -n1 |cut -d, -f1-1
+ GNU C Library (GNU libc) stable release version 2.17
+ $ lscpu |grep Endian
+ Byte Order: Little Endian
Fedora 27:
-
$ clang --version|head-n1
-clang version 5.0.1 (tags/RELEASE_501/final)
-$ gcc --version|head-n1
-gcc(GCC)7.3.1 20180303 (Red Hat 7.3.1-5)
-$ /lib64/libc-2.26.so |head-n1|cut-d,-f1-1
-GNU C Library (GNU libc)stable release version 2.26
-$ lscpu |grep Endian
-Byte Order: Little Endian
+
$ clang --version|head -n1
+ clang version 5.0.1 (tags/RELEASE_501/final)
+ $ gcc --version|head -n1
+ gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
+ $ /lib64/libc-2.26.so |head -n1|cut -d, -f1-1
+ GNU C Library (GNU libc) stable release version 2.26
+ $ lscpu |grep Endian
+ Byte Order: Little Endian
macOS:
System Version: macOS 10.13.4 (17E199)
Kernel Version: Darwin 17.5.0
-
$ gcc -v
-Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
-Apple LLVM version 9.1.0 (clang-902.0.39.1)
-Target: x86_64-apple-darwin17.5.0
-Thread model: posix
-InstalledDir: /Library/Developer/CommandLineTools/usr/bin
-$ uname -srmv
-Darwin 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018;root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
+
$ gcc -v
+ Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
+ Apple LLVM version 9.1.0 (clang-902.0.39.1)
+ Target: x86_64-apple-darwin17.5.0
+ Thread model: posix
+ InstalledDir: /Library/Developer/CommandLineTools/usr/bin
+ $ uname -srmv
+ Darwin 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64
Any undocumented bugs are the result of insolent monkeys tampering with any
@@ -1012,8 +1012,8 @@ When we found others were actually trying to programs with A, we quickly added
additional cryptic features and evolved into B, BCPL, and finally C. We stopped
when we got a clean compile on the following syntax:
“To think that modern programmers would try to use a language that allowed
such a statement was beyond our comprehension! We actually thought of selling
@@ -1054,8 +1054,8 @@ person to talk about it with is more than welcome!
). Ken suggested that the
is a lack of common sense but since he was part of its creation I don’t think
it’s a bad thing; on the contrary it makes all of us C programmers even more
talented! :) I do wonder if he tested that bit of C code though:
-
How is R=; valid? Since I don’t have the context maybe there is something
I’m missing but either way it’s a funny piece. It could also be for irony itself
(actually I had previously thought of somehow implementing something like that
diff --git a/2018/giles/README.md b/2018/giles/README.md
index 4d6887630..7c76d3247 100644
--- a/2018/giles/README.md
+++ b/2018/giles/README.md
@@ -4,21 +4,21 @@ This entry requires SDL2 to be installed. See [FAQ 3.8: How do I compile an
IOCCC entry that requires SDL1 or SDL2?](../../faq.html#SDL) if you don't have it
installed and don't know how to do so.
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./prog ioccc.txt
./prog prog.c
diff --git a/2018/giles/index.html b/2018/giles/index.html
index cf82e435c..430def535 100644
--- a/2018/giles/index.html
+++ b/2018/giles/index.html
@@ -144,17 +144,17 @@ Location: AU - Commonwealth of Australi
NOTE: these invocations will take quite some time to finish.
Judges’ remarks:
Can you explain the behavior of the program when ioccc.txt is given
diff --git a/2018/hou/README.md b/2018/hou/README.md
index 08004924f..b72aae28a 100644
--- a/2018/hou/README.md
+++ b/2018/hou/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2018 hou bugs](../../bugs.html#2018_hou).
## To use:
-```sh
+```
./prog < input.json > output.html
```
@@ -27,7 +27,7 @@ View `output.html` in a browser.
## Try:
-```sh
+```
./try.sh
```
diff --git a/2018/hou/index.html b/2018/hou/index.html
index fe7d571de..9ce8ef778 100644
--- a/2018/hou/index.html
+++ b/2018/hou/index.html
@@ -141,16 +141,16 @@ Location: CN - People’s Republic of C
The script will generate a JSON file called ioccc.json, showing it via
tee(1) and then run the program on that. Can you find any problem with the
JSON file? What happens if you try and fix it?
diff --git a/2018/mills/README.md b/2018/mills/README.md
index 5d630e036..4719ee36b 100644
--- a/2018/mills/README.md
+++ b/2018/mills/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -8,7 +8,7 @@ If you wish to save state so that you can run the program and keep files changed
(for instance you don't want to compile `mullender.c` again) you can compile it
like:
-```sh
+```
make clobber SAVE=1 all
```
@@ -31,14 +31,14 @@ For more detailed information see [2018 mills bugs](../../bugs.html#2018_mills).
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./prog
```
@@ -47,7 +47,7 @@ At the `>boot` prompt, type return.
At the `:` prompt, type `rk(0,0)rkunix` and wait for it to initialise itself.
Now try typing:
-```sh
+```
cat > prog.c
main(){ printf("Hello, world!\n"); }
^D
@@ -59,7 +59,7 @@ where `^D` is EOF.
Next try:
-```sh
+```
cc mullender.c
a.out
```
@@ -81,7 +81,7 @@ Do small machines only need small programs? This program weighs in at just
This program can take you back to the start of everything, it is possible to
run v0. Just type:
-```sh
+```
./v0
```
@@ -91,7 +91,7 @@ You will be greeted with a familiar prompt of "login". The username and
password are "dmr" and "dmr". To make things more familiar you'll need to
create '.' as it hasn't been invented yet on this image!
-```sh
+```
@ ln dd dmr .
```
@@ -102,7 +102,7 @@ together like `ops.s bl.s hello.s bi.s` (in that order) to produce a.out!
But wait, we said this was the start of it all! This program can also run a
program that replaces an even larger machine that can run BSD 2.9. To start this,
-```sh
+```
./prog
```
@@ -118,7 +118,7 @@ shown earlier.
But wait, there is even more! Try:
-```sh
+```
./v6
```
@@ -220,7 +220,7 @@ only a quarter of a century ago -- how much could things have changed?).
Let's try some:
-```sh
+```
# ls
.cshrc .profile boot hkunix mnt tmp
.login 2.9stamp dev lib mullender.c unix
diff --git a/2018/mills/index.html b/2018/mills/index.html
index bed5d3d5a..90ad0e441 100644
--- a/2018/mills/index.html
+++ b/2018/mills/index.html
@@ -141,11 +141,11 @@ Location: US - United States of America
To build:
-
make
+
make
If you wish to save state so that you can run the program and keep files changed
(for instance you don’t want to compile mullender.c again) you can compile it
like:
-
make clobber SAVE=1 all
+
make clobber SAVE=1 all
Make sure that if you do add a file (including by compiling code) that before
you exit (ctrl-e) you type in sync! Otherwise the file might not exist or it
will be corrupt if it does.
… and enjoy the classic 1984/mullender entry as
it would have been in 1984 with a VAX-11/PDP-11! Once it reaches the end of the
line, hit enter and see what happens again. When you’re tired of it hit ctrl-c.
@@ -180,18 +180,18 @@ line, hit enter and see what happens again. When you’re tired of it hit ctrl-c
3636 bytes, which is considerably lighter than the original machine it can replace.
This program can take you back to the start of everything, it is possible to
run v0. Just type:
-
./v0
+
./v0
NOTE: To quit v0, press Control-E.
You will be greeted with a familiar prompt of “login”. The username and
password are “dmr” and “dmr”. To make things more familiar you’ll need to
create ‘.’ as it hasn’t been invented yet on this image!
-
@ ln dd dmr .
+
@ ln dd dmr .
An ls will reveal that C hasn’t been invented yet! IOBCC anyone? The
compiler is bc. It produces assembly, which will then need to be assembled
together like ops.s bl.s hello.s bi.s (in that order) to produce a.out!
But wait, we said this was the start of it all! This program can also run a
program that replaces an even larger machine that can run BSD 2.9. To start this,
-
./prog
+
./prog
At the >boot prompt, type return.
At the “:” prompt, type rk(0,0)rkunix.
NOTE: To quit prog, press Control-E.
@@ -199,7 +199,7 @@ program that replaces an even larger machine that can run BSD 2.9. To start this
the very first IOCCC entries 1984/mullender, as
shown earlier.
But wait, there is even more! Try:
-
./v6
+
./v6
At the @ prompt, type rkunix. You might want to type stty -lcase as
otherwise the output will be in all caps.
NOTE: To quit v6, press Control-E.
@@ -269,15 +269,15 @@ If so, consider a make clean to start from scratch.
root prompt. Most of the commands you are familiar with work here (this was
only a quarter of a century ago – how much could things have changed?).
Let’s try some:
-
# ls
-.cshrc .profile boot hkunix mnt tmp
-.login 2.9stamp dev lib mullender.c unix
-.msgsrc bin etc lost+found rkunix usr
-# df
-Filesystem Mounted on kbytes used free % used
-/dev/rk0 / 1958 1688 270 86%
-# bin/cc mullender.c
-# ./a.out
+
# ls
+ .cshrc .profile boot hkunix mnt tmp
+ .login 2.9stamp dev lib mullender.c unix
+ .msgsrc bin etc lost+found rkunix usr
+ # df
+ Filesystem Mounted on kbytes used free % used
+ /dev/rk0 / 1958 1688 270 86%
+ # bin/cc mullender.c
+ # ./a.out
The program you’ve just run was the [winning entry of the first IOCCC contest from
1984] 1 (or was it 1894?), a personal favorite of mine. It is rather
tightly bound to running on either a PDP-11 or a VAX-11. Now you have one.
diff --git a/2018/poikola/README.md b/2018/poikola/README.md
index 7c19d2635..4f52e100b 100644
--- a/2018/poikola/README.md
+++ b/2018/poikola/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
@@ -17,7 +17,7 @@
On a terminal that supports 24 bit color, has black background, and size at
least 125x38, try:
-```sh
+```
./try.sh
```
@@ -40,13 +40,13 @@ And those in the deep south might wish to go north for a better view.
### How to build:
-```sh
+```
cc -o prog -std=gnu11 -O3 prog.c
```
or
-```sh
+```
make
```
diff --git a/2018/poikola/index.html b/2018/poikola/index.html
index c2b1d57fc..80a7204e3 100644
--- a/2018/poikola/index.html
+++ b/2018/poikola/index.html
@@ -141,13 +141,13 @@ Location: FI - Republic of Finland
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
On a terminal that supports 24 bit color, has black background, and size at
least 125x38, try:
-
./try.sh
+
./try.sh
Judges’ remarks:
It is said by some students of Astronomy:
Oh, Be A Fine Gal, Kiss Me!
@@ -157,9 +157,9 @@ You might wish, on a star, to better understand the colors being displayed.
And those in the deep south might wish to go north for a better view.
Author’s remarks:
How to build:
-
cc-o prog -std=gnu11 -O3 prog.c
+
cc -o prog -std=gnu11 -O3 prog.c
or
-
make
+
make
Poster:
You can generate an A3 sized poster by make docs. This command creates a pdf
file poikola.pdf.
diff --git a/2018/vokes/README.md b/2018/vokes/README.md
index f2748e654..2495403af 100644
--- a/2018/vokes/README.md
+++ b/2018/vokes/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2018 vokes bugs](../../bugs.html#2018_vokes).
## To use:
-```sh
+```
./prog < file.txt
```
## Try:
-```sh
+```
./try.sh
```
diff --git a/2018/vokes/index.html b/2018/vokes/index.html
index cf587d738..92af852e9 100644
--- a/2018/vokes/index.html
+++ b/2018/vokes/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
What this program does is not witchcraft and there are no spectres, but you
might have a meltdown trying to work it all out (look at the source code to
diff --git a/2018/yang/README.md b/2018/yang/README.md
index bfbd9bf7a..cbba77996 100644
--- a/2018/yang/README.md
+++ b/2018/yang/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@
The author suggested that after compilation one should look at the generated
files. For instance:
-```sh
+```
less generated1.c
less generated2.c
less generated3.c
@@ -19,7 +19,7 @@ files. For instance:
## Try:
-```sh
+```
./try.sh
```
@@ -44,7 +44,7 @@ of `./left`, `./right` and `./shift` and the additionally generated programs.
The final message can be revealed using
-```sh
+```
./msg9 < prog.c
```
@@ -59,7 +59,7 @@ But what combinations will generate `./msg3`, `./msg4`, `./msg5`, `./msg6`,
`Nuko` is a text rotator: given some text in `stdin`, `Nuko` will write the
same text to `stdout`, but rotated 90 degrees counterclockwise.
-```sh
+```
cc prog.c -o left
./left < input.txt > rotated_counterclockwise.txt
```
@@ -68,7 +68,7 @@ Due to static memory allocation, only the first 1K columns by 1K rows
are rotated, the rest are silently ignored. But fear not, a separate
tool with dynamic memory allocation is included:
-```sh
+```
./left < prog.c > r1.c
cc r1.c -o right
./right < input.txt > rotated_clockwise.txt
@@ -83,7 +83,7 @@ rotate counterclockwise once more, we get another program. This
program outputs a single message to `stdout`, which is the name of the
series that `Nuko` came from.
-```sh
+```
./left < prog.c | ./left > r2.c
cc r2.c -o msg0
./msg0
@@ -92,7 +92,7 @@ series that `Nuko` came from.
There is one final rotation, which produces a tool that removes
leading whitespaces:
-```sh
+```
./left < prog.c | ./left | ./left > r3.c
cc r3.c -o shift
./shift < input.txt > no_leading_space.txt
@@ -112,7 +112,7 @@ side). This shifted code behaves slightly different from the original
program. For example, here are two more messages that can be
produced:
-```sh
+```
./shift < prog.c | ./right > msg1.c && gcc msg1.c -o msg1 && ./msg1
./shift < prog.c | ./left > msg2.c && gcc msg2.c -o msg2 && ./msg2
```
diff --git a/2018/yang/index.html b/2018/yang/index.html
index 1b46cb805..4a1add36e 100644
--- a/2018/yang/index.html
+++ b/2018/yang/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
The author suggested that after compilation one should look at the generated
files. For instance:
-
less generated1.c
-less generated2.c
-less generated3.c
+
less generated1.c
+ less generated2.c
+ less generated3.c
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Code should be readable in any direction! This tool will help you rotate your
code so you don’t have to stare at it sideways or even upside down. Rotating
@@ -164,21 +164,21 @@ reveal messages and one more tool that can be used to reveal the final message
hidden in the original source. All of these can be created using combinations
of ./left, ./right and ./shift and the additionally generated programs.
The final message can be revealed using
-
./msg9< prog.c
+
./msg9 < prog.c
But what combinations will generate ./msg3, ./msg4, ./msg5, ./msg6,
./msg7, ./msg8 and finally ./msg9?
Author’s remarks:
Tools’ usage:
Nuko is a text rotator: given some text in stdin, Nuko will write the
same text to stdout, but rotated 90 degrees counterclockwise.
-
cc prog.c -o left
-./left< input.txt > rotated_counterclockwise.txt
+
cc prog.c -o left
+ ./left < input.txt > rotated_counterclockwise.txt
Due to static memory allocation, only the first 1K columns by 1K rows
are rotated, the rest are silently ignored. But fear not, a separate
tool with dynamic memory allocation is included:
./left < prog.c > r1.c
+ cc r1.c -o right
+ ./right < input.txt > rotated_clockwise.txt
For variety, this second tool rotates clockwise instead of
counterclockwise. Also, it can handle files larger than 1024x1024,
depending on how much memory you have.
@@ -186,14 +186,14 @@ depending on how much memory you have.
rotate counterclockwise once more, we get another program. This
program outputs a single message to stdout, which is the name of the
series that Nuko came from.
-
Where this might be useful, besides ruining the formatting of certain
files, is that it completes the set of tools needed to solve the
puzzle that is embedded in prog.c.
@@ -204,8 +204,8 @@ toward one of those notches (and create a new notch on the other
side). This shifted code behaves slightly different from the original
program. For example, here are two more messages that can be
produced:
-
In total, there are 9 embedded strings that can be produced via a
sequence of rotates and shifts, one of which can be used to extract
the 10th final string from prog.c. The intent is to simulate those
diff --git a/2019/adamovsky/README.md b/2019/adamovsky/README.md
index 212eabbfe..106110192 100644
--- a/2019/adamovsky/README.md
+++ b/2019/adamovsky/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2019 adamovsky bugs](../../bugs.html#2019_ada
## To use:
-```sh
+```
./prog file.unl
```
## Try:
-```sh
+```
./try.sh
```
@@ -47,7 +47,7 @@ Functional programming is not a panacea against core dumps, after all.
This can be demonstrated by:
-```sh
+```
./prog crash.unl
```
@@ -84,7 +84,7 @@ by the sheer length of the dividing line and totally overlooks the rest of the p
When built directly using
-```sh
+```
make
```
@@ -92,7 +92,7 @@ the program (`prog`) accepts a single parameter with the name of an Unlambda pro
download the [Colossal Cave Adventure][1] (the [advent.unl](advent.unl) file)
and run it like this:
-```sh
+```
./prog advent.unl
```
@@ -105,7 +105,7 @@ entries from [quine contest][4].
There is an alternative build path that requires the 2018 IOCCC size tool to complete. Put the tool
source [iocccsize_2018.c](iocccsize_2018.c) in the project directory and call
-```sh
+```
make identify
```
diff --git a/2019/adamovsky/index.html b/2019/adamovsky/index.html
index ecc6846dd..8a1efb36b 100644
--- a/2019/adamovsky/index.html
+++ b/2019/adamovsky/index.html
@@ -141,15 +141,15 @@ Location: CZ - Czech Republic (
Even after pre-processing and indenting, the C code of this entry it
is about as understandable as the Unlambda code.
@@ -159,7 +159,7 @@ bytes which crashed it:
````.0`.0`.0`c.0``sssss
Functional programming is not a panacea against core dumps, after all.
This can be demonstrated by:
-
./prog crash.unl
+
./prog crash.unl
Author’s remarks:
A highly structured state state machine
Purpose:
@@ -181,11 +181,11 @@ actually a one-liner. It certainly was for me. I like to think the
by the sheer length of the dividing line and totally overlooks the rest of the program.
Usage:
When built directly using
-
make
+
make
the program (prog) accepts a single parameter with the name of an Unlambda program. You can
download the Colossal Cave Adventure (the advent.unl file)
and run it like this:
-
./prog advent.unl
+
./prog advent.unl
NOTE: the file was added to the entry so there is no need to download it.
@@ -194,7 +194,7 @@ and run it like this:
entries from quine contest.
There is an alternative build path that requires the 2018 IOCCC size tool to complete. Put the tool
source iocccsize_2018.c in the project directory and call
-
make identify
+
make identify
It will build the tool and use it to build an alternative program prog2, which in turn will
produce an Unlambda program identify.unl. make identify runs this program to identify
itself.
diff --git a/2019/burton/README.md b/2019/burton/README.md
index b02f13418..33e509a4e 100644
--- a/2019/burton/README.md
+++ b/2019/burton/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2019 burton bugs](../../bugs.html#2019_burton
## To use:
-```sh
+```
./prog < file
./cow file
@@ -27,7 +27,7 @@ For more detailed information see [2019 burton bugs](../../bugs.html#2019_burton
## Try:
-```sh
+```
./try.sh
```
@@ -51,7 +51,7 @@ The output should look familiar.
Compiles cleanly with:
-```sh
+```
WARN="-Wno-implicit-int -Wno-missing-variable-declarations -Wno-parentheses"
cc -Wall -Wextra -Weverything -pedantic $WARN -include stdio.h -o prog prog.c
```
@@ -63,7 +63,7 @@ programs, it is silent upon success; any output demonstrates an error. Instead
of checking correctness, the [check.sh](check.sh) script can simply output the
results: (The Makefile contains the spoiler):
-```sh
+```
out=cat ./check.sh ./prog
```
@@ -97,7 +97,7 @@ interface.
Included is a version without compilation warnings:
-```sh
+```
cc -Wall -Wextra -Weverything -pedantic -include stdio.h -o prog.clean prog.clean.c
```
diff --git a/2019/burton/index.html b/2019/burton/index.html
index 8fc78da6b..d35a8f4ae 100644
--- a/2019/burton/index.html
+++ b/2019/burton/index.html
@@ -141,17 +141,17 @@ Location: US - United States of America
A tiny, but punctually correct way of POSIX counting for text files. This one
line, one word, 127 character beauty continues to expand the number of classic
@@ -163,14 +163,14 @@ interesting.
Feed it anything on stdin.
The output should look familiar.
Included is a test script, useful for the corner cases. As in all good Unix
programs, it is silent upon success; any output demonstrates an error. Instead
of checking correctness, the check.sh script can simply output the
results: (The Makefile contains the spoiler):
-
out=cat ./check.sh ./prog
+
out=cat ./check.sh ./prog
Interestingly, and a spoiler here: macOS and FreeBSD implement the common
utility “correctly”. CentOS and Ubuntu both share a “flawed” utility that
changes output format based upon input redirection or pipeline(!). As well, the
@@ -189,7 +189,7 @@ All your base belong to us, but the constants seem a bit … off?
The script cow.sh provides a closer analog, and perhaps a more useful
interface.
Included is a version without compilation warnings:
There is an alternate version of this code that flushes stdout after writing a
newline. See the Author’s remarks for more information.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
A few letters, one at a time, with no repeats. How many different ways can this
be done?
@@ -176,23 +176,23 @@ written with an alphabet and outputs perfect pangrams composed of these
words. A perfect pangram is a series of words that contains every letter
of the alphabet exactly once.
Example execution:
-
$ grep .. /usr/share/dict/words |./prog abcdefghijklmnopqrstuvwxyz
-qualm fjord wiz pyx vs beg kc nth
-quartz jinx vs fed kc womb glyph
-quid jamb fez vs pyx kc growl nth
-quiz fjord pyx vs bag kc mewl nth
-quiz fjord pyx vs gab kc mewl nth
-quiz fjord pyx vs gem bawl kc nth
-quiz fjord pyx vs meg bawl kc nth
-quiz fjord vex bawl kc gyp ms nth
-quiz jamb flex vs kc gyp word nth
-quiz jamb pyx vs kc flog drew nth
-quiz jamb pyx vs kc frog lewd nth
-quiz jamb pyx vs kc frog weld nth
-quiz jamb pyx vs kc golf drew nth
-quiz jamb pyx vs kc grew fold nth
-quiz jamb pyx vs kc grow nth fled
-quiz jamb pyx vs kc growl fed nth
+
$ grep .. /usr/share/dict/words | ./prog abcdefghijklmnopqrstuvwxyz
+ qualm fjord wiz pyx vs beg kc nth
+ quartz jinx vs fed kc womb glyph
+ quid jamb fez vs pyx kc growl nth
+ quiz fjord pyx vs bag kc mewl nth
+ quiz fjord pyx vs gab kc mewl nth
+ quiz fjord pyx vs gem bawl kc nth
+ quiz fjord pyx vs meg bawl kc nth
+ quiz fjord vex bawl kc gyp ms nth
+ quiz jamb flex vs kc gyp word nth
+ quiz jamb pyx vs kc flog drew nth
+ quiz jamb pyx vs kc frog lewd nth
+ quiz jamb pyx vs kc frog weld nth
+ quiz jamb pyx vs kc golf drew nth
+ quiz jamb pyx vs kc grew fold nth
+ quiz jamb pyx vs kc grow nth fled
+ quiz jamb pyx vs kc growl fed nth
Rearranging the words into more or less meaningful expressions is the
user’s duty.
This entry implements Algorithm X (Exact cover via dancing links)
diff --git a/2019/diels-grabsch1/README.md b/2019/diels-grabsch1/README.md
index 4210d5af6..e9a5d01eb 100644
--- a/2019/diels-grabsch1/README.md
+++ b/2019/diels-grabsch1/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog < file > file.Z
```
## Try:
-```sh
+```
./try.sh
```
@@ -37,19 +37,19 @@ compresses differently? The judges know. :)
#### Usage:
-```sh
+```
./prog < input.txt > input.txt.Z
```
#### Example:
-```sh
+```
./prog < guidelines.txt > guidelines.txt.Z
```
#### Check for correctness:
-```sh
+```
zcat guidelines.txt.Z > guidelines2.txt
diff -s guidelines.txt guidelines2.txt
```
diff --git a/2019/diels-grabsch1/index.html b/2019/diels-grabsch1/index.html
index 76e2f87b0..1a3d47d30 100644
--- a/2019/diels-grabsch1/index.html
+++ b/2019/diels-grabsch1/index.html
@@ -141,11 +141,11 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
To use:
-
./prog< file > file.Z
+
./prog < file > file.Z
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Finally, IOCCC now has its own text compression program, and it is short enough
to qualify for the Best Short Program award! That said, can you compress it down
@@ -157,12 +157,12 @@ compresses differently? The judges know. :)
Of course you can also use 2015/mills2 instead of
zcat to verify the output file. The achieved compression ratio roughly matches
that of the classic Unix compress(1) tool. And the source code is very
diff --git a/2019/diels-grabsch2/README.md b/2019/diels-grabsch2/README.md
index fb3f3c5d7..22a25e0ae 100644
--- a/2019/diels-grabsch2/README.md
+++ b/2019/diels-grabsch2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -33,7 +33,7 @@ that you are dreaming? Or is it, wake up from the simulation?
This program prints its own SHA-512 hash. To verify, run:
-```sh
+```
$ sha512sum prog.c; ./prog
43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68 prog.c
43bd0c4381a5078d2850fca9ae5e0647596bcc03cd67d8d973ad02ff35c316c728e7b347ca70abe6c74e745e63646cc7643cb0cffcd3d9a969cbf31a7ce5bf68
diff --git a/2019/diels-grabsch2/index.html b/2019/diels-grabsch2/index.html
index eb3535cc3..3748f10c1 100644
--- a/2019/diels-grabsch2/index.html
+++ b/2019/diels-grabsch2/index.html
@@ -141,11 +141,11 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
./try.sh
+
./try.sh
Judges’ remarks:
Before running this one, stay calm. Chill out, have a cup of tea. Is this bad?
To understand what is going on here, please check if you are dreaming, or are you dreaming
@@ -153,9 +153,9 @@ that you are dreaming? Or is it, wake up from the simulation?
Author’s remarks:
Almost a hash collision:
This program prints its own SHA-512 hash. To verify, run:
It started as a complicated “hello world” program that prints some random hex
digits instead of “hello world”. Then, the digits were adjusted until the
resulting program matched its own SHA-512 hash, via brute force through all
diff --git a/2019/dogon/README.md b/2019/dogon/README.md
index 8d76d1ee9..f6aa9accf 100644
--- a/2019/dogon/README.md
+++ b/2019/dogon/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2019 dogon bugs](../../bugs.html#2019_dogon).
## To use:
-```sh
+```
./prog < pattern.mc
```
## Try:
-```sh
+```
./try.sh
```
@@ -247,13 +247,13 @@ of his vast knowledge regarding GOL programming and hashlife. As a free bonus,
Tom has allowed me to show his code which is probably the most efficient yet
most obfuscated way of calculating the GOL function on a 64 bits `8*8` leaf:
-````c
+```
unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw
^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 =
hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8
& hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^
(ts1 | s1)) & ((ts0 ^ s0) | a); }
-````
+```
This uses only 19 bitwise operations and six shifts to calculate the inner 6x6
next generation bits of the input 8x8 !
diff --git a/2019/dogon/index.html b/2019/dogon/index.html
index 954f3e8c8..8264e0e61 100644
--- a/2019/dogon/index.html
+++ b/2019/dogon/index.html
@@ -141,15 +141,15 @@ Location: IL - State of Israel (
To build:
-
make
+
make
Bugs and (Mis)features:
The current status of this entry is:
STATUS: uses gets() - change to fgets() if possible
Make sure that you keep focus of windows in mind when going back and forth to
the program and the script.
Judges’ remarks:
@@ -321,11 +321,7 @@ master, who reviewed some earlier versions of the entry and freely shared some
of his vast knowledge regarding GOL programming and hashlife. As a free bonus,
Tom has allowed me to show his code which is probably the most efficient yet
most obfuscated way of calculating the GOL function on a 64 bits 8*8 leaf:
<!---`c--> unsigned long life8x8(long a) { unsigned long aw = a << 1, ae = a >> 1, s0 = aw ^ ae, s1 = aw & ae, hs0 = s0 ^ a, hs1 = (s0 & a) | s1, hs0w8 = hs0 >> 8, hs0e8 = hs0 << 8, hs1w8 = hs1 >> 8, hs1e8 = hs1 << 8, ts0 = hs0w8 ^ hs0e8, ts1 = (hs0w8 & hs0e8) | (ts0 & s0); return (hs1w8 ^ hs1e8 ^ ts1 ^ s1) & ((hs1w8 | hs1e8) ^ (ts1 | s1)) & ((ts0 ^ s0) | a); }
This uses only 19 bitwise operations and six shifts to calculate the inner 6x6
next generation bits of the input 8x8 !
make
```
@@ -21,20 +21,20 @@ For more detailed information see [2019 duble bugs](../../bugs.html#2019_duble).
## To use:
-```sh
+```
./prog file
```
## Try:
-```sh
+```
./prog /tmp/drawing
```
Open another window / terminal.
-```sh
+```
./prog /tmp/drawing
```
@@ -42,13 +42,13 @@ Open more terminals and repeat...
You might also wish to try a full screen size. For this try:
-```sh
+```
make clobber fullscreen
```
Alternatively, if you want to change the size, do something like:
-```sh
+```
make clobber LINES=20 COLUMNS=20 all
```
@@ -69,7 +69,7 @@ the editor.
After editing the file and quitting, try:
-```sh
+```
/tmp/drawing
```
@@ -97,7 +97,7 @@ alternate code might not work as well in macOS.
### Alternate build:
-```sh
+```
make alt
```
@@ -132,7 +132,7 @@ To build, type `make` (assuming gcc) or `make CC=clang`.
Then you can start the program. It expects a file path as its first argument:
-```sh
+```
./prog /tmp/drawing
```
@@ -216,7 +216,7 @@ Note: the drawing files `prog` generates are probably even more portable than
The default size is the one of my xterm (see top of Makefile).
You may set it to the full size of your terminal window by typing:
-```sh
+```
make clobber fullscreen
```
diff --git a/2019/duble/index.html b/2019/duble/index.html
index afd9bb62d..f08f5199e 100644
--- a/2019/duble/index.html
+++ b/2019/duble/index.html
@@ -141,7 +141,7 @@ Location: FR - French Republic (
To build:
-
make
+
make
There is an alternate version, the original, which does not work well in macOS.
See Alternate code below if you are curious.
Bugs and (Mis)features:
@@ -149,16 +149,16 @@ See Alternate code below if you are curious.
You might also wish to try a full screen size. For this try:
-
make clobber fullscreen
+
make clobber fullscreen
Alternatively, if you want to change the size, do something like:
-
make clobber LINES=20 COLUMNS=20 all
+
make clobber LINES=20 COLUMNS=20 all
The author provided us with the following table for use:
@@ -173,7 +173,7 @@ to the move mode).
The mode and current color is indicated at the bottom left corner of
the editor.
After editing the file and quitting, try:
-
/tmp/drawing
+
/tmp/drawing
i.e. execute the file.
WARNING: if the file is deleted it might lock any session still in use. These
@@ -188,7 +188,7 @@ directory which you’ll have to delete manually. This is also discussed in
An alternate version of this entry, prog.alt.c, is provided. This
alternate code might not work as well in macOS.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -204,7 +204,7 @@ of someone else by just opening the same file!
To build, type make (assuming gcc) or make CC=clang.
Then you can start the program. It expects a file path as its first argument:
-
./prog /tmp/drawing
+
./prog /tmp/drawing
(If not started this way, with a file, prog will refuse to start.)
If the file does not exist, you will start with a blank drawing.
If someone else (or another instance of yourself, maybe?) is already
@@ -264,7 +264,7 @@ inverse video mode, and movement escape codes, e.g. xterm, g
The drawing area size is set at compilation time:
The default size is the one of my xterm (see top of Makefile).
You may set it to the full size of your terminal window by typing:
-
make clobber fullscreen
+
make clobber fullscreen
IMPORTANT NOTES:
The program compiled with a given size will fail to reload a drawing file
diff --git a/2019/endoh/README.md b/2019/endoh/README.md
index 4429c7dfd..ba192b442 100644
--- a/2019/endoh/README.md
+++ b/2019/endoh/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,7 +21,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh).
## To use:
-```sh
+```
./prog
```
@@ -30,7 +30,7 @@ For more detailed information see [2019 endoh bugs](../../bugs.html#2019_endoh).
If you have `gdb(1)` installed:
-```sh
+```
./try.sh
```
@@ -40,7 +40,7 @@ only been tested with linux.
You might also wish to try:
-```sh
+```
gdb ./prog || lldb ./prog
```
@@ -59,20 +59,20 @@ ascii` when debugging it to reveal its purpose.
Compile prog.c with no optimization.
-```sh
+```
cc -g -O0 -o prog prog.c
```
Then, run it. You will see a segmentation fault.
-```sh
+```
$ ./prog
Segmentation fault (core dumped)
```
Let's debug. As usual, run it under gdb.
-```sh
+```
$ gdb ./prog
(gdb) run
Starting program: /home/.../prog
@@ -132,7 +132,7 @@ The original program can be used as a GDB command file.
By using this, you can confirm that it is actually a quine.
-```sh
+```
gdb -q -x prog.c ./prog | sed -n -r 's/#.*:([0-9]+)/\1/p' | awk '{printf "%c",$1}' > prog2.c
diff prog.c prog2.c
```
diff --git a/2019/endoh/index.html b/2019/endoh/index.html
index 77c4c65a3..1f5537cdf 100644
--- a/2019/endoh/index.html
+++ b/2019/endoh/index.html
@@ -141,7 +141,7 @@ Location: JP - Japan
To build:
-
make
+
make
NOTE: the use of the C compiler optimiser was disabled and -g was enabled for
this entry because it is SUPPOSED to crash and it needs debugging symbols.
Bugs and (Mis)features:
@@ -149,32 +149,32 @@ this entry because it is SUPPOSED to crash and it needs debugging symbols.
Note that in macOS installing gdb(1) takes multiple steps - it’s not just a
matter of installing gdb(1) and that’s that. The try.sh script has
only been tested with linux.
You might also wish to try:
-
gdb ./prog ||lldb ./prog
+
gdb ./prog || lldb ./prog
and then type in r (to run program) and then bt (for backtrace).
Judges’ remarks:
The purpose of this program is to crash. You’ll want to have memorized man 7 ascii when debugging it to reveal its purpose.
Author’s remarks:
backtrace quine:
Compile prog.c with no optimization.
-
cc-g-O0-o prog prog.c
+
cc -g -O0 -o prog prog.c
Then, run it. You will see a segmentation fault.
-
$ ./prog
-Segmentation fault (core dumped)
+
$ ./prog
+ Segmentation fault (core dumped)
Let’s debug. As usual, run it under gdb.
-
$ gdb ./prog
-(gdb)run
-Starting program: /home/.../prog
-
-Program received signal SIGSEGV, Segmentation fault.
-0x0000000000000000 in ??()
+
$ gdb ./prog
+ (gdb) run
+ Starting program: /home/.../prog
+
+ Program received signal SIGSEGV, Segmentation fault.
+ 0x0000000000000000 in ?? ()
Okay, check the backtrace.
(gdb) backtrace
#0 0x0000000000000000 in ?? ()
@@ -212,8 +212,8 @@ only been tested with linux.
#7 0x0000555555555747 in x65 () at prog.c:101
...
By using this, you can confirm that it is actually a quine.
make
```
## To use:
-```sh
+```
./prog infile.wav outfile.wav
```
## Try:
-```sh
+```
./try.sh
```
@@ -62,7 +62,7 @@ Interesting fact: The size of the program from `./iocccsize -i` is 2019.
#### How to use:
-```sh
+```
./prog input [output [size [dry [wet [damping]]]]]
prog.exe input [output [size [dry [wet [damping]]]]]
```
@@ -87,7 +87,7 @@ The default settings are designed to make the effect obvious rather than subtle,
so it may be a good idea to adjust the ratio of "dry" to "wet", to give a more
pleasant result:
-```sh
+```
./prog in.wav out.wav 1.8 80% 15%
```
diff --git a/2019/giles/index.html b/2019/giles/index.html
index 5c4c0355b..df1b1207a 100644
--- a/2019/giles/index.html
+++ b/2019/giles/index.html
@@ -141,11 +141,11 @@ Location: AU - Commonwealth of Australi
@@ -175,8 +175,8 @@ the latter reports warnings about loss of information when converting floa
and that void (*)() and void (*)(void) are not the same thing.
Interesting fact: The size of the program from ./iocccsize -i is 2019.
output: The path to the output file. Optional, defaults to out.wav.
@@ -196,7 +196,7 @@ decimal numbers (e.g. 0.35) or as percentages (e.g. 35%).
The default settings are designed to make the effect obvious rather than subtle,
so it may be a good idea to adjust the ratio of “dry” to “wet”, to give a more
pleasant result:
-
./prog in.wav out.wav 1.8 80% 15%
+
./prog in.wav out.wav 1.8 80% 15%
The program only supports WAV files, and only mostly. Other audio formats, such
as MP3, are not supported because they are difficult to decode, but there are
free programs such as ffmpeg that can perform the conversion. Some of the
diff --git a/2019/karns/README.md b/2019/karns/README.md
index a01b9c128..ecffd2819 100644
--- a/2019/karns/README.md
+++ b/2019/karns/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -21,13 +21,13 @@ For more detailed information see [2019 karns bugs](../../bugs.html#2019_karns).
## To use:
-```sh
+```
./prog < textfile_that_fits_on_the_screen
```
You might want to type:
-```sh
+```
reset
```
@@ -36,13 +36,13 @@ after running the program to restore the terminal to its previous state.
## Try:
-```sh
+```
./try.sh
```
If you have more time you might want to try:
-```sh
+```
./prog < README.md
```
@@ -82,7 +82,7 @@ connected with anything.
This program usually compiles under both GCC and clang. Build with:
-```sh
+```
$(CC) -std=c99 -o tbfs prog.c
```
@@ -90,13 +90,13 @@ where `$(CC)` is cc, gcc, clang, or some other C compiler.
You can then run it with:
-```sh
+```
cat | ./tbfs
```
Examples:
-```sh
+```
./tbfs < maze
./tbfs < prog.c
```
diff --git a/2019/karns/index.html b/2019/karns/index.html
index dbe986a6c..496be455a 100644
--- a/2019/karns/index.html
+++ b/2019/karns/index.html
@@ -141,7 +141,7 @@ Location: US - United States of America
To build:
-
make
+
make
NOTE: we disable the optimiser because this program has problems with it
enabled.
after running the program to restore the terminal to its previous state.
Try:
-
./try.sh
+
./try.sh
If you have more time you might want to try:
-
./prog< README.md
+
./prog < README.md
Judges’ remarks:
If you typically get lost in mazes, watching this program run might – or might
not, YMMV – teach you how to find your way in a maze. The algorithm is
@@ -179,13 +179,13 @@ adjacent nodes that are also spaces. Nodes that aren’t spaces are not
connected with anything.
Compiling and Running:
This program usually compiles under both GCC and clang. Build with:
-
$(CC)-std=c99 -o tbfs prog.c
+
$(CC) -std=c99 -o tbfs prog.c
where $(CC) is cc, gcc, clang, or some other C compiler.
You can then run it with:
-
cat<input file>|./tbfs
+
cat <input file> | ./tbfs
Examples:
-
./tbfs< maze
-./tbfs< prog.c
+
./tbfs < maze
+ ./tbfs < prog.c
Issues
The program must be ran in a terminal that supports ANSI escape codes for
diff --git a/2019/lynn/README.md b/2019/lynn/README.md
index 6d4c43522..dea764f68 100644
--- a/2019/lynn/README.md
+++ b/2019/lynn/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2019 lynn bugs](../../bugs.html#2019_lynn).
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -62,7 +62,7 @@ typeclasses. Just pass dictionaries explicitly.
Build the compiler:
-```sh
+```
cc -o prog prog.c
```
@@ -72,7 +72,7 @@ Build the compiler:
Test the compiler on [fib.hs](fib.hs):
-```sh
+```
(./prog < fib.hs ; cat prog.c) > fib.c
```
@@ -81,7 +81,7 @@ Compiling the output produces a binary that prints the 30th Fibonacci number.
The file [ghcfib.hs](ghcfib.hs) includes [fib.hs](fib.hs) with some glue code,
and shows GHC also accepts our subset of Haskell:
-```sh
+```
ghc ghcfib.hs
```
@@ -93,7 +93,7 @@ instead provide [hint.hs](hint.hs), the output of a certain stage of the
compiler when run on itself. This intermediate output is hopefully difficult to
understand, yet is accepted by our compiler:
-```sh
+```
(./prog < hint.hs ; cat prog.c) > hint.c
make hint
./hint
@@ -116,7 +116,7 @@ languages"](https://www.cs.dartmouth.edu/~doug/nfa.pdf). We exercise it by
showing the first entries of the length-ordered list of all strings consisting
of the characters `a` and `b` that contain an even number of `a`s.
-```sh
+```
(./prog < lol.hs ; cat prog.c) > lol.c
make lol
./lol
@@ -124,7 +124,7 @@ of the characters `a` and `b` that contain an even number of `a`s.
A GHC wrapper is provided:
-```sh
+```
ghc ghclol.hs
```
@@ -135,14 +135,14 @@ See [scc.hs](scc.hs) (and its GHC wrapper [ghcscc.hs](ghcscc.hs)) for an elegant
way to print the strongly-connected components of a graph in reverse topological
order.
-```sh
+```
(./prog < scc.hs ; cat prog.c) > scc.c
```
It expects the input to be in a similar format as a previous entry
(2018 vokes). For example:
-```sh
+```
make scc
./scc < example-1.txt
./scc < example-2.txt
diff --git a/2019/lynn/index.html b/2019/lynn/index.html
index a44868304..f0fb76129 100644
--- a/2019/lynn/index.html
+++ b/2019/lynn/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
Compiling the output produces a binary that prints the 30th Fibonacci number.
The file ghcfib.hs includes fib.hs with some glue code,
and shows GHC also accepts our subset of Haskell:
-
ghc ghcfib.hs
+
ghc ghcfib.hs
Self-hosting compiler:
To avoid spoiling this entry by revealing the original Haskell source, we
instead provide hint.hs, the output of a certain stage of the
compiler when run on itself. This intermediate output is hopefully difficult to
understand, yet is accepted by our compiler:
-
(./prog< hint.hs ;cat prog.c)> hint.c
-make hint
-./hint
+
(./prog < hint.hs ; cat prog.c) > hint.c
+ make hint
+ ./hint
The output program behaves like the compiler itself.
languages”. We exercise it by
showing the first entries of the length-ordered list of all strings consisting
of the characters a and b that contain an even number of as.
-
See scc.hs (and its GHC wrapper ghcscc.hs) for an elegant
way to print the strongly-connected components of a graph in reverse topological
order.
-
(./prog< scc.hs ;cat prog.c)> scc.c
+
(./prog < scc.hs ; cat prog.c) > scc.c
It expects the input to be in a similar format as a previous entry
(2018 vokes). For example:
-
make scc
-./scc< example-1.txt
-./scc< example-2.txt
+
make scc
+ ./scc < example-1.txt
+ ./scc < example-2.txt
The output should agree, though our program omits line numbers and does not
sort entries within a line. (Also, our program only treats spaces as
whitespace, and supports any non-space character in a vertex name.)
diff --git a/2019/mills/README.md b/2019/mills/README.md
index 7e0cb0686..8444eb3c0 100644
--- a/2019/mills/README.md
+++ b/2019/mills/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2019 mills bugs](../../bugs.html#2019_mills).
## To use:
-```sh
+```
make cpclean
# Let this run for about about an hour and then kill it:
./prog Shakespeare.txt
@@ -27,7 +27,7 @@ For more detailed information see [2019 mills bugs](../../bugs.html#2019_mills).
## Try:
-```sh
+```
./try.sh
```
@@ -92,19 +92,19 @@ OMLET has three operating modes:
For your first OMLET experiment, we will try training a simple single-level
RNN to write some [Shakespeare][5] plays. Start by typing
-```sh
+```
make
```
After it builds, train it using
-```sh
+```
./prog Shakespere.txt
```
This will immediately start outputting gibberish to the output, e.g.
-```sh
+```
./prog Shakespere.txt
```
@@ -259,7 +259,7 @@ doing `Control-C`.
You can continue training from a previous checkpoint by providing the
checkpoint file name as the second parameter, for example:
-```sh
+```
./prog Shakespeare.txt cp01_1.970
```
@@ -275,7 +275,7 @@ parameters to generate data. Inference mode takes the checkpoint file as
*standard input* (not on the command line) and hence must be run with a
command like
-```sh
+```
./prog < cp55_1.807
```
@@ -294,7 +294,7 @@ The default network for OMLET (the one you get if you type `make` with the
executable name `prog`) is the simplest recurrent neural network. It looks
like
-```c
+```
h = tanh(Wxh * x + Whh * h' + Bh)
y = Why * h + By
```
@@ -317,26 +317,26 @@ It is the presence of the hidden state vector that allows the RNN to
"remember" the past. We can see what would happen if we removed this hidden
state. If you type
-```sh
+```
make lin1
```
OMLET will create an [ADALINE][10] network that does
-```c
+```
y = Wxy * x + By
```
This is a simple [linear][11] [feed-forward network][12]. You can run it with
-```sh
+```
./lin1 Shakespeare.txt
```
The linear network won't be able to get past the gibberish stage, because it
lacks history:
-```sh
+```
./lin1 Shakespeare.txt
```
@@ -388,7 +388,7 @@ the language but `per` with the digit 1).
We can try to improve the RNN's performance by stacking RNN modules atop each
other:
-```c
+```
h1 = RNN(h1', x)
h2 = RNN(h2', h1)
y = Why * h2 + By
@@ -414,13 +414,13 @@ the hard limit with `limit -h stacksize` and set it with
You can try the deeper network by doing
-```sh
+```
make rnn2
```
(or even `make rnn3` if you want a three-layer RNN) and train it with
-```sh
+```
./rnn2 Shakespeare.txt
```
@@ -444,13 +444,13 @@ gradient, worsening the exploding and vanishing gradient problem.
solve this problem. Christopher Olah gives a good description of them
at his [blog posting][20]. You can build a two-level LSTM by doing
-```sh
+```
make lstm2
```
and train with it with
-```sh
+```
./lstm2 Shakespeare.txt
```
@@ -464,7 +464,7 @@ its hidden state via "gates". These gates are called
The basic LSTM equations are
-```c
+```
f = sigmoid(Wxf * x + Whf * h' + Bf)
i = sigmoid(Wxi * x + Whi * h' + Bi)
o = sigmoid(Wxo * x + Who * h' + Bo)
@@ -496,7 +496,7 @@ simplified versions of an LSTM which combine the gates together, meaning they
require fewer learned parameters. This allows them to train faster than a
generic LSTM. You can build a two-layer GRU with
-```sh
+```
make gru2
```
@@ -510,7 +510,7 @@ compiler's command-line by using `-D` directives. The network is defined by
a `-DNW='...'` command which consists of a series of comma-separated
assignments. For example, the simple one-layer RNN could be defined like
-```make
+```
-DNW=' x = I(n), hp = I(128), \
h = C(hp, T(A(L(128, x), L(128, hp)))), \
y = L(n, h)'
@@ -555,7 +555,7 @@ training mode, this is used to generate the loss which is backpropagated.
As an example of a more complicated network, we can look at a two-layer
GRU network:
-```make
+```
-DHS=128, \
-DNW=' x = I(n), \
y = L(n, MD(MD(x)))' \
diff --git a/2019/mills/index.html b/2019/mills/index.html
index 70635adb6..c0d38519d 100644
--- a/2019/mills/index.html
+++ b/2019/mills/index.html
@@ -141,17 +141,17 @@ Location: US - United States of America
make cpclean
-# Let this run for about about an hour and then kill it:
-./prog Shakespeare.txt
+
make cpclean
+ # Let this run for about about an hour and then kill it:
+ ./prog Shakespeare.txt
Try:
-
./try.sh
+
./try.sh
However, as the binary model files used to produce the output are in an
implementation-specific format, your mileage may vary.
Judges’ remarks:
@@ -200,11 +200,11 @@ training, but you can have even more fun by downloading some larger datasets:
For your first OMLET experiment, we will try training a simple single-level
RNN to write some Shakespeare plays. Start by typing
-
make
+
make
After it builds, train it using
-
./prog Shakespere.txt
+
./prog Shakespere.txt
This will immediately start outputting gibberish to the output, e.g.
-
./prog Shakespere.txt
+
./prog Shakespere.txt
produces:
sins ohennAu
T-teooclelp tiThoWy
@@ -331,7 +331,7 @@ helpful if you need to stop and restart training. You can stop training by
doing Control-C.
You can continue training from a previous checkpoint by providing the
checkpoint file name as the second parameter, for example:
-
./prog Shakespeare.txt cp01_1.970
+
./prog Shakespeare.txt cp01_1.970
After the validation cycle finishes, OMLET begins the next epoch by restarting
training at the beginning of the training set. Training continues forever,
until you quit it with Control-C. You should monitor the checkpoints to
@@ -342,7 +342,7 @@ OMLET to run the network in inference mode which uses the frozen checkpoint
parameters to generate data. Inference mode takes the checkpoint file as
standard input (not on the command line) and hence must be run with a
command like
-
./prog< cp55_1.807
+
./prog < cp55_1.807
Running it produces an infinite amount of generated output, until you hit
Control-C to stop it.
Note that if you decide to change networks or use a different input file, you
@@ -353,8 +353,8 @@ cause a crash.
The default network for OMLET (the one you get if you type make with the
executable name prog) is the simplest recurrent neural network. It looks
like
-
h = tanh(Wxh * x + Whh * h' + Bh)
- y = Why * h + By
+
h = tanh(Wxh * x + Whh * h' + Bh)
+ y = Why * h + By
where
x is the input vector
@@ -371,14 +371,14 @@ the loss of the network across the training set.
It is the presence of the hidden state vector that allows the RNN to
“remember” the past. We can see what would happen if we removed this hidden
state. If you type
The linear network won’t be able to get past the gibberish stage, because it
lacks history:
-
./lin1 Shakespeare.txt
+
./lin1 Shakespeare.txt
produces:
UERond w,
@@ -418,9 +418,9 @@ the language but per with the digit 1).
Going deeper:
We can try to improve the RNN’s performance by stacking RNN modules atop each
other:
-
h1 = RNN(h1', x)
- h2 = RNN(h2', h1)
- y = Why * h2 + By
+
h1 = RNN(h1', x)
+ h2 = RNN(h2', h1)
+ y = Why * h2 + By
with RNN(h, x) defined as above. Each RNN module has its own set of
parameters and its own hidden state vector. This will improve the network’s
performance, at the cost of a much larger parameter space.
@@ -436,9 +436,9 @@ the hard limit with limit -h stacksize and set it with
limit stacksize 65532 (replacing 65532 with the actual hard limit).
You can try the deeper network by doing
-
make rnn2
+
make rnn2
(or even make rnn3 if you want a three-layer RNN) and train it with
-
./rnn2 Shakespeare.txt
+
./rnn2 Shakespeare.txt
The additional depth should allow the network to make better predictions (it
can represent more complicated history), but it may take a long time to train
-- both because the network (being larger) now requires more time to train and
@@ -454,9 +454,9 @@ gradient, worsening the exploding and vanishing gradient problem.
Long Short Term Memory networks (also called LSTMs) were developed to
solve this problem. Christopher Olah gives a good description of them
at his blog posting. You can build a two-level LSTM by doing
-
make lstm2
+
make lstm2
and train with it with
-
./lstm2 Shakespeare.txt
+
./lstm2 Shakespeare.txt
The LSTM is much easier to train because it explicitly decides how to update
its hidden state via “gates”. These gates are called
@@ -466,11 +466,11 @@ its hidden state via “gates”. These gates are called
produce the output
The basic LSTM equations are
-
f = sigmoid(Wxf * x + Whf * h' + Bf)
- i = sigmoid(Wxi * x + Whi * h' + Bi)
- o = sigmoid(Wxo * x + Who * h' + Bo)
- c = f * c' + i * tanh(Wxc * x + Whc * h'+ Bc)
- h = o * tanh(c)
+
f = sigmoid(Wxf * x + Whf * h' + Bf)
+ i = sigmoid(Wxi * x + Whi * h' + Bi)
+ o = sigmoid(Wxo * x + Who * h' + Bo)
+ c = f * c' + i * tanh(Wxc * x + Whc * h' + Bc)
+ h = o * tanh(c)
Where
x is the input vector
@@ -494,7 +494,7 @@ examples). One important one is the
make gru2
+
make gru2
Building your own networks
The OMLET Makefile comes with one-, two- and three-layer RNNs, LSTMs and
GRUs, along with simpler feed-forward networks like multi-layer perceptrons and
@@ -503,7 +503,7 @@ own networks by modifying the Makefile. Networks are passed in on t
compiler’s command-line by using -D directives. The network is defined by
a -DNW='...' command which consists of a series of comma-separated
assignments. For example, the simple one-layer RNN could be defined like
-
-DNW=' x = I(n), hp = I(128), \
+
-DNW=' x = I(n), hp = I(128), \
h = C(hp, T(A(L(128, x), L(128, hp)))), \
y = L(n, h)'
The network declares x as an input vector (there must be a declaration for
@@ -538,7 +538,7 @@ inference mode, this is used to select the next character to emit. In
training mode, this is used to generate the loss which is backpropagated.
As an example of a more complicated network, we can look at a two-layer
GRU network:
-
-DHS=128, \
+
-DHS=128, \
-DNW=' x = I(n), \
y = L(n, MD(MD(x)))' \
-DBK=' hp = I(HS), \
diff --git a/2019/poikola/README.md b/2019/poikola/README.md
index 4d45815df..f4acd2fc1 100644
--- a/2019/poikola/README.md
+++ b/2019/poikola/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -26,7 +26,7 @@ For more detailed information see [2019 poikola bugs](../../bugs.html#2019_poiko
## To use:
-```sh
+```
./prog 512 ./prog
sleep 86400; make clobber prog
@@ -38,7 +38,7 @@ For more detailed information see [2019 poikola bugs](../../bugs.html#2019_poiko
If you wish for some documentation:
-```sh
+```
make docs
```
@@ -49,7 +49,7 @@ This will create the file `poikola.pdf` for your enjoyment.
If you don't have a few days, try:
-```sh
+```
./try.sh
```
@@ -65,7 +65,7 @@ what can be done with the original entry.
### Alternate build:
-```sh
+```
make alt
```
@@ -77,7 +77,7 @@ Use `prog.alt` as you would `prog` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -103,19 +103,19 @@ Nykänen](https://en.wikipedia.org/wiki/Matti_Nyk%C3%A4nen).
### How to build:
-```sh
+```
gcc -O0 -o prog prog.c
```
or
-```sh
+```
clang -O[0123s] -o prog prog.c
```
e.g.:
-```sh
+```
clang -O1 -o prog prog.c
```
@@ -166,7 +166,7 @@ unnecessary checks, but either fails or gets stuck if invoked erroneously. The
program is invoked in this way:
-```sh
+```
./prog
```
diff --git a/2019/poikola/index.html b/2019/poikola/index.html
index cb5ca4dde..5899e90ad 100644
--- a/2019/poikola/index.html
+++ b/2019/poikola/index.html
@@ -141,7 +141,7 @@ Location: FI - Republic of Finland
To build:
-
make
+
make
There is an alternate version of this program which changes the way the output
is displayed. See Alternate code below.
NOTE: we disable the optimiser because the author stated that for GCC optimiser
@@ -153,30 +153,30 @@ forcing -std=gnu11.
This will create the file poikola.pdf for your enjoyment.
Try:
If you don’t have a few days, try:
-
./try.sh
+
./try.sh
As the 2019 poikola bugs says, this program will not validate
input so it might get stuck or fail if invoked erroneously.
Alternate code:
This version prints a newline after each number for parsing in other ways than
what can be done with the original entry.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Judges’ remarks:
Do you have the time to see what this program does? Think again, come back and
try again.
@@ -191,11 +191,11 @@ accomplishments of Ma
Nykänen.
Author’s remarks:
How to build:
-
gcc-O0-o prog prog.c
+
gcc -O0 -o prog prog.c
or
-
clang-O[0123s]-o prog prog.c
+
clang -O[0123s] -o prog prog.c
e.g.:
-
clang-O1-o prog prog.c
+
clang -O1 -o prog prog.c
Poster:
You can generate an A3 sized poster by make docs. This command creates a pdf
file poikola.pdf. This requires the
@@ -231,7 +231,7 @@ three consecutive days.
As this is a contest for obfuscated code, the program does not perform
unnecessary checks, but either fails or gets stuck if invoked erroneously. The
program is invoked in this way:
-
./prog<integer><file>
+
./prog <integer> <file>
where <integer> is 224, 256, 384, 512 or even 1024. Yes, I know 1024 is not a
supported length of output, but as I said, the program does not validate its
input in any way. These same parameters should be given in calculating a
diff --git a/2019/yang/README.md b/2019/yang/README.md
index c15c7d2f0..1176f11d6 100644
--- a/2019/yang/README.md
+++ b/2019/yang/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang).
## To use:
-```sh
+```
./prog sample_input.txt a b c d
cat a
@@ -35,7 +35,7 @@ For more detailed information see [2019 yang bugs](../../bugs.html#2019_yang).
## Try:
-```sh
+```
./try.sh
```
@@ -52,7 +52,7 @@ output again.
Scramble/unscramble to single file:
-```sh
+```
./prog original.txt > scrambled.txt
./prog < scrambled.txt > unscrambled.txt
@@ -60,7 +60,7 @@ Scramble/unscramble to single file:
Scramble/unscramble to multiple files:
-```sh
+```
./prog input.txt output1.txt output2.txt ...
cat output1.txt output2.txt ... | ./prog > unscrambled.txt
@@ -68,7 +68,7 @@ Scramble/unscramble to multiple files:
Re-scramble:
-```sh
+```
./prog original.txt | ./prog - > scrambled1.txt
./prog original.txt | ./prog - | ./prog - > scrambled2.txt
./prog original.txt | ./prog - | ./prog - | ... > scrambled3.txt
@@ -76,7 +76,7 @@ Re-scramble:
Scramble slowly:
-```sh
+```
./prog input.txt | ruby prog.c
```
@@ -87,14 +87,14 @@ Input must be in UTF-8 encoding.
This is a text scrambling utility. To scramble text, specify input file name as
the first argument:
-```sh
+```
./prog input.txt > output.txt
```
If original input file was small enough to fit in your terminal, you
can simply use `cat` to unscramble the output text.
-```sh
+```
cat output.txt
```
@@ -106,7 +106,7 @@ order. This effect is more visible if there is a delay after each character is
printed. For convenience, a utility is included in the source to output
characters slowly:
-```sh
+```
./prog input.txt | ruby prog.c
```
@@ -114,14 +114,14 @@ Scrambling order is deterministic, but you can reshuffle the output by
piping it through the same utility again, by specifying `-` as the
first argument:
-```sh
+```
./prog input.txt | ./prog - | ./prog - | ...
```
You can also split the input to multiple files, each getting a subset
of the original input characters:
-```sh
+```
./prog input.txt output1.txt output2.txt ...
cat output1.txt output2.txt ... > unscrambled.txt
```
@@ -138,7 +138,7 @@ positions to be misaligned. But fear not, this utility also includes
unscrambling functionality. If no argument is specified, input will
be read through `stdin` and unscrambled to `stdout`:
-```sh
+```
./prog < scrambled.txt > unscrambled.txt
```
@@ -146,7 +146,7 @@ Where this is useful is that if you scramble the input to multiple
files and unscramble each output file individually, those output
files can be printed on transparencies and distributed separately.
-```sh
+```
./prog input.txt output1.txt output2.txt output3.txt
./prog < output1.txt > layer1.txt
./prog < output2.txt > layer2.txt
@@ -159,7 +159,7 @@ In other words, this is a utility for facilitating
This utility can also be used just for removing trailing whitespaces
and expanding tabs to 8 spaces.
-```sh
+```
./prog input.txt | ./prog
```
diff --git a/2019/yang/index.html b/2019/yang/index.html
index 850161a0e..4fe17d475 100644
--- a/2019/yang/index.html
+++ b/2019/yang/index.html
@@ -141,52 +141,52 @@ Location: US - United States of America
This is a text scrambling utility. To scramble text, specify input file name as
the first argument:
-
./prog input.txt > output.txt
+
./prog input.txt > output.txt
If original input file was small enough to fit in your terminal, you
can simply use cat to unscramble the output text.
-
cat output.txt
+
cat output.txt
It might seem like nothing was scrambled, but you can try passing the output
through strings(1) and see that most of the original strings are gone. What
happened is that the original text has been shuffled with ANSI cursor
@@ -194,15 +194,15 @@ positioning codes inserted in such a way that characters are printed in random
order. This effect is more visible if there is a delay after each character is
printed. For convenience, a utility is included in the source to output
characters slowly:
-
./prog input.txt |ruby prog.c
+
./prog input.txt | ruby prog.c
Scrambling order is deterministic, but you can reshuffle the output by
piping it through the same utility again, by specifying - as the
first argument:
-
./prog input.txt |./prog-|./prog-|...
+
./prog input.txt | ./prog - | ./prog - | ...
You can also split the input to multiple files, each getting a subset
of the original input characters:
You can only unscramble files with cat if the input fits in a single
terminal screen. If you don’t know what will be the terminal size of
the recipient, note that prog.c will fit in a 80x25 terminal, so a
@@ -213,19 +213,19 @@ sufficient for unscrambling because any scrolling causes the character
positions to be misaligned. But fear not, this utility also includes
unscrambling functionality. If no argument is specified, input will
be read through stdin and unscrambled to stdout:
-
./prog< scrambled.txt > unscrambled.txt
+
./prog < scrambled.txt > unscrambled.txt
Where this is useful is that if you scramble the input to multiple
files and unscramble each output file individually, those output
files can be printed on transparencies and distributed separately.
This utility can also be used just for removing trailing whitespaces
and expanding tabs to 8 spaces.
-
./prog input.txt |./prog
+
./prog input.txt | ./prog
Features:
UTF-8 support:
A simple text scrambling utility might not have required a screenful
diff --git a/2020/burton/README.md b/2020/burton/README.md
index 94506a2eb..40f183ca0 100644
--- a/2020/burton/README.md
+++ b/2020/burton/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2020 burton bugs](../../bugs.html#2020_burton
## To use:
-```sh
+```
./prog arg ...
```
## Try:
-```sh
+```
./try.sh
```
@@ -67,7 +67,7 @@ result?
This code may be tested by:
-```sh
+```
make test
```
@@ -107,19 +107,19 @@ Compiles cleanly under `clang -Wall -Weverything -pedantic`, but you need to add
On a little-endian machine:
-```sh
+```
clang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=6945503773712347754LL -DI=5859838231191962459LL -DT=0 -DS=7 -o prog prog.c
```
On a big-endian machine:
-```sh
+```
clang -include stdio.h -include stdlib.h -Wall -Weverything -pedantic -DB=7091606191627001958LL -DI=6006468689561538903LL -DT=1 -DS=0 -o prog_be prog.c
```
You might be interested to compile it both ways on the same host, and try:
-```sh
+```
./prog 1; ./prog_be 1
```
diff --git a/2020/burton/index.html b/2020/burton/index.html
index 51aab99c4..d2ebbc568 100644
--- a/2020/burton/index.html
+++ b/2020/burton/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
You might be interested to compile it both ways on the same host, and try:
-
./prog 1;./prog_be 1
+
./prog 1; ./prog_be 1
make
```
@@ -18,20 +18,20 @@ For more detailed information see [2020 carlini bugs](../../bugs.html#2020_carli
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
Or if you actually want to play:
-```sh
+```
# Play with a friend, real or imagined, P1 and P2, squares are numbered 1..9
./prog
```
@@ -51,7 +51,7 @@ HOW ABOUT A NICE GAME OF CHESSTIC-TAC-TOE?
### USAGE
-```sh
+```
cc -o prog prog.c
./prog
```
@@ -92,7 +92,7 @@ compilers unhappy, and others slow. (For example, passing GCC the flags `-Wall
Under some terminals the program may exit early. The following should always work:
-```sh
+```
echo "1 2 3 4 5 6 7" | ./prog
```
@@ -100,7 +100,7 @@ Under some terminals the program may exit early. The following should always wor
The entirety of the program consists of a single iterated call to `printf(3)`.
-```c
+```
int main() {
while(*d) printf(fmt, arg);
}
@@ -144,13 +144,13 @@ Format specifiers can take extra "arguments".
For example, the following expression
-```c
+```
printf("%1$.*2$d%3$hhn", 5, 10, &x)
```
will have the same effect as if we had written
-```c
+```
x = 10;
```
@@ -174,37 +174,37 @@ We can use format strings to compute the OR/NOT of arbitrary "bits".
We'll start with the simplest, OR:
-```c
+```
printf("%1$s%2$s%3$hhn", a, b, c)
```
will compute
-```c
+```
*c = strlen(a) + strlen(b)
```
but given that `strlen(x)` is `1` for a 1-bit and `0` for a 0-bit, we have
-```c
+```
*c = a | b
```
Computing the NOT of a single value is also easy:
-```c
+```
printf("%1$255d%1$s%hhn", a, b)
```
will compute
-```c
+```
*b = (strlen(a)+255)%256 = strlen(a)-1
```
and again, because `strlen(x)` is either `1` or `0` we have
-```c
+```
*c = !b
```
@@ -221,7 +221,7 @@ To detect who has won, we implement the following logic. Let `A`, `B`, and `C` b
pointers to three squares in a row to test, and `D` be where to save if there is a
win or not.
-```c
+```
"%A$s%B$s%C$s%1$253d%11$hhn" // r11 = !(*A & *B & *C)
ZERO
"%11$s%1$255d%11hhn" // r11 = !r11
@@ -235,7 +235,7 @@ possible three-in-a-row configurations, for both players.
The ZERO macro ensures that the number of bytes written out is 0 mod 256 with
the following expression
-```c
+```
"%1$hhn%1$s" (repeated 256 times)
```
@@ -254,13 +254,13 @@ bits to Xs and Os to print out. This is actually rather straightforward. Given
in `1$` the pointer to player 1's square, and `2$` the pointer to player 2's, and
in `3$` the pointer to the board string, we can compute
-```c
+```
"%1$s" (repeated 47 times) "%2$s" (repeated 56 times) %1$32d%3$hhn"
```
which will, in effect, compute
-```c
+```
*r3 = (*r1) * 47 + (*r2) * 56 + 32
```
@@ -273,7 +273,7 @@ which will output `' '` if neither are true, `'X'` if `r1` is true, or `'O'` if
In order to be able to finally display the board, while still only using one
`printf(3)` statement, we finish the statement with
-```c
+```
"\n\033[2J\n%26$s"
```
@@ -299,7 +299,7 @@ won, or the game is over and it is a draw.
This turns out not to be as hard as it might look. Using the same trick as
before, we set byte four to be
-```c
+```
*byte4 = is_win * 'W' + is_tie * 'T'
```
@@ -313,7 +313,7 @@ ends. It should just exit.
One option would be to implement the logic as
-```c
+```
printf()
while (*ok) {
scanf();
@@ -324,7 +324,7 @@ One option would be to implement the logic as
but this would DOUBLE the number of calls to `printf(3)` we require. So instead we
implement it like this
-```c
+```
while (*ok) {
scanf();
printf();
diff --git a/2020/carlini/index.html b/2020/carlini/index.html
index 295bddb6a..5141805a0 100644
--- a/2020/carlini/index.html
+++ b/2020/carlini/index.html
@@ -141,18 +141,18 @@ Location: US - United States of America
# Play with a friend, real or imagined, P1 and P2, squares are numbered 1..9
-./prog
+
# Play with a friend, real or imagined, P1 and P2, squares are numbered 1..9
+ ./prog
Judges’ remarks:
This program consists of a single printf(3) statement wrapped in a while
loop. You would not think that this would amount to much, but you would be very,
@@ -161,8 +161,8 @@ ASCII art of the program source.
Author’s remarks:
HOW ABOUT A NICE GAME OF CHESSTIC-TAC-TOE?
USAGE
-
cc-o prog prog.c
-./prog
+
cc -o prog prog.c
+ ./prog
Alternates between P1 and P2. Enter a digit [1-9] to move:
After macro expansion the format string is roughly 100K. This makes some
compilers unhappy, and others slow. (For example, passing GCC the flags -Wall -Wextra -pedantic will result in a warning about oversized strings.)
Under some terminals the program may exit early. The following should always work:
-
echo"1 2 3 4 5 6 7"|./prog
+
echo "1 2 3 4 5 6 7" | ./prog
OBFUSCATION
The entirety of the program consists of a single iterated call to printf(3).
-
int main(){
-while(*d) printf(fmt, arg);
-}
+
int main() {
+ while(*d) printf(fmt, arg);
+ }
Here, fmt is a single string, and arg is a series of arguments to
printf(3).
While its primary purpose is to serve as The One True Debugger, printf(3) also happens
@@ -218,9 +218,9 @@ this one printf(3) call (and a call to scanf(3) to rea
"%3$.*4$d": print argument 3 to printf(3) with as many zeros as in argument 4.
For example, the following expression
-
printf("%1$.*2$d%3$hhn",5,10,&x)
+
printf("%1$.*2$d%3$hhn", 5, 10, &x)
will have the same effect as if we had written
-
x =10;
+
x = 10;
because it will print out 0000000005 (5 padded to size 10) and then write the
number of bytes written to x.
printf(3) Oriented Programming
@@ -233,17 +233,17 @@ array–one bit per pair of bytes:
We can use format strings to compute the OR/NOT of arbitrary “bits”.
We’ll start with the simplest, OR:
-
printf("%1$s%2$s%3$hhn", a, b, c)
+
printf("%1$s%2$s%3$hhn", a, b, c)
will compute
-
*c = strlen(a)+ strlen(b)
+
*c = strlen(a) + strlen(b)
but given that strlen(x) is 1 for a 1-bit and 0 for a 0-bit, we have
-
*c = a | b
+
*c = a | b
Computing the NOT of a single value is also easy:
-
printf("%1$255d%1$s%hhn", a, b)
+
printf("%1$255d%1$s%hhn", a, b)
will compute
-
*b =(strlen(a)+255)%256= strlen(a)-1
+
*b = (strlen(a)+255)%256 = strlen(a)-1
and again, because strlen(x) is either 1 or 0 we have
-
*c =!b
+
*c = !b
From here we can compute any binary circuit. Doing something efficient,
though, still takes work.
Tic-Tac-Toe
@@ -252,16 +252,16 @@ with a turn counter that alternates between player 1 and player 2.
To detect who has won, we implement the following logic. Let A, B, and C be
pointers to three squares in a row to test, and D be where to save if there is a
win or not.
That is, we set *D to 1 if there is a three-in-a-row. We repeat this for all
possible three-in-a-row configurations, for both players.
The ZERO macro ensures that the number of bytes written out is 0 mod 256 with
the following expression
-
"%1$hhn%1$s"(repeated 256 times)
+
"%1$hhn%1$s" (repeated 256 times)
where argument 1 is a pointer to a temporary variable followed by a NUL byte.
This works because if the current count is 0 mod 256, then "%1$hhn" will write
zero to argument 1 and then "%1$s" will never emit any text. If, on the other
@@ -273,15 +273,15 @@ times we’re eventually going to reach 0 mod 256.
bits to Xs and Os to print out. This is actually rather straightforward. Given
in 1$ the pointer to player 1’s square, and 2$ the pointer to player 2’s, and
in 3$ the pointer to the board string, we can compute
-
which will output ' ' if neither are true, 'X' if r1 is true, or 'O' if
r2 is true.
Further Obfuscations
In order to be able to finally display the board, while still only using one
printf(3) statement, we finish the statement with
-
"\n\033[2J\n%26$s"
+
"\n\033[2J\n%26$s"
which is the escape sequence to clear the screen, and then prints argument 26.
Argument 26 is a pointer to a char* in memory, that initially is undefined,
but within the printf(3) statement we will construct this string to look like a
@@ -297,7 +297,7 @@ tic-tac-toe board.
won, or the game is over and it is a draw.
This turns out not to be as hard as it might look. Using the same trick as
before, we set byte four to be
-
*byte4 = is_win *'W'+ is_tie *'T'
+
*byte4 = is_win * 'W' + is_tie * 'T'
The byte 'I' and 'S' can always be the same, and we do the same for 'E'/'N'.
We do this same on-the-fly creation of the scanf(3) format string, but for a
different reason. We first want to run printf(3) to show the first board, and
@@ -305,17 +305,17 @@ then alternate between runs to scanf(3) and printf(3)
displaying moves. Importantly, we do not want a final scanf(3) when the game
ends. It should just exit.
One option would be to implement the logic as
-
printf()
-while(*ok){
- scanf();
- printf();
-}
+
printf()
+ while (*ok) {
+ scanf();
+ printf();
+}
but this would DOUBLE the number of calls to printf(3) we require. So instead we
implement it like this
-
while(*ok){
- scanf();
- printf();
-}
+
while (*ok) {
+ scanf();
+ printf();
+ }
(In reality we actually pass scanf(3) as an argument to avoid the extra
statement, but it has the same effect.)
Notice there is now no initial printf(3). In order make sure the program doesn’t
diff --git a/2020/endoh1/README.md b/2020/endoh1/README.md
index 135b8ca01..bebe74089 100644
--- a/2020/endoh1/README.md
+++ b/2020/endoh1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code) below.
## To use:
-```sh
+```
# IMPORTANT for macOS: run under Terminal.app
./prog
@@ -19,7 +19,7 @@ code](#alternate-code) below.
## Try:
-```sh
+```
# IMPORTANT for macOS: run under Terminal.app
# Try resizing the terminal window before the first click.
@@ -41,7 +41,7 @@ Author's remarks for more details.
### Alternate build:
-```sh
+```
make alt
```
@@ -94,7 +94,7 @@ All you have to do is (0). You can test if you are lucky or not.
It uses ncurses:
-```sh
+```
gcc -o prog prog.c -lncurses
./prog
```
@@ -200,7 +200,7 @@ Analyze the code.
You can also play with a prepared map.
-```sh
+```
./prog ioccc.txt
```
diff --git a/2020/endoh1/index.html b/2020/endoh1/index.html
index 02fd1a903..bf1b2a7fc 100644
--- a/2020/endoh1/index.html
+++ b/2020/endoh1/index.html
@@ -141,29 +141,29 @@ Location: JP - Japan
To build:
-
make
+
make
There is an alternate version provided by the author. See Alternate
code below.
To use:
-
# IMPORTANT for macOS: run under Terminal.app
-
-./prog
+
# IMPORTANT for macOS: run under Terminal.app
+
+ ./prog
Try:
-
# IMPORTANT for macOS: run under Terminal.app
-
-# Try resizing the terminal window before the first click.
-
-# Try resizing the terminal window after the first click.
-
-./prog ioccc.txt
-
-./prog unwinnable.txt
+
# IMPORTANT for macOS: run under Terminal.app
+
+ # Try resizing the terminal window before the first click.
+
+ # Try resizing the terminal window after the first click.
+
+ ./prog ioccc.txt
+
+ ./prog unwinnable.txt
Alternate code:
An alternate version of this entry, prog.alt.c, is provided. This
alternate code lacks the additional rule to flag all unprobed cells. See the
Author’s remarks for more details.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -194,8 +194,8 @@ such a boring task!
All you have to do is (0). You can test if you are lucky or not.
How to use:
It uses ncurses:
-
gcc-o prog prog.c -lncurses
-./prog
+
gcc -o prog prog.c -lncurses
+ ./prog
You will see a terminal-wide field of a minesweeper. Probe a cell by mouse
click.
If a cell turns out to have a mine (or not), the program determines whether its
@@ -255,7 +255,7 @@ are flagged.
There are mines in a cell whose “priorities-of-each-cell” is less than
diff --git a/2020/endoh2/README.md b/2020/endoh2/README.md
index b0bfbb89a..c8beae056 100644
--- a/2020/endoh2/README.md
+++ b/2020/endoh2/README.md
@@ -1,26 +1,26 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
What happens if you do
-```sh
+```
./prog prog.c
```
@@ -41,7 +41,7 @@ render for a larger terminal window? How about adding more glyphs?
No! Try not. Do, or do not. There is no try.
-```sh
+```
cc -std=c99 prog.c
./a.out
./a.out hello.txt
diff --git a/2020/endoh2/index.html b/2020/endoh2/index.html
index 3aadb66d5..684440dd6 100644
--- a/2020/endoh2/index.html
+++ b/2020/endoh2/index.html
@@ -141,13 +141,13 @@ Location: JP - Japan
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
./try.sh
+
./try.sh
What happens if you do
-
./prog prog.c
+
./prog prog.c
?
Judges’ remarks:
Clever use of the C99 complex data type. The spoiler directory
@@ -157,11 +157,11 @@ shapes.
render for a larger terminal window? How about adding more glyphs?
make
```
@@ -10,14 +10,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./run_clock
# And watch closely for 15-20 seconds
```
@@ -31,7 +31,7 @@ alternate code uses Unicode letters.
### Alternate build:
-```sh
+```
make alt
```
@@ -43,7 +43,7 @@ Use `prog.alt` as you would `prog` above.
### Alternate try:
-```sh
+```
./run_clock.alt
# And watch closely for 15-20 seconds
```
@@ -63,7 +63,7 @@ time might depend on what time it is.
Prepare a mirror!
-```sh
+```
make clock
```
diff --git a/2020/endoh3/index.html b/2020/endoh3/index.html
index 17fd15fc0..da75a8fe7 100644
--- a/2020/endoh3/index.html
+++ b/2020/endoh3/index.html
@@ -141,24 +141,24 @@ Location: JP - Japan
To build:
-
make
+
make
An alternate version of this program exists. See Alternate
code below.
To use:
-
./prog
+
./prog
Try:
-
./run_clock
-# And watch closely for 15-20 seconds
+
./run_clock
+ # And watch closely for 15-20 seconds
Alternate code:
An alternate version of this entry, prog.alt.c, is provided. This
alternate code uses Unicode letters.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
-
./run_clock.alt
-# And watch closely for 15-20 seconds
+
./run_clock.alt
+ # And watch closely for 15-20 seconds
Judges’ remarks:
You may be tempted to use a mirror. Resist the temptation! Try figuring out how
the clock hands are drawn. Can you change the program to make it draw a
@@ -167,7 +167,7 @@ familiar (non-mirrored) clock face? Can you add the second hand?
time might depend on what time it is.
Author’s remarks:
Prepare a mirror!
-
make clock
+
make clock
Note: You need to recompile it each run.
sudo xcode-select --install
```
@@ -53,13 +53,13 @@ you want to use the Makefile) to compile and link this entry. With Fedora more
recent versions there's the `dnf` package manager but I cannot help with any of
the GUI installers since I don't use them. Something like:
-```sh
+```
sudo dnf install ncurses-devel ncurses make gcc
```
or
-```sh
+```
# dnf install ncurses-devel ncurses make gcc
```
@@ -69,25 +69,25 @@ Just like Fedora you will need `gcc`, `ncurses`, `ncurses-devel` (and if you
want to use the Makefile `make`). CentOS uses `yum` and CentOS 8 uses `dnf`.
So:
-```sh
+```
sudo yum install ncurses-devel ncurses make gcc
```
or
-```sh
+```
# yum install ncurses-devel ncurses make gcc
```
or
-```sh
+```
sudo dnf install ncurses-devel ncurses make gcc
```
or
-```sh
+```
# dnf install ncurses-devel ncurses make gcc
```
diff --git a/2020/ferguson1/HACKING.html b/2020/ferguson1/HACKING.html
index 6e996a51b..e1617d5b7 100644
--- a/2020/ferguson1/HACKING.html
+++ b/2020/ferguson1/HACKING.html
@@ -192,19 +192,19 @@ defaults if you don’t want to change the colour.
initialise a pair (make it 5 so as to not interfere with the script
customisability) and then you use the bkgd() function with the colour pair.
Something like this:
-
@@ -220,16 +220,16 @@ source code (include the single quotes!) respectively:
Let’s say you don’t want to use arrow keys or you don’t have arrow keys. Instead
you might want the keys l, r, u and d for the directions. Find the case
statements:
-
case KEY_LEFT:
-case KEY_RIGHT:
-case KEY_UP:
-case KEY_DOWN:
+
case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_UP:
+ case KEY_DOWN:
Replace KEY_LEFT with:
-
'l'
+
'l'
and do the same thing for the other directions too. If you want more than one
key e.g. the arrow keys and the letters just add another case statement e.g. for
left it might be:
-
case KEY_LEFT:case'l':
+
case KEY_LEFT: case 'l':
Yes the single quotes matter. You can do similar for the other input keys.
Please note that modifier keys like ctrl aren’t detectable or at least I’m
unaware of how to do so.
@@ -245,9 +245,9 @@ end of the game; I leave that as an exercise to the reader to implement two
different sets. Please also be aware that if you don’t want any information you
must set it to the below at the very least; defining it without a value is not
enough (it amounts to the parameters to a printf call):
-
#define J " ");
+
#define J " " );
If you don’t care about brief displays of ‘o’ at 0,0 you can just have:
-
#define J "");
+
#define J "");
That’s the bare minimum. Notice also that it’s been a long while since I’ve
tested this part but I think this is right.
Anyway as I said the score line has basic statistics that’s relatively easy to
@@ -262,7 +262,7 @@ bug. This however was something I didn’t quite like: I like having the
coordinates of where the snake is plus the other things that are there (a number
of which were added over time). Obviously this would take many bug sized bytes
(bites) even once let alone twice! Thus I made it into a define:
-
#define J Z(X:%d/%d Y:%d/%d S:%zu/%zu B:%zu\n), Y, y[-2], X,*y,A,g, c);
+
#define J Z(X:%d/%d Y:%d/%d S:%zu/%zu B:%zu\n), Y, y[-2], X,*y,A,g, c);
With the table below you can show a variety of other variables/statistics.
There’s another reason for changing this line though: depending on the terminal
width the line could cover the top wall; this can even happen only part of the
@@ -280,7 +280,7 @@ so if this line wasn’t there it would require changes to make it work right.
For an example this would only include the size of the snake and the number of
bugs eaten (I think I have this correct; I’ve made many changes to the point of
not wanting to mess with anything that’s unnecessary):
-
#define J Z(SIZE:%zu BUGS:%zu\n), A, c);
+
#define J Z(SIZE: %zu BUGS: %zu\n), A, c);
More generally the following expressions and data types (with format specifiers)
come to mind as information that might be of interest.
DESCRIPTION EXPRESSION TYPE FORMAT SPECIFIER
@@ -307,10 +307,10 @@ come to mind as information that might be of interest.
bug)
Make it so the snake starts at a random location
Quite simply change:
-
X = H /2; Y =*x /2;
+
X = H / 2; Y = *x / 2;
To be something like:
-
X = R(1,H-1);
- Y = R(2,*x-1);
+
X = R(1,H-1);
+ Y = R(2,*x-1);
Or whatever you might want it to be… (question to answer: will this work at
all? You decide!)
Additions (+)
@@ -407,22 +407,22 @@ their ruddy phone instead of where they’re walking (even when crossing a busy
street!).
If you look at the walls code you will see a ternary operator for both X and Y
coordinates. This of course is very different now but the idea remains the same:
-
if(p &&!(*O>=O[1]||H>=M(1)))
-{
-if(X<1||X>=H)
- X = X<1?H-1:1;
-if(Y<2||Y>=*O)
- Y = Y<2?*O-1:2;
-}
+
if (p && !(*O>=O[1]||H>=M(1)))
+ {
+ if (X<1||X>=H)
+ X = X<1?H-1:1;
+ if (Y<2||Y>=*O)
+ Y = Y<2?*O-1:2;
+ }
You can ignore the first if if you like; I’m not going to explain that part. The
inner if statements however are testing if the new snake coordinates are beyond
the walls (off screen). Depending on where the snake is it will set the
coordinates to the correct new location.
If however you wanted the walls to act as a barrier you could do something like
this instead (omitting the inner if statements here):
-
X=X<1?1:*H-1;
-
- Y=Y<2?2:*O-1;
+
X=X<1?1:*H-1;
+
+ Y=Y<2?2:*O-1;
Again though that’s just the idea; the code is dramatically different. The above
incidentally is not even complete.
You could also have it so depending on the WALLS value have it go through
diff --git a/2020/ferguson1/HACKING.md b/2020/ferguson1/HACKING.md
index 5c8bce9e7..f679f646b 100644
--- a/2020/ferguson1/HACKING.md
+++ b/2020/ferguson1/HACKING.md
@@ -78,7 +78,7 @@ initialise a pair (make it 5 so as to not interfere with the script
customisability) and then you use the bkgd() function with the colour pair.
Something like this:
-```c
+```
init_pair(5, COLOR_BLACK, COLOR_WHITE);
bkgd(COLOR_PAIR(5));
```
@@ -88,7 +88,7 @@ but that changes the background of the program anyway.
The standard colour identifiers are:
-```c
+```
COLOR_BLACK
COLOR_RED
COLOR_GREEN
@@ -124,7 +124,7 @@ Let's say you don't want to use arrow keys or you don't have arrow keys. Instead
you might want the keys `l`, `r`, `u` and `d` for the directions. Find the case
statements:
-```c
+```
case KEY_LEFT:
case KEY_RIGHT:
case KEY_UP:
@@ -133,7 +133,7 @@ statements:
Replace `KEY_LEFT` with:
-```c
+```
'l'
```
@@ -141,7 +141,7 @@ and do the same thing for the other directions too. If you want more than one
key e.g. the arrow keys and the letters just add another case statement e.g. for
left it might be:
-```c
+```
case KEY_LEFT: case 'l':
```
@@ -166,13 +166,13 @@ different sets. Please also be aware that if you don't want any information you
must set it to the below at the very least; defining it without a value is not
enough (it amounts to the parameters to a printf call):
-```c
+```
#define J " " );
```
If you don't care about brief displays of 'o' at 0,0 you can just have:
-```c
+```
#define J "");
```
@@ -194,7 +194,7 @@ coordinates of where the snake is plus the other things that are there (a number
of which were added over time). Obviously this would take many bug sized bytes
(bites) even once let alone twice! Thus I made it into a define:
-```c
+```
#define J Z(X:%d/%d Y:%d/%d S:%zu/%zu B:%zu\n), Y, y[-2], X,*y,A,g, c);
```
@@ -220,7 +220,7 @@ For an example this would only include the size of the snake and the number of
bugs eaten (I think I have this correct; I've made many changes to the point of
not wanting to mess with anything that's unnecessary):
-```c
+```
#define J Z(SIZE: %zu BUGS: %zu\n), A, c);
```
@@ -257,13 +257,13 @@ come to mind as information that might be of interest.
Quite simply change:
-```c
+```
X = H / 2; Y = *x / 2;
```
To be something like:
-```c
+```
X = R(1,H-1);
Y = R(2,*x-1);
```
@@ -395,7 +395,7 @@ street!).
If you look at the walls code you will see a ternary operator for both `X` and `Y`
coordinates. This of course is very different now but the idea remains the same:
-```c
+```
if (p && !(*O>=O[1]||H>=M(1)))
{
if (X<1||X>=H)
@@ -414,7 +414,7 @@ coordinates to the correct new location.
If however you wanted the walls to act as a barrier you could do something like
this instead (omitting the inner if statements here):
-```c
+```
X=X<1?1:*H-1;
Y=Y<2?2:*O-1;
diff --git a/2020/ferguson1/README.md b/2020/ferguson1/README.md
index 40e97670a..aaa7d1f22 100644
--- a/2020/ferguson1/README.md
+++ b/2020/ferguson1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2020 ferguson1 bugs](../../bugs.html#2020_fer
## To use:
-```sh
+```
WAIT=N WALLS=[01] EVADE=N SIZE=N MAXSIZE=N GROW=N SHEDS=N SHED=N CANNIBAL=[01] ./prog
# start pressing some arrow keys
```
@@ -87,7 +87,7 @@ and non-zero).
## Try:
-```sh
+```
make test
WAIT=75 WALLS=1 CANNIBAL=1 ./prog
@@ -211,7 +211,7 @@ features.
Because all IOCCC entries should have a man page I have included one (even
though much of it is what's also above). To render try:
-```sh
+```
man ./snake.1
```
diff --git a/2020/ferguson1/bugs.html b/2020/ferguson1/bugs.html
index 808ec0547..0ff4ed91e 100644
--- a/2020/ferguson1/bugs.html
+++ b/2020/ferguson1/bugs.html
@@ -141,7 +141,7 @@ like some of the other features this was not intentionally designed but is
simply a fun consequence of the features I did implement.
Let’s say you want to verify that the evade mode is at the right count. How
can you verify it without modifying the code? Try:
-
SIZE=0 SHED=1 SHEDS=1 EVADE=10 ./prog
+
SIZE=0 SHED=1 SHEDS=1 EVADE=10 ./prog
Since you start out at size 0 and you shed every movement then when you’re
size 10 (as long as you don’t eat a bug of course!) the bug should evade.
If you set it to SIZE=10 there would be a difference of 10. Now every
@@ -154,7 +154,7 @@ don’t at this time remember any I might have done.
One way to show this is in full is to set the initial size and growth size to a
high value; then try each one individually. For example:
-
SIZE=100 ./prog
+
SIZE=100 ./prog
In this case after you make the first move the snake will keep growing and
so the snake tail stays in the same spot until after it’s the ‘full size’.
When it has reached the full size then the entire body of the snake will
@@ -201,24 +201,24 @@ way negative size will force a win.
Here’s a fun output:
< <<<+
That’s from:
-
SHED=1 SHEDS=-1 ./prog
+
SHED=1 SHEDS=-1 ./prog
And right after that you would see:
YOU WIN!
X:72/156 Y:20/41 S:997/997 B:0
Try this though:
-
SHEDS=-1 SHED=25 ./prog
+
SHEDS=-1 SHED=25 ./prog
And you’ll see that you start to be the normal size but then you leave your
head several places until you end up getting to the max size (by way of it
being unsigned). This isn’t a bug even if it might seem like one. In fact
this is the basis of the grow/shrink mode of play that I talk about in the
gameplay.html (gameplay.md on GitHub) file.
Here’s another thing to be aware of. Let’s say you do:
-
SIZE=1 GROW=-1 ./prog
+
SIZE=1 GROW=-1 ./prog
How many bugs will it take before you win? In fact it’s two: you would see the
head twice: the second time once you ‘shrink’ down to size 0; it would then be
that if you get another bug you will be at the ‘max size’:
I.e. what happens if you’re growing - for example after just eating a bug - and
you’re racing towards your tail? If you’re behind it should be fine since you’re
@@ -271,23 +271,23 @@ how it’s done in Snake and works well). The minimum terminal size I require in
the game is 10 x 10. This includes the walls and score line.
Now the default max snake size is 997 but when the terminal is too small it
adjusts the max snake size. For 10 lines and 10 columns you would see:
-
$ make test
-terminal supports cursor movement
-terminal supports making cursor invisible
-terminal supports bold
-terminal supports colours
-
-terminal rows 10 (7 playable)
-terminal cols 10 (8 playable)
-
-snake size: 49 (max size: 49)
-bugs: 9 (max size: 9)
-
-at least 28 columns recommended for snake size 49 (is 10)
-at least 28 columns recommended for snake size 49 (is 10)
-
-1 problem detected (0 fatal).
-make:***[test] Error 1
+
$ make test
+ terminal supports cursor movement
+ terminal supports making cursor invisible
+ terminal supports bold
+ terminal supports colours
+
+ terminal rows 10 (7 playable)
+ terminal cols 10 (8 playable)
+
+ snake size: 49 (max size: 49)
+ bugs: 9 (max size: 9)
+
+ at least 28 columns recommended for snake size 49 (is 10)
+ at least 28 columns recommended for snake size 49 (is 10)
+
+ 1 problem detected (0 fatal).
+ make: *** [test] Error 1
First: what’s the problem? It’s just a warning that for the snake size of 49 the
recommended size of columns is 28. However this is just for the score text; with
only 10 columns it will overflow and wrap to the next line(s). But if you observe
diff --git a/2020/ferguson1/bugs.md b/2020/ferguson1/bugs.md
index 80adc6ed9..b5596128a 100644
--- a/2020/ferguson1/bugs.md
+++ b/2020/ferguson1/bugs.md
@@ -22,7 +22,7 @@ simply a fun consequence of the features I did implement.
Let's say you want to verify that the evade mode is at the right count. How
can you verify it without modifying the code? Try:
-```sh
+```
SIZE=0 SHED=1 SHEDS=1 EVADE=10 ./prog
```
@@ -44,7 +44,7 @@ don't at this time remember any I might have done.
One way to show this is in full is to set the initial size and growth size to a
high value; then try each one individually. For example:
-```sh
+```
SIZE=100 ./prog
```
@@ -113,7 +113,7 @@ Here's a fun output:
That's from:
-```sh
+```
SHED=1 SHEDS=-1 ./prog
```
@@ -126,7 +126,7 @@ And right after that you would see:
Try this though:
-```sh
+```
SHEDS=-1 SHED=25 ./prog
```
@@ -138,7 +138,7 @@ this is the basis of the grow/shrink mode of play that I talk about in the
Here's another thing to be aware of. Let's say you do:
-```sh
+```
SIZE=1 GROW=-1 ./prog
```
@@ -146,7 +146,7 @@ How many bugs will it take before you win? In fact it's two: you would see the
head twice: the second time once you 'shrink' down to size 0; it would then be
that if you get another bug you will be at the 'max size':
-```sh
+```
YOU WIN!
X:81/156 Y:35/41 S:997/997 B:2
```
@@ -228,7 +228,7 @@ the game is 10 x 10. This includes the walls and score line.
Now the default max snake size is 997 but when the terminal is too small it
adjusts the max snake size. For 10 lines and 10 columns you would see:
-```sh
+```
$ make test
terminal supports cursor movement
terminal supports making cursor invisible
diff --git a/2020/ferguson1/cannibalism.log.html b/2020/ferguson1/cannibalism.log.html
index efccfdc64..23c823e46 100644
--- a/2020/ferguson1/cannibalism.log.html
+++ b/2020/ferguson1/cannibalism.log.html
@@ -274,7 +274,7 @@ most of them.
Example 5: snake moving left with snake inside itsself
Another example invocation where the snake head is in the snake and where the snake
hadn’t yet moved (that is it was still growing):
-
CANNIBAL=1 SIZE=1500 GROW=2 MAXSIZE=1600 ./prog
+
CANNIBAL=1 SIZE=1500 GROW=2 MAXSIZE=1600 ./prog
It looked like:
X:55/89 Y:11/25 S:1564/1600 B:32
##########################################################################################
diff --git a/2020/ferguson1/cannibalism.log.md b/2020/ferguson1/cannibalism.log.md
index 172ec0b13..0e4f84aa2 100644
--- a/2020/ferguson1/cannibalism.log.md
+++ b/2020/ferguson1/cannibalism.log.md
@@ -184,7 +184,7 @@ most of them.
Another example invocation where the snake head is in the snake and where the snake
hadn't yet moved (that is it was still growing):
-```sh
+```
CANNIBAL=1 SIZE=1500 GROW=2 MAXSIZE=1600 ./prog
```
diff --git a/2020/ferguson1/crazy.log.html b/2020/ferguson1/crazy.log.html
index ba8f351b4..ed1b5da5a 100644
--- a/2020/ferguson1/crazy.log.html
+++ b/2020/ferguson1/crazy.log.html
@@ -123,7 +123,7 @@
As you will see it took 17 bugs to get down to below 0. Notice how I had to get
down to 0 more than once: because I moved enough times before I got the last
bug that I grew by 5 in size. I then however moved a bit more and ate a bug
diff --git a/2020/ferguson1/crazy.log.md b/2020/ferguson1/crazy.log.md
index b509c4968..46a6c83e7 100644
--- a/2020/ferguson1/crazy.log.md
+++ b/2020/ferguson1/crazy.log.md
@@ -1,6 +1,6 @@
The following are a few screen dumps of:
-```sh
+```
SIZE=100 SHEDS=5 GROW=-10 SHED=50 MAXSIZE=250 ./prog
```
diff --git a/2020/ferguson1/gameplay.html b/2020/ferguson1/gameplay.html
index af294eae6..02c46906c 100644
--- a/2020/ferguson1/gameplay.html
+++ b/2020/ferguson1/gameplay.html
@@ -451,9 +451,9 @@ setting the max size to a smaller value than the size you specify (or the
default) or setting the size to higher than the default (or < 0 which will end
up being > the max size though I suppose there might be some value that makes it
less than again - I’m not going to try and figure that out however). Anyway:
SIZE=-1 ./prog
+ YOU WIN!
+ X:24/49 Y:8/16 S:658/658 B:0
Observe that the size isn’t the default 997: because the screen size is too
small for that value (see terminals.md).
The reason I chose 997 is that it leaves a bit of a challenge for some (maybe
@@ -499,22 +499,22 @@ you have any form of epilepsy. Thank you.
If you want to draw the snake wherever you like on the screen you can do this by
modifying the wait time (for input) to -1 (or any value < 0): then the snake
does not move until you press a movement key. For example:
-
WAIT=-1 ./prog
+
WAIT=-1 ./prog
When you eat a bug the snake will grow and you can draw more. If you want to
make it so you can go through yourself:
-
WAIT=-1 CANNIBAL=1 ./prog
+
WAIT=-1 CANNIBAL=1 ./prog
If you don’t want to start out so small (i.e. you want to be able to draw more
quickly) you can just set the size to a bigger number (and you could do the same
with growth and moult/shed):
-
SIZE=50 CANNIBAL=1 WAIT=-1 ./prog
+
SIZE=50 CANNIBAL=1 WAIT=-1 ./prog
Do note that although you’re a bigger size you still grow one movement at a
time.
Okay but then if you get too many bugs the drawing will be over. If this proves
to be a problem simply do:
-
SIZE=100 CANNIBAL=1 WAIT=-1 GROW=0 ./prog
+
SIZE=100 CANNIBAL=1 WAIT=-1 GROW=0 ./prog
Or something like that (maybe make the size bigger but that’s up to you). You
could also set the max size to be the highest possible by saying
I discuss how this mode works in [spoilers.markdown][].
Here’s an example run where I spelt ‘SNAKE’. As you can see it’s far from
@@ -536,7 +536,7 @@ different colours and depending on the exact parameters you specify it could
easily be in the trigger range for epilepsy but potentially stimulation overload
too.
If you’re still here you can create this effect like:
-
WAIT=0 WALLS=1 CANNIBAL=1 ./prog
+
WAIT=0 WALLS=1 CANNIBAL=1 ./prog
As long as the bug evades you’ll find that the snake is growing because it’s
actually eating bugs; the computer is actually playing the game by itself! You
can still move the snake though it won’t seem like you have much control over
@@ -553,14 +553,14 @@ happen because the bug has to find a X and Y coordinate that’s not occupied an
so with fewer available it has a harder time finding a place in that one line.
What you’ll see is that first the snake will get to the size of 9 - whether it
shows to be 10 characters depends on whether or not it gets a bug before it can
get to that length - and then it’ll start shrinking until it’s just the head
@@ -568,7 +568,7 @@ then the head again (i.e. 1 then 0 in size) and then win! This is also in the
play.sh script.
Adjusting the time/speed
Of course you can also do something like:
-
WAIT=5 WALLS=1 CANNIBAL=1 ./prog
+
WAIT=5 WALLS=1 CANNIBAL=1 ./prog
Which although might not seem like it is significantly slower.
Moving the snake about to create patterns
If you press different direction keys in some pattern you will see a pattern
@@ -578,7 +578,7 @@ suppose also how much the bug moves and the chance of being eaten also).
Here’s an idea: how many moves is needed to make it possible to have some sort
of success in catching bugs? Obviously the dimensions will affect this value.
How long will it take for the snake to run into itself? For instance by doing:
-
WAIT=0 ./prog
+
WAIT=0 ./prog
On my 13” MacBook Pro (replaced later by a 16”) at the default settings going
horizontally the snake ran into itself at:
OW!
@@ -592,7 +592,7 @@ or growing to the full size directly. This is how it works:
You have a negative shedding growth and a positive growth size: negative and
positive winning. Depending on the parameters specified it might go one way over
the other. Try:
What this does is set the size to 150 (to make it not go down so quickly) and
then for each bug you eat it adds 5 to the size; for every 50 moves (that you
don’t get the bug) you shrink by 5. You will find that at times you might only
@@ -608,7 +608,7 @@ dumps with this idea.
You could also have it so that eating a bug makes you shrink and moving so many
moves you grow. I tried this and for me it was far more fun. The play.sh
also has this mode:
Obviously there are many other variations. The play.sh script has some
of them (the above is option 5; others are 4, 15 and 16 but only options 4 and 5
are called Grow / Shrink).
@@ -622,7 +622,7 @@ typical range of seizures is 3 to 30 flashes per seconds (but can be higher) and
that means that at EVADE=1 every 231ms there will be a flash in addition to the
snake moving too.
Anyway this might sound absurd but it can be somewhat hypnotic by doing:
-
EVADE=1 CANNIBAL=1 ./prog
+
EVADE=1 CANNIBAL=1 ./prog
And just moving the snake about not trying to catch any bugs - just let whatever
happens happen.
@@ -631,7 +631,7 @@ want to play a game without having to worry about winning or losing you can set
the growth size to 0 and then just move the snake round and round eating bugs
until you want to quit. You can enable cannibalism so that you don’t have to
worry about even running into yourself and losing:
-
As I was writing this document and the game modes I have thought of other game
modes (they were added) and I have come back to this document to add more modes.
@@ -650,9 +650,9 @@ reason as well as I simply enjoy it and thinking up new modes.
this file discusses as well as allowing to easily change the colours.
@@ -664,9 +664,9 @@ snake-colours above) and then gives you a list of game modes to play. You can
pass in the game variables but note that if you pass in a variable that the mode
you choose uses then the script will override what you pass in.
The game variables can be used for a variety of things including different
gameplay modes (as shown above) but here are some general notes about a few of them.
diff --git a/2020/ferguson1/gameplay.md b/2020/ferguson1/gameplay.md
index 65311b794..df76efb96 100644
--- a/2020/ferguson1/gameplay.md
+++ b/2020/ferguson1/gameplay.md
@@ -415,7 +415,7 @@ default) or setting the size to higher than the default (or < 0 which will end
up being > the max size though I suppose there might be some value that makes it
less than again - I'm not going to try and figure that out however). Anyway:
-```sh
+```
SIZE=-1 ./prog
YOU WIN!
X:24/49 Y:8/16 S:658/658 B:0
@@ -487,7 +487,7 @@ If you want to draw the snake wherever you like on the screen you can do this by
modifying the wait time (for input) to -1 (or any value < 0): then the snake
does not move until you press a movement key. For example:
-```sh
+```
WAIT=-1 ./prog
```
@@ -495,7 +495,7 @@ does not move until you press a movement key. For example:
When you eat a bug the snake will grow and you can draw more. If you want to
make it so you can go through yourself:
-```sh
+```
WAIT=-1 CANNIBAL=1 ./prog
```
@@ -503,7 +503,7 @@ If you don't want to start out so small (i.e. you want to be able to draw more
quickly) you can just set the size to a bigger number (and you could do the same
with growth and moult/shed):
-```sh
+```
SIZE=50 CANNIBAL=1 WAIT=-1 ./prog
```
@@ -513,14 +513,14 @@ time.
Okay but then if you get too many bugs the drawing will be over. If this proves
to be a problem simply do:
-```sh
+```
SIZE=100 CANNIBAL=1 WAIT=-1 GROW=0 ./prog
```
Or something like that (maybe make the size bigger but that's up to you). You
could also set the max size to be the highest possible by saying
-```sh
+```
MAXSIZE=-1
```
@@ -556,7 +556,7 @@ too.
If you're still here you can create this effect like:
-```sh
+```
WAIT=0 WALLS=1 CANNIBAL=1 ./prog
```
@@ -582,7 +582,7 @@ so with fewer available it has a harder time finding a place in that one line.
Here's how to make the bug move every time the snake moves:
-```sh
+```
CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 ./prog
```
@@ -591,7 +591,7 @@ Here's how to make the bug move every time the snake moves:
If you want to see the game 'win' try something like:
-```sh
+```
CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 MAXSIZE=10 ./prog
```
@@ -601,7 +601,7 @@ If you want to see the game 'win' try something like:
Here's a fun one I just thought of (a long time after these other modes were
thought of):
-```sh
+```
WAIT=0 EVADE=1 GROW=-1 SIZE=9 MAXSIZE=10 CANNIBAL=1 ./prog
```
@@ -616,7 +616,7 @@ then the head again (i.e. 1 then 0 in size) and then win! This is also in the
Of course you can also do something like:
-```sh
+```
WAIT=5 WALLS=1 CANNIBAL=1 ./prog
```
@@ -635,7 +635,7 @@ of success in catching bugs? Obviously the dimensions will affect this value.
How long will it take for the snake to run into itself? For instance by doing:
-```sh
+```
WAIT=0 ./prog
```
@@ -660,7 +660,7 @@ You have a negative shedding growth and a positive growth size: negative and
positive winning. Depending on the parameters specified it might go one way over
the other. Try:
-```sh
+```
SIZE=150 SHEDS=-5 GROW=10 SHED=50 MAXSIZE=250 ./prog
```
@@ -683,7 +683,7 @@ You could also have it so that eating a bug makes you shrink and moving so many
moves you grow. I tried this and for me it was far more fun. The [play.sh][]
also has this mode:
-```sh
+```
SIZE=100 SHEDS=5 GROW=-10 SHED=50 MAXSIZE=250 ./prog
```
@@ -705,7 +705,7 @@ snake moving too.
Anyway this might sound absurd but it can be somewhat hypnotic by doing:
-```sh
+```
EVADE=1 CANNIBAL=1 ./prog
```
@@ -721,7 +721,7 @@ the growth size to 0 and then just move the snake round and round eating bugs
until you want to quit. You can enable cannibalism so that you don't have to
worry about even running into yourself and losing:
-```sh
+```
GROW=0 CANNIBAL=1 ./prog
```
@@ -752,13 +752,13 @@ this file discusses as well as allowing to easily change the colours.
To do this use the [snake-colours][] script like so:
-```sh
+```
./snake-colours
```
If you want to pass in specific variables you can do that too e.g.:
-```sh
+```
CANNIBAL=1 ./snake-colours
```
@@ -777,13 +777,13 @@ you choose uses then the script will override what you pass in.
To use you can do something like:
-```sh
+```
./play.sh
```
Or to make it so walls are an obstacle:
-```sh
+```
WALLS=0 ./play.sh
```
diff --git a/2020/ferguson1/index.html b/2020/ferguson1/index.html
index f35ffa2ea..5e0c99042 100644
--- a/2020/ferguson1/index.html
+++ b/2020/ferguson1/index.html
@@ -141,14 +141,14 @@ Location: US - United States of America
where N is a number and [01] is either 1 or 0 (or more correctly zero
and non-zero).
Variables:
@@ -202,25 +202,25 @@ whether you can go through the Snake or not. Default is 0
(cannot - die if you try).
Try:
-
make test
-
-WAIT=75 WALLS=1 CANNIBAL=1 ./prog
-
-./prog
-
-SIZE=-1 ./prog
-
-CANNIBAL=1 WALLS=1 WAIT=50 EVADE=200 ./prog
-
-WAIT=75 GROW=-1 SIZE=5 CANNIBAL=1 ./prog
-
-CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 MAXSIZE=10 ./prog
-
-./play
-# allows you to configure colours and has various pre-configured gameplay modes
-
-./snake-colours
-# allows for configuring colours
+
make test
+
+ WAIT=75 WALLS=1 CANNIBAL=1 ./prog
+
+ ./prog
+
+ SIZE=-1 ./prog
+
+ CANNIBAL=1 WALLS=1 WAIT=50 EVADE=200 ./prog
+
+ WAIT=75 GROW=-1 SIZE=5 CANNIBAL=1 ./prog
+
+ CANNIBAL=1 WALLS=1 WAIT=0 EVADE=1 MAXSIZE=10 ./prog
+
+ ./play
+ # allows you to configure colours and has various pre-configured gameplay modes
+
+ ./snake-colours
+ # allows for configuring colours
Judges’ remarks:
As the Gadsden flag warns, beware of the snake!
This game has a number of configurable pitfalls including walls and snakes.
@@ -306,7 +306,7 @@ look like bugs but aren’t as well as documenting a built-in test unit for some
features.
Because all IOCCC entries should have a man page I have included one (even
though much of it is what’s also above). To render try:
-
man ./snake.1
+
man ./snake.1
The COMPILING.html file has a few portability
notes and the HACKING.html file has some
information on how one might modify things, things that could be implemented
diff --git a/2020/ferguson1/spoilers.html b/2020/ferguson1/spoilers.html
index 4fdec4773..276176c87 100644
--- a/2020/ferguson1/spoilers.html
+++ b/2020/ferguson1/spoilers.html
@@ -762,9 +762,9 @@ returning E() I am returning 1 but if the end of main() is reached
returned. In either case curses is ended.
One of these optimisations saved four bytes simply by taking advantage of the
value of a loop iterator after the loop. The loop is:
-
for(I =0; A && I < A -1;++I)
+
for (I = 0; A && I < A - 1; ++I)
However after the loop I had this:
-
A >1&& q(n[A -1],e[A -1],'o');
+
A > 1 && q(n[A - 1],e[A - 1], 'o');
When I was considering moving that line to before the loop it occurred to me
that as long as A > 0 then A - 1 == I after the loop. I still had to check
for A > 1 but I could refer to just I instead of A - 1!
@@ -779,31 +779,31 @@ place at this point) I was looking at the code to see if I could figure out how
to save even more bytes. Here are some that I found interesting ways to go about
the problem.
First, the function that turns on colours looked like:
if (h) attron(m(PAIR(L)));
+ else attroff(m(PAIR(L)));
But I thought is that else actually needed? If I were to switch the order so
that the attroff() is called first then I could just do an if (h) -
therefore getting rid of the else! But then I thought why not do what I’ve
done elsewhere? I had:
-
attroff(m(PAIR(L)));
-if(h) attron(m(PAIR(L)));
+
attroff(m(PAIR(L)));
+ if (h) attron(m(PAIR(L)));
But I then saved an extra byte by making it:
-
attroff(m(PAIR(L)));
- h && attron(m(PAIR(L)));
+
attroff(m(PAIR(L)));
+ h && attron(m(PAIR(L)));
That saved two bytes.
Second let’s look at the B() function: there were two things I thought of that
would save some bytes (I no longer know how many but a few at least possibly six
or even more). I had the following code:
-
if(V && U && o){ S(N); b(1);}
+
if (V && U && o) { S(N); b(1); }
This made sure that only if the snake has caught a bug should it grow by the
growth size and increase the bug count. But was checking for the V or U
necessary? I gave it a look over and it occurred to me: the only time B() is
called with 1 (thus o is 1 so the if is true) was if the bug actually is
caught. That means I could remove the V && U && part of the if! Thus it became
instead:
-
if(o){ S(N); b(1);}
+
if (o) { S(N); b(1); }
Then this
-
!o && V && U && q U,V,' ');
+
!o && V && U && q U,V,' ');
…is to make sure to only clear the spot the bug is (or was) at if
the bug was NOT eaten. Why not eaten? Because if it was eaten it means the
snake’s head will be there!
@@ -818,7 +818,7 @@ unfortunately the snake has to be placed first since the bug cannot be placed
where the snake already is. So if I had to make sure the game had started (the
snake has moved at least once) what could I check? In fact that means the
direction is not 0! So I could just replace it with:
-
!o && D && q *U,*V,' ');
+
!o && D && q *U,*V,' ');
That reduced the count further. But then I wondered if even that much is needed.
The condition is that the bug has evaded which means the snake has moved already
(so game started). What calls to this function happen before the game starts
@@ -831,7 +831,7 @@ to check for is that !o: because after this call before the game ev
the score line is updated: so the empty space will be overwritten anyway. And if
the score line is made an empty string it doesn’t matter because it’ll appear as
all spaces anyway. Thus I could save another three bytes by changing it to:
-
!o && q *U,*V,' ');
+
!o && q *U,*V,' ');
Technically it would be a " " (see HACKING.html or on GitHub
HACKING.md) else for N (not referring to the variable though it might very
well matter here too) movements (i.e. due to sizes) you will at times (e.g.
diff --git a/2020/ferguson1/spoilers.md b/2020/ferguson1/spoilers.md
index 051ce9f88..5c4dab325 100644
--- a/2020/ferguson1/spoilers.md
+++ b/2020/ferguson1/spoilers.md
@@ -818,13 +818,13 @@ returned. In either case curses is ended.
One of these optimisations saved four bytes simply by taking advantage of the
value of a loop iterator after the loop. The loop is:
-```c
+```
for (I = 0; A && I < A - 1; ++I)
```
However after the loop I had this:
-```c
+```
A > 1 && q(n[A - 1],e[A - 1], 'o');
```
@@ -847,7 +847,7 @@ the problem.
First, the function that turns on colours looked like:
-```c
+```
if (h) attron(m(PAIR(L)));
else attroff(m(PAIR(L)));
```
@@ -857,14 +857,14 @@ that the `attroff()` is called first then I could just do an `if (h)` -
therefore getting rid of the `else`! But then I thought why not do what I've
done elsewhere? I had:
-```c
+```
attroff(m(PAIR(L)));
if (h) attron(m(PAIR(L)));
```
But I then saved an extra byte by making it:
-```c
+```
attroff(m(PAIR(L)));
h && attron(m(PAIR(L)));
```
@@ -875,7 +875,7 @@ Second let's look at the `B()` function: there were two things I thought of that
would save some bytes (I no longer know how many but a few at least possibly six
or even more). I had the following code:
-```c
+```
if (V && U && o) { S(N); b(1); }
```
@@ -886,13 +886,13 @@ called with `1` (thus `o` is 1 so the if is true) was if the bug actually is
caught. That means I could remove the `V && U &&` part of the if! Thus it became
instead:
-```c
+```
if (o) { S(N); b(1); }
```
Then this
-```c
+```
!o && V && U && q U,V,' ');
```
@@ -913,7 +913,7 @@ where the snake already is. So if I had to make sure the game had started (the
snake has moved at least once) what could I check? In fact that means the
direction is not 0! So I could just replace it with:
-```c
+```
!o && D && q *U,*V,' ');
```
@@ -930,7 +930,7 @@ the score line is updated: so the empty space will be overwritten anyway. And if
the score line is made an empty string it doesn't matter because it'll appear as
all spaces anyway. Thus I could save another three bytes by changing it to:
-```c
+```
!o && q *U,*V,' ');
```
diff --git a/2020/ferguson1/terminals.html b/2020/ferguson1/terminals.html
index 30281c68c..377d52ba1 100644
--- a/2020/ferguson1/terminals.html
+++ b/2020/ferguson1/terminals.html
@@ -151,7 +151,7 @@ movement is required) I have provided a source file that can test your terminal
for the capabilities I use in the entry.
It also tries to determine the minimum number of columns to play without the
status line overflowing - even with the dynamic length. Try:
-
$ make test
+
$ make test
This compiles the program termcaps.c and runs it; you should see something like:
terminal supports cursor movement
terminal supports making cursor invisible
@@ -178,21 +178,21 @@ maximum (capped) snake size.
If I pass in any of the variables GROW, MAXSIZE, SIZE and/or
LINES or COLUMNS it bases its calculations on those variables. For
example:
terminal supports cursor movement
+ terminal supports making cursor invisible
+ terminal supports bold
+ terminal supports colours
+
+ terminal rows 41 (38 playable)
+ terminal cols 155 (153 playable)
+
+ snake size: 5776 (max size: 5776)
+ bugs: 5771 (max size: 5771)
+
+ at least 37 columns (currently 155) recommended for snake size 5776
+ at least 37 columns (currently 155) recommended for capped snake size 5776
+
+ No problems detected.
As you can see it tells you the max size (the ‘capsized’ snake) as well as the
requested max size (if the requested size is bigger than the capped size then it
will be set to that value instead) of the snake. The capped size is like in the
@@ -224,12 +224,12 @@ resize the window with first. But what if you want exacts?
To specify the lines/columns of curses program per instance use the LINES and
COLUMNS environmental variables.
For demonstration consider the following:
-
$ echo $LINES$COLUMNS
-42 157
+
$ echo $LINES $COLUMNS
+ 42 157
Note: I subtract 1 from the max y/x and the max coords in the game output
include the walls and score line but these values are for the terminal itself.
Say you want 55 columns:
-
$ COLUMNS=55 ./prog
+
$ COLUMNS=55 ./prog
This will force curses to detect the max columns (X) of your terminal (for the
game dimensions) - to be 55; it might look like this instead:
X:27/54 Y:20/41 S:5/997 B:0
@@ -245,8 +245,8 @@ etc. For the game you might not see the final score.
In my tests there is one thing that at least allows you to see the final score
and that is by running clear before running the program. That’s what the
prog.alt version does. You might run it as one of:
-
LINES=20 ./prog.alt
-LINES=20 ./snake.alt
+
LINES=20 ./prog.alt
+ LINES=20 ./snake.alt
Even if the final score is visible though the terminal may very well still be
messed up. There are numerous things you might try but probably the easiest is
to run the game again without modifying the dimensions (and then just quit) or
@@ -259,7 +259,7 @@ even just the reset command.
(the line-feed character is normally control-J) to get the terminal
to work, as carriage-return may no longer work in the abnormal state.
If you don’t have the reset utility you can try:
-
echo-e\\033c
+
echo -e \\033c
Otherwise try clear; stty sane (that will turn on echo also) or if all else
fails log out and back in.
What then? Well expect trouble; curses will not know any better and the max
number of lines will be 997. If they were to do:
-
COLUMNS=997 ./prog
+
COLUMNS=997 ./prog
Then they will see a different effect. Again the same reason: the player trying
to be funny.
The game will try and be funny in return and you can expect it to not function
@@ -306,7 +306,7 @@ GitHub) file).
According to my tests for monochrome terminals the screen has the white and
black background; if terminal is configured to be black background white
foreground that is the order it is too. You can try that like:
-
TERM=linux-m ./prog
+
TERM=linux-m ./prog
But I do not specifically check if the terminal has colours. Is there a curses
implementation that has a problem here? Below I explain what to comment out
should you need colours to be disabled but I personally have not run into any
@@ -328,19 +328,19 @@ support in the source code itself.
Based on the two as well as the fact that monochrome terminals (I’ve tried under
both Linux and macOS) seem to work fine I believe I am fine here too. And to
confirm this I wrote the following code with the output below:
@@ -348,22 +348,22 @@ confirm this I wrote the following code with the output below:
possible colour pairs than I have used so that’s not a problem either. Perhaps
even it would only be a runtime error if the colours are supported and the
number is out of the range? To try and figure this out I did another test:
-
I got the output as if colours weren’t used: 0 and 0. With coloured terminals
however it was not visible. If I however comment out the call to bkgd() I get
instead:
diff --git a/2020/ferguson1/terminals.md b/2020/ferguson1/terminals.md
index 0bb19941e..efe19fde6 100644
--- a/2020/ferguson1/terminals.md
+++ b/2020/ferguson1/terminals.md
@@ -30,7 +30,7 @@ for the capabilities I use in the entry.
It also tries to determine the minimum number of columns to play without the
status line overflowing - even with the dynamic length. Try:
-```sh
+```
$ make test
```
@@ -67,7 +67,7 @@ If I pass in any of the variables **GROW**, **MAXSIZE**, **SIZE** and/or
**LINES** or **COLUMNS** it bases its calculations on those variables. For
example:
-```sh
+```
terminal supports cursor movement
terminal supports making cursor invisible
terminal supports bold
@@ -129,7 +129,7 @@ To specify the lines/columns of curses program per instance use the `LINES` and
For demonstration consider the following:
-```sh
+```
$ echo $LINES $COLUMNS
42 157
```
@@ -139,7 +139,7 @@ include the walls and score line but these values are for the terminal itself.
Say you want 55 columns:
-```sh
+```
$ COLUMNS=55 ./prog
```
@@ -166,7 +166,7 @@ In my tests there is one thing that at least allows you to see the final score
and that is by running `clear` before running the program. That's what the
prog.alt version does. You might run it as one of:
-```sh
+```
LINES=20 ./prog.alt
LINES=20 ./snake.alt
```
@@ -190,7 +190,7 @@ The Linux man page says:
If you don't have the reset utility you can try:
-```sh
+```
echo -e \\033c
```
@@ -209,14 +209,14 @@ along and thinks he/she will be clever and mess with the dimensions a bit. Let's
say they have a 13" monitor and they think it'd be funny to see how 997 lines
would work; they might try something like:
-```sh
+```
LINES=997 ./prog
```
What then? Well expect trouble; curses will not know any better and the max
number of lines will be 997. If they were to do:
-```sh
+```
COLUMNS=997 ./prog
```
@@ -265,7 +265,7 @@ According to my tests for monochrome terminals the screen has the white and
black background; if terminal is configured to be black background white
foreground that is the order it is too. You can try that like:
-```sh
+```
TERM=linux-m ./prog
```
@@ -301,7 +301,7 @@ Based on the two as well as the fact that monochrome terminals (I've tried under
both Linux and macOS) seem to work fine I believe I am fine here too. And to
confirm this I wrote the following code with the output below:
-```c
+```
#include
int main()
@@ -314,7 +314,7 @@ confirm this I wrote the following code with the output below:
}
```
-```sh
+```
TERM=linux-m ./colour_pairs
COLORS: 0
COLOR_PAIRS: 0
@@ -332,7 +332,7 @@ possible colour pairs than I have used so that's not a problem either. Perhaps
even it would only be a runtime error if the colours are supported and the
number is out of the range? To try and figure this out I did another test:
-```c
+```
int main()
{
initscr();
@@ -351,7 +351,7 @@ number is out of the range? To try and figure this out I did another test:
Running it like
-```sh
+```
TERM=linux-m ./colour_pairs
```
diff --git a/2020/ferguson1/troubleshooting.html b/2020/ferguson1/troubleshooting.html
index 4e4c4c49a..789a4be37 100644
--- a/2020/ferguson1/troubleshooting.html
+++ b/2020/ferguson1/troubleshooting.html
@@ -372,7 +372,7 @@ hit a key every time to move because it is blocking.
Can you run into the wall since you didn’t specify a value and the default is 1?
No. That’s not the way it works. By saying WALLS= you have told the system that
there is that environmental variable. However the way the strtoul() functions
@@ -381,12 +381,12 @@ it’s wasteful (iocccsize wise) and I have never felt that having invalid input
for a number could have a better value than 0.
If however you were to give valid input followed by invalid input the valid
input would be parsed. For example:
-
WALLS=1test ./prog
+
WALLS=1test ./prog
would let you go through the walls. On the other hand
-
WALLS=test1 ./prog
+
WALLS=test1 ./prog
would not. Furthermore if you specify the same variable more than once it’s the
last one that counts. For example:
-
WALLS=0 WALLS=1 CANNIBAL=1 CANNIBAL=0 ./prog
+
WALLS=0 WALLS=1 CANNIBAL=1 CANNIBAL=0 ./prog
would allow you to go through walls but you could not cannibalise.
Also note that I specify base 0 which means that you can also have it in hex and
octal. These are all the same:
@@ -421,17 +421,17 @@ will end (yes things that haven’t begun can be ended).
If calloc() fails to obtain the needed memory you’ll see something like (here it
was before I added proper - to make the perfect and obvious pun - capsizing
so that by setting the size to -1 it went to the max unsigned value):
BTW: There are two arrays that have to be MAXSIZE (technically + 1).
Is it possible that some value specified by the user could mess this up? I do
not know but what I do know is that because it’s unsigned it can’t be negative;
if the max size is 0 then the array size will be 1 but it won’t matter because
the snake size will be >= that max anyway. But here’s a curious output:
Why does it show snake size as 0 when I specified 1? It’s because the max size
is 0 and I limit the size to be no bigger than the max size.
WALLS= ./prog
```
@@ -342,20 +342,20 @@ for a number could have a better value than 0.
If however you were to give valid input followed by invalid input the valid
input would be parsed. For example:
-```sh
+```
WALLS=1test ./prog
```
would let you go through the walls. On the other hand
-```sh
+```
WALLS=test1 ./prog
```
would not. Furthermore if you specify the same variable more than once it's the
last one that counts. For example:
-```sh
+```
WALLS=0 WALLS=1 CANNIBAL=1 CANNIBAL=0 ./prog
```
@@ -414,7 +414,7 @@ If `calloc()` fails to obtain the needed memory you'll see something like (here
was before I added proper - to make the perfect and obvious pun - capsizing
so that by setting the size to -1 it went to the max unsigned value):
-```sh
+```
$ MAXSIZE=-1 ./prog
memory error
X:0/157 Y:0/42 S:3/18446744073709551614 B:0
@@ -428,7 +428,7 @@ not know but what I do know is that because it's unsigned it can't be negative;
if the max size is 0 then the array size will be 1 but it won't matter because
the snake size will be >= that max anyway. But here's a curious output:
-```sh
+```
SIZE=1 MAXSIZE=0 ./prog
YOU WIN!
X:78/156 Y:20/41 S:0/0 B:0
diff --git a/2020/ferguson2/README.md b/2020/ferguson2/README.md
index 1747ae26b..b21ef2414 100644
--- a/2020/ferguson2/README.md
+++ b/2020/ferguson2/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,7 +11,7 @@ at once. See [Alternate code](#alternate-code) below.
## To use:
-```sh
+```
./prog
# get recode help:
@@ -49,13 +49,13 @@ are allowed.
## Try:
-```sh
+```
./try.sh
```
What does:
-```sh
+```
echo | ./recode
echo | ./recode -v
```
@@ -72,14 +72,14 @@ and to make it a bit more like the real thing.
### Alternate build:
-```sh
+```
make alt
```
The default time to sleep is 400000 microseconds but you can change this by
doing:
-```sh
+```
make clobber SLEEP=600000 alt
```
@@ -93,7 +93,7 @@ Use `prog.alt` as you would `prog` above.
### Alternate try:
-```sh
+```
./try.alt.sh
```
@@ -110,7 +110,7 @@ There is a good deal of useful documentation that is provided with this entry:
* [enigma.1](enigma.1) - A useful man page for this entry. To render, try:
-```sh
+```
man ./enigma.1
```
@@ -251,7 +251,7 @@ the result (after finishing the enciphering).
If you run it like:
-```sh
+```
./prog -
```
@@ -283,7 +283,7 @@ program as well as how to use the two winning entries of the [Morse
code](https://en.wikipedia.org/wiki/Morse_code) that I referred to earlier:
-```sh
+```
$ ./prog -
Ring 1: 3
Setting 1: I
@@ -317,7 +317,7 @@ default settings; as the judges suggest this invocation I will not show it here.
But you can also type it out like this:
-```sh
+```
$ ./prog
IOCCC
UUMMX
@@ -328,7 +328,7 @@ The IOCCC comes from stdin; the `UUMMX` is written to stdout.
If I compile the 2014 entry and copy it to my local directory as
`vik` I might do:
-```sh
+```
$ echo TEST|./prog |./vik | mplayer -demuxer rawaudio -
```
@@ -340,7 +340,7 @@ a bug in that entry (Fedora, CentOS and macOS all affected).
For example I can use the syntax provided in the winning remarks along with my
entry to write it to a file. Say:
-```sh
+```
$ echo TEST|./prog |./vik > test.raw
$ ./vik e < test.raw | ./prog
LEST
@@ -348,21 +348,21 @@ entry to write it to a file. Say:
Why did that happen? This shows more details:
-```sh
+```
$ ./vik e < test.raw
SCWV
```
However as can be seen the first char is wrong:
-```sh
+```
$ echo TEST|./prog
KCWV
```
And piping the original output to my entry itself you get the original input:
-```sh
+```
$ echo TEST | ./prog | ./prog
TEST
```
@@ -372,7 +372,7 @@ idea anyway. Neither do I know if the original transcoding is correct.
What if I use the input string `LEST` instead? In that case it worked fine:
-```sh
+```
$ echo LEST | ./prog | ./vik > lest.raw
$ ./vik e < lest.raw | ./prog
LEST
@@ -380,7 +380,7 @@ What if I use the input string `LEST` instead? In that case it worked fine:
But there's one obvious question, right? Let's try the most important one:
-```sh
+```
$ echo IOCCC | ./prog | ./vik > ioccc.raw
$ ./vik e < ioccc.raw
UUMMX
@@ -396,7 +396,7 @@ too. Notice also how it showed the same output that my program gave it - `UUMMX`
What about the other [Morse code entry](../../1998/dorssel/dorssel.c)?
-```sh
+```
$ echo IOCCC | ./prog | ./dorssel
..- ..- -- -- -..-
```
@@ -441,7 +441,7 @@ The parser is in a sense rather rudimentary but allows for both interactive and
automatic (e.g. via the [recode](recode.c) program) input. This does mean that
something like the following can happen:
-```sh
+```
$ ./prog -
Ring 1: 1AB
Setting 1: Position 1: Ring 2: 2CD
@@ -504,7 +504,7 @@ should help you remember (though not at this time in our world it might help you
later on?). This might become even more useful after the challenge is accepted,
accomplished and made use of! :)
-```sh
+```
$ echo ABC | ./prog
GYM
$ echo ABC | ./prog | ./prog
@@ -536,7 +536,7 @@ ended his life. (I later made a bug fix but I consider this inconsequential).
As for [recode.c][] though I really love this:
-```c
+```
/\
/ This is *not* what you think:
```
@@ -552,13 +552,13 @@ It's an [Enigma machine](https://en.wikipedia.org/wiki/Enigma_machine) simulator
that proof that it's obfuscated itself?! :) Silliness aside [obfuscation.txt][]
has some of the ways I think this entry is obfuscated. To decipher try:
-```sh
+```
./recode -Robfuscation.key -fobfuscation.txt | ./prog - 2>/dev/null > obfuscation.md
```
To encipher:
-```sh
+```
./recode -Robfuscation.key -fobfuscation.md | ./prog - 2>/dev/null > obfuscation.txt
```
diff --git a/2020/ferguson2/index.html b/2020/ferguson2/index.html
index bcf65d597..3e3da234a 100644
--- a/2020/ferguson2/index.html
+++ b/2020/ferguson2/index.html
@@ -141,62 +141,62 @@ Location: US - United States of America
To build:
-
make
+
make
The author provided alternate code that prints the output one character at a
time to make it a bit more like the real thing in that it isn’t dumped out all
at once. See Alternate code below.
To use:
-
./prog
-
-# get recode help:
-./recode-h
-
-# general syntax for recode passing to Enigma machine:
-./recode[options]|./prog-2>/dev/null
-# general syntax for recode without passing to Enigma machine:
-./recode[options]
-
-# recode prompts for settings; pass to Enigma machine:
-./recode|./prog-2>/dev/null
-
-# recode reads from input file, prompts for settings; passed to Enigma machine:
-./recode-finput|./prog-2>/dev/null
-
-# recode reads config from string or file; passed to Enigma machine after
-# prompting for input:
-./recode-R<string|file>|./prog-2>/dev/null
-
-# write config to output file; passed to Enigma machine after prompting for
-# input:
-./recode-o<config>|./prog-2>/dev/null
-
-# pseudo-randomly select settings
-./recode-r
-
-# show Enigma machine settings after selection / generation:
-./recode-v
+
./prog
+
+ # get recode help:
+ ./recode -h
+
+ # general syntax for recode passing to Enigma machine:
+ ./recode [options] | ./prog - 2>/dev/null
+ # general syntax for recode without passing to Enigma machine:
+ ./recode [options]
+
+ # recode prompts for settings; pass to Enigma machine:
+ ./recode | ./prog - 2>/dev/null
+
+ # recode reads from input file, prompts for settings; passed to Enigma machine:
+ ./recode -finput | ./prog - 2>/dev/null
+
+ # recode reads config from string or file; passed to Enigma machine after
+ # prompting for input:
+ ./recode -R<string|file> | ./prog - 2>/dev/null
+
+ # write config to output file; passed to Enigma machine after prompting for
+ # input:
+ ./recode -o<config> | ./prog - 2>/dev/null
+
+ # pseudo-randomly select settings
+ ./recode -r
+
+ # show Enigma machine settings after selection / generation:
+ ./recode -v
NOTE: in recode no spaces between options and option arguments
are allowed.
Try:
-
./try.sh
+
./try.sh
What does:
-
echo|./recode
-echo|./recode-v
+
echo | ./recode
+ echo | ./recode -v
do?
Alternate code:
This version, prog.alt.c, writes a character at a time, sleeping
after each character, so that one can read it more easily (for longer output)
and to make it a bit more like the real thing.
Alternate build:
-
make alt
+
make alt
The default time to sleep is 400000 microseconds but you can change this by
doing:
-
make clobber SLEEP=600000 alt
+
make clobber SLEEP=600000 alt
to change it to 600000 microseconds. It guards against negative numbers.
Alternate use:
Use prog.alt as you would prog above.
Alternate try:
-
./try.alt.sh
+
./try.alt.sh
Notice how only the last part should use the prog.alt. Why? Try it and find
out! Can you figure out why this works this way?
Judges’ remarks:
@@ -205,7 +205,7 @@ out! Can you figure out why this works this way?
enigma.1 - A useful man page for this entry. To render, try:
@@ -317,7 +317,7 @@ leave this in for historical purposes.
for input (end with EOF). At that point it’ll process the input string and print
the result (after finishing the enciphering).
If you run it like:
-
./prog-
+
./prog -
It will prompt you for the settings of the machine (example below).
The first group is in the order of
rotor (number),
@@ -338,78 +338,78 @@ on GitHub see here) though one might need a di
of exercise after taking up the challenge! :-) These however show the general
program as well as how to use the two winning entries of the Morse
code that I referred to earlier:
-
$ ./prog -
-Ring 1: 3
-Setting 1: I
-Position 1: O
-Ring 2: 1
-Setting 2: C
-Position 2: C
-Ring 3: 5
-Setting 3: C
-Position 3: Z
-Reflector: 2
-Plugboard pair 1: CO
-Plugboard pair 2: DE
-Plugboard pair 3: SN
-Plugboard pair 4: XY
-Plugboard pair 5: MS
-Plugboard pair 6: AT
-Plugboard pair 7: VF
-Plugboard pair 8: UR
-Plugboard pair 9: KL
-Plugboard pair 10: BJ
-IOCCC
-^D
-CFDRG
+
$ ./prog -
+ Ring 1: 3
+ Setting 1: I
+ Position 1: O
+ Ring 2: 1
+ Setting 2: C
+ Position 2: C
+ Ring 3: 5
+ Setting 3: C
+ Position 3: Z
+ Reflector: 2
+ Plugboard pair 1: CO
+ Plugboard pair 2: DE
+ Plugboard pair 3: SN
+ Plugboard pair 4: XY
+ Plugboard pair 5: MS
+ Plugboard pair 6: AT
+ Plugboard pair 7: VF
+ Plugboard pair 8: UR
+ Plugboard pair 9: KL
+ Plugboard pair 10: BJ
+ IOCCC
+ ^D
+ CFDRG
Notice that all output except the deciphered/enciphered text is sent to stdout.
If I didn’t specify the - by e.g. echo IOCCC | ./prog then it will use the
default settings; as the judges suggest this invocation I will not show it here.
But you can also type it out like this:
-
$ ./prog
-IOCCC
-UUMMX
+
$ ./prog
+ IOCCC
+ UUMMX
The IOCCC comes from stdin; the UUMMX is written to stdout.
If I compile the 2014 entry and copy it to my local directory as
vik I might do:
And you would hear Morse code of the
Enigma output
of ‘TEST’ (i.e. KCWV)! Or perhaps not in this case. I’m not sure: I discovered
a bug in that entry (Fedora, CentOS and macOS all affected).
For example I can use the syntax provided in the winning remarks along with my
entry to write it to a file. Say:
Phew! The program redeemed itself after the test failure! :)
(Technically above it didn’t print a newline after the output and this is how it
is with some of the things I pasted in the other file and maybe others here
too. Notice also how it showed the same output that my program gave it - UUMMX.)
I have included a supplementary program recode.c that can do a number of
things which acts as a kind of wrapper and configurator to my entry. By default
@@ -440,26 +440,26 @@ make it more flexible by a wrapper program.
The parser is in a sense rather rudimentary but allows for both interactive and
automatic (e.g. via the recode program) input. This does mean that
something like the following can happen:
-
$ ./prog -
-Ring 1: 1AB
-Setting 1: Position 1: Ring 2: 2CD
-Setting 2: Position 2: Ring 3: 3
-Setting 3: A
-Position 3: B
-Reflector: 1A
-Plugboard pair 1: BC
-Plugboard pair 2: ..
-Plugboard pair 3: ..
-Plugboard pair 4: DE
-Plugboard pair 5: FG
-Plugboard pair 6: HI
-Plugboard pair 7: JK
-Plugboard pair 8: LM
-Plugboard pair 9: NO
-Plugboard pair 10: PQ
-IOCCC
-WD
-SIRDK
+
$ ./prog -
+ Ring 1: 1AB
+ Setting 1: Position 1: Ring 2: 2CD
+ Setting 2: Position 2: Ring 3: 3
+ Setting 3: A
+ Position 3: B
+ Reflector: 1A
+ Plugboard pair 1: BC
+ Plugboard pair 2: ..
+ Plugboard pair 3: ..
+ Plugboard pair 4: DE
+ Plugboard pair 5: FG
+ Plugboard pair 6: HI
+ Plugboard pair 7: JK
+ Plugboard pair 8: LM
+ Plugboard pair 9: NO
+ Plugboard pair 10: PQ
+ IOCCC
+ WD
+ SIRDK
First of all: what is that WD? I didn’t type that but it showed up hitting
ctrl-d to end input.
If everything is input correctly it would show nothing except the actual
@@ -493,10 +493,10 @@ GitHub).
should help you remember (though not at this time in our world it might help you
later on?). This might become even more useful after the challenge is accepted,
accomplished and made use of! :)
-
The layout of recode.c isn’t too significant (but see below) but I want to
mention prog.c especially:
@@ -516,17 +516,17 @@ which was exactly 75 years from the day that the person responsible for the
Second World War, Adolf Hitler,
ended his life. (I later made a bug fix but I consider this inconsequential).
It’s an Enigma machine simulator! Isn’t
that proof that it’s obfuscated itself?! :) Silliness aside obfuscation.txt
has some of the ways I think this entry is obfuscated. To decipher try:
For the lazy obfuscation.html has the deciphered version. I am afraid I’m not
diff --git a/2020/ferguson2/obfuscation.html b/2020/ferguson2/obfuscation.html
index a4e7778fa..ed272871f 100644
--- a/2020/ferguson2/obfuscation.html
+++ b/2020/ferguson2/obfuscation.html
@@ -140,41 +140,41 @@ there is an aesthetic appeal to my eyes too).
Y<:19:><:27:> but it’s not the only example. Here the compound literal of 13
ints:
-
int*z=(int[13]){0},*e,*g;
+
int *z=(int[13]) { 0 } , *e, *g;
Then in main:
-
e = z +10;
- g = e +1;
-
-for(j=-3; j <0;++j)
- e<:j:>= j+3;
+
e = z + 10;
+ g = e + 1;
+
+ for (j=-3; j < 0; ++j)
+ e<:j:> = j+3;
Which I think is more confusing: when one is iterating an array you don’t
expect to start out with index < 0 but to then compare that that index < 0
and increment until 0 along with setting the value of the array to j + 3 is
more confusing still. There are at least two other ways that are much easier
to read that could accomplish the same thing. It continues on:
First of all: why do I set e[2] to 0 and increment it for each pass in the
loop, but then the condition for the loop is s[*P]?
Second notice the many references to e[1] (as e[1] and g). This variable (pointing
@@ -200,14 +200,14 @@ temporary variable instead of a regular int in the function (so make it global);
and (2) I didn’t want to risk changing all the offsets: thus I just made that
address e[1]. Thus I also have:
-
This e[1] of course is the same as *g as above and as you can see has
multiple dimensions (that is the reference to Y does) too (and this is also
strewn about the code). In the above I’m referring to the variable in more
@@ -218,7 +218,7 @@ which I use as the two chars to compare (this is the plugboard function).
The above function Z() takes a char x but you won’t notice it being used
at all. Why? In fact I call it like so:
-
k = Z(r<:-1:>=k);
+
k = Z(r<:-1:>=k);
The char is just used as a way to be able to call the function and assign to
the proper variable at the same time: in the function Z I don’t care about x
because it’s the same value as r[-1] (which I do care about). Why is it
@@ -230,7 +230,7 @@ again negative offsets to cause more confusion.
refer to the same variable in more than one way (or in some cases maybe more
correct to say ‘same location’). In the Z() function for example:
-
(Of course this also removes an if statement by joining with a &&).
In fact I decided that the above two arrays in arrays needed to be merged
@@ -275,18 +275,18 @@ enough because as they rightly point out they can just use the C preprocessor
itself. But although I have quite a few cpp directives I am not using them for
obfuscation but rather to save bytes. For examples:
-
%:define J(x)do(*x)=getchar();while((*x)=='\n')
+
%:define J(x) do(*x)=getchar(); while((*x)=='\n')
Is used quite a number of times and although it could be a function that
takes a pointer to an int it was more convenient this way (I believe it used
more bytes but I no longer know that). There are many others and they all
save bytes (or at least most of them do if not all). There is one in
particular I want to bring up though because I think it’s a curious one and
it ties in to another point above:
-
%:define A(y)*(&Y<:7:><:1:>+(y))
+
%:define A(y) *(&Y<:7:><:1:>+(y))
What is special about this one: Above I noted how I sort of refer directly
to the notch settings (I think it was the notch settings anyway). Now I
could have done say
-
char a = Y[7][1], b = Y[7][3], c = Y[7][5];
+
char a = Y[7][1], b = Y[7][3], c = Y[7][5];
But I felt that doing instead the pointer arithmetic was worth doing.
However it used significantly more bytes even as a macro: 17 if I recall
right. That’s with the macro. If I were to include it three times by itself
@@ -314,9 +314,9 @@ differently (and separated) so that one cannot easily replace the char
Also what is this about ?
-
/\
-/ This is *not* what you think:
-void D(char*x){/* ... */}
+
/\
+ / This is *not* what you think:
+ void D(char*x){ /* ... */ }
Is that valid and if so how does it function? Yes it’s valid but I’ll leave
the other part of the question up to the reader to answer. Hint: you already
know how it works (yes, really you do)! Another hint: This is and is not a
diff --git a/2020/ferguson2/obfuscation.md b/2020/ferguson2/obfuscation.md
index 16f331175..4d0ea37bc 100644
--- a/2020/ferguson2/obfuscation.md
+++ b/2020/ferguson2/obfuscation.md
@@ -19,13 +19,13 @@ there is an aesthetic appeal to my eyes too).
Y<:19:><:27:> but it's not the only example. Here the compound literal of 13
ints:
-```c
+```
int *z=(int[13]) { 0 } , *e, *g;
```
Then in main:
-```c
+```
e = z + 10;
g = e + 1;
@@ -39,14 +39,14 @@ ints:
more confusing still. There are at least two other ways that are much easier
to read that could accomplish the same thing. It continues on:
-```c
+```
/* ... */
e<:i-3:> = (j < 1 ? 1 : (j > 5 ? 5 : j))-1;
```
* Observe these two functions:
-```c
+```
void w(char *s, int k, int v)
{
for(e<:2:> = 0; s<:*P:>; ++e<:2:>)
@@ -96,7 +96,7 @@ temporary variable instead of a regular int in the function (so make it global);
and (2) I didn't want to risk changing all the offsets: thus I just made that
address `e[1]`. Thus I also have:
-```c
+```
for (*g = 0 ; *g < 10; ++*g)
{
r<:-2:> = Y<:14:><:*(e+1):>; r<:-3:> = Y<:15:><:1<:e:>:>;
@@ -117,7 +117,7 @@ address `e[1]`. Thus I also have:
* The above function Z() takes a `char x` but you won't notice it being used
at all. Why? In fact I call it like so:
-```c
+```
k = Z(r<:-1:>=k);
```
@@ -132,7 +132,7 @@ at all. Why? In fact I call it like so:
refer to the same variable in more than one way (or in some cases maybe more
correct to say 'same location'). In the Z() function for example:
-```c
+```
r<:-2:> = Y<:14:><:*(e+1):>; r<:-3:> = Y<:15:><:1<:e:>:>;
```
@@ -153,7 +153,7 @@ index (sort of).
* Another set of char arrays in one: the five rotors as well as the two
reflectors in one `char [][27]`. This makes for some fun code like:
-```c
+```
(Y<:e<:-10:>+5:><:k-'A':>) && (k = Y<:e<:-10:>+5:><:k-'A':>);
```
@@ -194,7 +194,7 @@ enough because as they rightly point out they can just use the C preprocessor
itself. But although I have quite a few cpp directives I am not using them for
obfuscation but rather to save bytes. For examples:
-```c
+```
%:define J(x) do(*x)=getchar(); while((*x)=='\n')
```
@@ -205,7 +205,7 @@ obfuscation but rather to save bytes. For examples:
particular I want to bring up though because I think it's a curious one and
it ties in to another point above:
-```c
+```
%:define A(y) *(&Y<:7:><:1:>+(y))
```
@@ -213,7 +213,7 @@ obfuscation but rather to save bytes. For examples:
to the notch settings (I think it was the notch settings anyway). Now I
could have done say
-```c
+```
char a = Y[7][1], b = Y[7][3], c = Y[7][5];
```
@@ -248,7 +248,7 @@ variables in recode.c, move them to prog.c, compile and expect it to work right.
* Also what is this about ?
-```c
+```
/\
/ This is *not* what you think:
void D(char*x){ /* ... */ }
diff --git a/2020/ferguson2/recode.html b/2020/ferguson2/recode.html
index f1da0cd75..6f6d4cea6 100644
--- a/2020/ferguson2/recode.html
+++ b/2020/ferguson2/recode.html
@@ -170,34 +170,34 @@ with the Roman numeral, showing their actual orders etc.), the reflectors
In this file I will show an example of each feature and then get to the
wonderful ‘challenge’ for everyone.
Though you won’t find some of those strings in recode.c or
prog.c. Yes the WAR for the Ringstellung (Ring settings) is an
amusing coincidence but it really did happen!
@@ -207,11 +207,11 @@ encipherment/decipherment). If the file cannot be opened it sets back to stdin.<
-o outputs the settings to the file. If the file cannot be opened for writing
or is the same file name (see below) then only stdout will be used. Example of
randomised output going to a file:
Notice that a terminating newline isn’t added. Also note that it outputs to
stdout so you can pipe it to the Enigma machine but at the same time have the
settings saved for deciphering the text later (the configuration does not have
@@ -236,7 +236,7 @@ what about if one exists but the other does not?
In other words just the defaults. This was to simplify the problems with
prompting again for input if it’s invalid (though as you’ll see it does a good
job at this anyway).
@@ -265,59 +265,59 @@ job at this anyway).
input manually (if you randomise or read in from previously saved file no input
need be done at all) then make sure to redirect stderr to /dev/null. If you
don’t you might see something like:
-
$ ./recode -r | ./prog -
+ Ring 1: IOCCC
+ Setting 1: Position 1: Ring 2: Setting 2: Position 2: Ring 3: Setting 3: Position 3: Reflector: Plugboard pair 1: Plugboard pair 2: Plugboard pair 3: Plugboard pair 4: Plugboard pair 5: Plugboard pair 6: Plugboard pair 7: Plugboard pair 8: Plugboard pair 9: Plugboard pair 10: DEVIY
What happened is that Ring 1: is printed to stderr but since it’s not been
redirected to /dev/null it prints this out; at this point however it prompts for
input. Why or how it shows the first prompt instead of later on I do not know.
Anyway at this point the simulator is already expecting input to en/decipher.
That’s why after I sent EOF it printed out the remaining strings to stderr.
$ cat input
-IOCCC
-
-$ ./recode -finput
-Rotors:
-(1)I: EKMFLGDQVZNTOWYHXUSPAIBRCJ
-(2)II: AJDKSIRUXBLHWTMCQGZNPYFVOE
-(3)III: BDFHJLCPRTXVZNYEIWGAKMUSQO
-(4)IV: ESOVPZJAYQUIRHXLNFTGKDCMWB
-(5)V: VZBRGITYUPSDNHLXAWMJQOFECK
-Input rotor 1 (1- 5): 1
-Input rotor 2 (1- 5): 2
-Input rotor 3 (1- 5): 3
-Input setting 1 (A- Z): A
-Input setting 2 (A- Z): A
-Input setting 3 (A- Z): A
-Input position 1 (A- Z): A
-Input position 2 (A- Z): A
-Input position 3 (A- Z): A
-Reflector:
-(1)(B)YRUHQSLDPXNGOKMIEBFZCWVJAT
-(2)(C)FVPJIAOYEDRZXWGCTKUQSBNMHL
-Input reflector (1- 2): 2
-Input plugboard pair 1: AB
-Input plugboard pair 2: CD
-Input plugboard pair 3: ..
-Input plugboard pair 4: EF
-Input plugboard pair 5: GH
-Input plugboard pair 6: IJ
-Input plugboard pair 7: KL
-Input plugboard pair 8: MN
-Input plugboard pair 9: OP
-Input plugboard pair 10: QR
-1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC
+
$ cat input
+ IOCCC
+
+ $ ./recode -finput
+ Rotors:
+ (1) I: EKMFLGDQVZNTOWYHXUSPAIBRCJ
+ (2) II: AJDKSIRUXBLHWTMCQGZNPYFVOE
+ (3) III: BDFHJLCPRTXVZNYEIWGAKMUSQO
+ (4) IV: ESOVPZJAYQUIRHXLNFTGKDCMWB
+ (5) V: VZBRGITYUPSDNHLXAWMJQOFECK
+ Input rotor 1 (1 - 5): 1
+ Input rotor 2 (1 - 5): 2
+ Input rotor 3 (1 - 5): 3
+ Input setting 1 (A - Z): A
+ Input setting 2 (A - Z): A
+ Input setting 3 (A - Z): A
+ Input position 1 (A - Z): A
+ Input position 2 (A - Z): A
+ Input position 3 (A - Z): A
+ Reflector:
+ (1) (B) YRUHQSLDPXNGOKMIEBFZCWVJAT
+ (2) (C) FVPJIAOYEDRZXWGCTKUQSBNMHL
+ Input reflector (1 - 2): 2
+ Input plugboard pair 1: AB
+ Input plugboard pair 2: CD
+ Input plugboard pair 3: ..
+ Input plugboard pair 4: EF
+ Input plugboard pair 5: GH
+ Input plugboard pair 6: IJ
+ Input plugboard pair 7: KL
+ Input plugboard pair 8: MN
+ Input plugboard pair 9: OP
+ Input plugboard pair 10: QR
+ 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC
Notice that I skipped a plugboard
pair; this can be done in
a number of ways but two dots is one. Notice also that it’s in a different order
than the simulator: because with the size restrictions on my entry I saved bytes
by using the same loop where I could. It just felt more natural to have them
grouped together in a configurator for the simulator.
As you can see the recode program prompts for the settings and outputs the
input for the Enigma program. I then copied/pasted that output to the program
and got the result HQNVO.
@@ -330,58 +330,58 @@ part again; I could have just done the latter part but I wanted to show the way
the pipeline works with settings etc.
What happens if the plugboard pairs are the same but in a different order? It’s
the same output:
$ ./recode -v-oconfig-finput>/dev/null
-Rotors:
-(1)I: EKMFLGDQVZNTOWYHXUSPAIBRCJ
-(2)II: AJDKSIRUXBLHWTMCQGZNPYFVOE
-(3)III: BDFHJLCPRTXVZNYEIWGAKMUSQO
-(4)IV: ESOVPZJAYQUIRHXLNFTGKDCMWB
-(5)V: VZBRGITYUPSDNHLXAWMJQOFECK
-Input rotor 1 (1- 5): 1
-Input rotor 2 (1- 5): 2
-Input rotor 3 (1- 5): 3
-Input setting 1 (A- Z): A
-Input setting 2 (A- Z): C
-Input setting 3 (A- Z): E
-Input position 1 (A- Z): B
-Input position 2 (A- Z): D
-Input position 3 (A- Z): F
-Reflector:
-(1)(B)YRUHQSLDPXNGOKMIEBFZCWVJAT
-(2)(C)FVPJIAOYEDRZXWGCTKUQSBNMHL
-Input reflector (1- 2): 2
-Input plugboard pair 1: AB
-Input plugboard pair 2: CD
-Input plugboard pair 3: EF
-Input plugboard pair 4: GHIJ
-Input plugboard pair 5: IJ
-Input plugboard pair 6: KL
-Input plugboard pair 7: MN
-Input plugboard pair 8: OP
-Input plugboard pair 9: QR
-Input plugboard pair 10: ST
-Ring 1: (I)EKMFLGDQVZNTOWYHXUSPAIBRCJ
-Ring 2: (II)AJDKSIRUXBLHWTMCQGZNPYFVOE
-Ring 3: (III)BDFHJLCPRTXVZNYEIWGAKMUSQO
-Ring settings: ACE
-Ring positions: BDF
-Reflector:(C)FVPJIAOYEDRZXWGCTKUQSBNMHL
-Plugboard pair #01: AB
-Plugboard pair #02: CD
-Plugboard pair #03: EF
-Plugboard pair #04: GH
-Plugboard pair #05: IJ
-Plugboard pair #06: KL
-Plugboard pair #07: MN
-Plugboard pair #08: OP
-Plugboard pair #09: QR
-Plugboard pair #10: ST
+
$ ./recode -v -oconfig -finput >/dev/null
+ Rotors:
+ (1) I: EKMFLGDQVZNTOWYHXUSPAIBRCJ
+ (2) II: AJDKSIRUXBLHWTMCQGZNPYFVOE
+ (3) III: BDFHJLCPRTXVZNYEIWGAKMUSQO
+ (4) IV: ESOVPZJAYQUIRHXLNFTGKDCMWB
+ (5) V: VZBRGITYUPSDNHLXAWMJQOFECK
+ Input rotor 1 (1 - 5): 1
+ Input rotor 2 (1 - 5): 2
+ Input rotor 3 (1 - 5): 3
+ Input setting 1 (A - Z): A
+ Input setting 2 (A - Z): C
+ Input setting 3 (A - Z): E
+ Input position 1 (A - Z): B
+ Input position 2 (A - Z): D
+ Input position 3 (A - Z): F
+ Reflector:
+ (1) (B) YRUHQSLDPXNGOKMIEBFZCWVJAT
+ (2) (C) FVPJIAOYEDRZXWGCTKUQSBNMHL
+ Input reflector (1 - 2): 2
+ Input plugboard pair 1: AB
+ Input plugboard pair 2: CD
+ Input plugboard pair 3: EF
+ Input plugboard pair 4: GHIJ
+ Input plugboard pair 5: IJ
+ Input plugboard pair 6: KL
+ Input plugboard pair 7: MN
+ Input plugboard pair 8: OP
+ Input plugboard pair 9: QR
+ Input plugboard pair 10: ST
+ Ring 1: ( I) EKMFLGDQVZNTOWYHXUSPAIBRCJ
+ Ring 2: ( II) AJDKSIRUXBLHWTMCQGZNPYFVOE
+ Ring 3: (III) BDFHJLCPRTXVZNYEIWGAKMUSQO
+ Ring settings: ACE
+ Ring positions: BDF
+ Reflector: (C) FVPJIAOYEDRZXWGCTKUQSBNMHL
+ Plugboard pair #01: AB
+ Plugboard pair #02: CD
+ Plugboard pair #03: EF
+ Plugboard pair #04: GH
+ Plugboard pair #05: IJ
+ Plugboard pair #06: KL
+ Plugboard pair #07: MN
+ Plugboard pair #08: OP
+ Plugboard pair #09: QR
+ Plugboard pair #10: ST
Notice that I redirect stdout to /dev/null so that the config is only written to
the file config. But also notice that for plugboard
pair 4 I typed in GHIJ
@@ -389,55 +389,55 @@ and it didn’t report an error. Neither did it complain about IJ i
pair. This is because it consumes input overflow.
It shouldn’t be this way for the simulator though because that could cause
inconsistent number of characters expected before the text to encipher.
What if you don’t want to worry about having to specify input but just have the
settings written? You can do that too by either sending a newline or else
directly type ctrl-d (or whatever you have EOF set to) or give it an empty file.
The following are all equivalent in that they will write to a settings file (the
first one will print a newline with the echo but that won’t matter):
(Above ^D was not shown but I typed it.) The way it works: if nothing is read
the buffer remains NULL and so I don’t print it but still do print the settings
file. (Actually even if getdelim() fails you’re supposed to free the buffer so I
set another variable to indicate if it should be printed.)
$ ./recode -finput.txt -oconfig | ./prog - 2>/dev/null > output
Rotors:
@@ -476,37 +476,37 @@ set another variable to indicate if it should be printed.)
Cody?) there’s also a reference to code which I also love (just as all
participants of the IOCCC do). Other things there don’t mean anything but what
does is the output:
-
$ cat output
-DBFAF 2020 Ittejg ltblwriac uqdfqvr dhqh ghhf
-
-Jsjy ce v pxdmullo.
-
-Sara tj rtaayak uxfhjcti.
-
-$ ./recode -Rconfig-foutput|./prog-2>/dev/null
-IOCCC 2020 Enigma simulator example text file
-
-This is a sentence.
-
-This is another sentence.
+
$ cat output
+ DBFAF 2020 Ittejg ltblwriac uqdfqvr dhqh ghhf
+
+ Jsjy ce v pxdmullo.
+
+ Sara tj rtaayak uxfhjcti.
+
+ $ ./recode -Rconfig -foutput | ./prog - 2>/dev/null
+ IOCCC 2020 Enigma simulator example text file
+
+ This is a sentence.
+
+ This is another sentence.
Note that I typed in IOCCC and sent EOF (ctrl-d); the settings were written to
the config file (for deciphering later) and then all of it was piped to the
Enigma entry resulting in the line below IOCCC. But let’s verify it worked out
okay:
-
$ cat config
-2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ
+
$ cat config
+ 2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ
Without having to copy/paste intermediate results:
That should give you an idea of how to use the recode program. I leave it as
an exercise to the reader to implement additional features but here are some
@@ -585,7 +585,7 @@ think that I would give too much away? :)
./recode -h
usage: ./recode [options]
-v display selected settings
@@ -71,7 +71,7 @@ if you don't give the option to read in a file for input.
`-v` shows selected settings. For example combining `-r` and `-v`:
-```sh
+```
$ echo IOCCC | ./recode -r -v
Ring 1: ( I) EKMFLGDQVZNTOWYHXUSPAIBRCJ
Ring 2: ( V) VZBRGITYUPSDNHLXAWMJQOFECK
@@ -104,7 +104,7 @@ encipherment/decipherment). If the file cannot be opened it sets back to stdin.
or is the same file name (see below) then only stdout will be used. Example of
randomised output going to a file:
-```sh
+```
$ ./recode -r -oconfig
IOCCC
3PP4UB5GG1ELGTKFCOPVBNUYXJAWSDIOCCC
@@ -143,7 +143,7 @@ what about if one exists but the other does not?
Due to the way the parsing of options is done (no spaces between option char and
argument) shell expansion will not work right so for example doing:
-```sh
+```
$ ./recode -R~/config
```
@@ -163,7 +163,7 @@ the program interactively.
If stdin is not a tty (`!isatty(0)`) and neither randomised mode nor reading in
from a file is specified then you might just see something like:
-```sh
+```
$ echo testing test tests | ./recode
1AB2BB3CC1testing test tests
@@ -189,7 +189,7 @@ input manually (if you randomise or read in from previously saved file no input
need be done at all) then make sure to redirect stderr to /dev/null. If you
don't you might see something like:
-```sh
+```
$ ./recode -r | ./prog -
Ring 1: IOCCC
Setting 1: Position 1: Ring 2: Setting 2: Position 2: Ring 3: Setting 3: Position 3: Reflector: Plugboard pair 1: Plugboard pair 2: Plugboard pair 3: Plugboard pair 4: Plugboard pair 5: Plugboard pair 6: Plugboard pair 7: Plugboard pair 8: Plugboard pair 9: Plugboard pair 10: DEVIY
@@ -205,7 +205,7 @@ That's why after I sent EOF it printed out the remaining strings to stderr.
# Manually test the recode program with the Enigma program
-```sh
+```
$ cat input
IOCCC
@@ -249,7 +249,7 @@ than the simulator: because with the size restrictions on my entry I saved bytes
by using the same loop where I could. It just felt more natural to have them
grouped together in a configurator for the [simulator](prog.c).
-```sh
+```
$ echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC | ./prog - 2>/dev/null
HQNVO
$ echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRIOCCC | ./prog - 2>/dev/null | echo 1AA2AA3AA2ABCD..EFGHIJKLMNOPQRHQNVO | ./prog - 2>/dev/null
@@ -273,21 +273,21 @@ What happens if the plugboard pairs are the same but in a different order? It's
the same output:
-```sh
+```
$ echo 1AA2AA3AA2AB..CDEFGHIJKLMNOPQRIOCCC|./prog - 2>/dev/null
HQNVO
```
Also if you flip the order of the letters in the pair e.g. the AB as BA instead:
-```sh
+```
$ echo 1AA2AA3AA2BA..CDEFGHIJKLMNOPQRIOCCC|./prog - 2>/dev/null
HQNVO
```
# Only write config file
-```sh
+```
$ ./recode -v -oconfig -finput >/dev/null
Rotors:
(1) I: EKMFLGDQVZNTOWYHXUSPAIBRCJ
@@ -345,7 +345,7 @@ pair. This is because it consumes input overflow.
It shouldn't be this way for the simulator though because that could cause
inconsistent number of characters expected before the text to encipher.
-```sh
+```
$ cat config
1AB2CD3EF2ABCDEFGHIJKLMNOPQRST
@@ -363,7 +363,7 @@ directly type ctrl-d (or whatever you have EOF set to) or give it an empty file.
The following are all equivalent in that they will write to a settings file (the
first one will print a newline with the echo but that won't matter):
-```sh
+```
$ echo | ./recode -r -osettings
$ echo -n | ./recode -r -osettings
$ > empty
@@ -380,7 +380,7 @@ set another variable to indicate if it should be printed.)
# Reusing a configuration
-```sh
+```
$ echo -n|./recode -r -oconfig
4UH5II1RJ1SPIFEJLYGZWRTBHVCAMN$
@@ -405,7 +405,7 @@ set another variable to indicate if it should be printed.)
Alternatively you can just use the `-R` and `-f` options:
-```sh
+```
$ ./recode -finput.txt -Rconfig | ./prog - 2>/dev/null > output2
$ diff output output2
$
@@ -456,7 +456,7 @@ participants of the IOCCC do). Other things there don't mean anything but what
does is the output:
-```sh
+```
$ cat output
DBFAF 2020 Ittejg ltblwriac uqdfqvr dhqh ghhf
@@ -477,7 +477,7 @@ does is the output:
This is like the above only randomised:
-```sh
+```
$ ./recode -r -oconfig|./prog - 2>/dev/null
IOCCC
UGEVP
@@ -489,14 +489,14 @@ the config file (for deciphering later) and then all of it was piped to the
Enigma entry resulting in the line below IOCCC. But let's verify it worked out
okay:
-```sh
+```
$ cat config
2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ
```
Without having to copy/paste intermediate results:
-```sh
+```
$ echo IOCCC | ./recode -Rconfig | ./prog - 2>/dev/null | ./recode -Rconfig | ./prog - 2>/dev/null
IOCCC
```
@@ -504,7 +504,7 @@ Without having to copy/paste intermediate results:
You can also use a string for the `-R` option. I'll use command substitution and
actual pasting to demonstrate:
-```sh
+```
$ echo IOCCC | ./recode -R$(cat config) | ./prog - 2>/dev/null | ./recode -R2BM4GJ3HK1LNCBXWRMGKSYIAZUTPVJ | ./prog - 2>/dev/null
IOCCC
```
@@ -612,7 +612,7 @@ the key you wish to select is
you can do:
-```sh
+```
./recode -R0EZ4PC1CC0PGTAQSOXWNMDRYKFUZEI -fencrypted.html | ./prog - 2>/dev/null > decrypted.html
```
diff --git a/2020/giles/README.md b/2020/giles/README.md
index 97c8b1c15..8c3c444c9 100644
--- a/2020/giles/README.md
+++ b/2020/giles/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,7 +18,7 @@ For more detailed information see [2020 giles bugs](../../bugs.html#2020_giles).
## To use:
-```sh
+```
./prog < dtmf.wav
./prog [digits] > digits.wav
@@ -33,7 +33,7 @@ will be converted to the DTMF sound!
## Try:
-```sh
+```
./try.sh
./prog < pi.wav
@@ -71,7 +71,7 @@ exactly 16 bits per sample, but it allows any sample rate and any number of
audio channels.
-```sh
+```
$ ./prog < pi.wav
31415926
```
@@ -80,7 +80,7 @@ If the program is executed with a command-line argument, it will generate the
tones corresponding to the specified characters, writing them to standard output
as a WAV file.
-```sh
+```
$ ./prog 867-5309 | aplay
```
diff --git a/2020/giles/index.html b/2020/giles/index.html
index 0174c263f..8e2e9ff31 100644
--- a/2020/giles/index.html
+++ b/2020/giles/index.html
@@ -141,26 +141,26 @@ Location: AU - Commonwealth of Australi
where dtmf.wav is a WAV file of the dialling of a number being dialled with
DTMF (Dual-tone multi
frequency)
(more commonly known as Touch-Tone) and [digits] is a sequence of digits that
will be converted to the DTMF sound!
Try:
-
./try.sh
-./prog< pi.wav
-
-# See
-./prog 867-5309 > jenny.wav
If the script try.sh did not play a WAV file, it means you do not have
SoX installed; see FAQ 3.10: How do I compile and use an IOCCC entry that
requires sound?). In this case install it and try it again or
@@ -180,12 +180,12 @@ standard input, decode the touch-tones in the file, and output the corresponding
digits to standard output. This program only supports WAV files that have
exactly 16 bits per sample, but it allows any sample rate and any number of
audio channels.
-
$ ./prog < pi.wav
-31415926
+
$ ./prog < pi.wav
+ 31415926
If the program is executed with a command-line argument, it will generate the
tones corresponding to the specified characters, writing them to standard output
as a WAV file.
-
$ ./prog 867-5309 |aplay
+
$ ./prog 867-5309 | aplay
Interesting Features
When compiled with gcc -pedantic -Wall -Wextra there are no compiler
diff --git a/2020/kurdyukov1/README.md b/2020/kurdyukov1/README.md
index 227c9411b..1102c11b6 100644
--- a/2020/kurdyukov1/README.md
+++ b/2020/kurdyukov1/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -10,7 +10,7 @@ code](#alternate-code) below for more details.
## To use:
-```sh
+```
./prog
# input some text
@@ -22,7 +22,7 @@ code](#alternate-code) below for more details.
## Try:
-```sh
+```
./try.sh
```
@@ -46,7 +46,7 @@ are the program in assembly for x86_64 linux and x86 linux respectively.
To build [prog.alt.c](prog.alt.c):
-```sh
+```
make alt
```
diff --git a/2020/kurdyukov1/index.html b/2020/kurdyukov1/index.html
index a970ea07d..c7dcf8332 100644
--- a/2020/kurdyukov1/index.html
+++ b/2020/kurdyukov1/index.html
@@ -141,18 +141,18 @@ Location: RU - Russian Federation
To build:
-
make
+
make
There are alternate versions of this entry. See Alternate
code below for more details.
To use:
-
./prog
-# input some text
-
-echo text |./prog
-
-./prog< file
+
./prog
+ # input some text
+
+ echo text | ./prog
+
+ ./prog < file
Try:
-
./try.sh
+
./try.sh
Alternate code:
There are a number of alternate versions for this program, some in C and some in
assembly.
@@ -164,7 +164,7 @@ different social media profile covers as well as different shapes.
are the program in assembly for x86_64 linux and x86 linux respectively.
diff --git a/2020/kurdyukov2/README.md b/2020/kurdyukov2/README.md
index 389aeb676..dfbaebff7 100644
--- a/2020/kurdyukov2/README.md
+++ b/2020/kurdyukov2/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
# Take a selfie
./prog 1000 selfie.jpg output.jpg
# Admire your portrait in cubist style
@@ -41,7 +41,7 @@ This program divides the image into a specified number of rectangles. This
process is content aware, so the algorithm tries to match most of the information.
However, it doesn't find the best theoretically possible layout.
-```sh
+```
./prog 1000 input.jpg output.jpg
```
@@ -56,13 +56,13 @@ If you want to use `libjpeg` compiled from sources, then use the `LIBJPEG` defin
specify the path to includes and the library. For example using
[libjpeg source](https://mac-dev-env.patrickbougie.com/libjpeg/) version 9c:
-```sh
+```
make prog LIBJPEG="-Ijpeg-9c jpeg-9c/libjpeg.a"
```
Use this command to build a PNG version (you need `libpng`):
-```sh
+```
make prog_png LIBPNG="-lpng"
```
@@ -80,13 +80,13 @@ information!
First, make sure you have the compiler tools installed e.g. by:
-```sh
+```
sudo xcode-select --install
```
Make sure you install [MacPorts](https://www.macports.org/install.php). Then do:
-```sh
+```
sudo port install jpeg libpng ImageMagick
```
@@ -95,7 +95,7 @@ GIFs from the results using `makegif.sh`.
After that’s installed you need to run make with these options:
-```sh
+```
make LDFLAGS="-I/opt/local/include -L/opt/local/lib"
```
@@ -103,7 +103,7 @@ After that’s installed you need to run make with these options:
First, make sure you have the compiler tools installed e.g. by:
-```sh
+```
sudo xcode-select --install
```
@@ -111,14 +111,14 @@ Make sure you install [Homebrew](https://brew.sh).
Then:
-```sh
+```
brew install libjpeg libpng
eval "$(brew shellenv)"
```
You are now ready to compile this entry:
-```sh
+```
make clobber all
```
@@ -139,7 +139,7 @@ vertically to get the minimum difference.
You can use this command to make a GIF from output images (uses ImageMagick).
For instance after running the command suggested by the judges:
-```sh
+```
convert -delay 10 -dither none -loop 0 $(find . -maxdepth 1 -type f -name '*jpg' | sort -V) $(find . -maxdepth 1 -type f -name '*jpg' | sort -rV) +map out.gif
```
diff --git a/2020/kurdyukov2/index.html b/2020/kurdyukov2/index.html
index c4da60725..60d46857f 100644
--- a/2020/kurdyukov2/index.html
+++ b/2020/kurdyukov2/index.html
@@ -141,16 +141,16 @@ Location: RU - Russian Federation
To build:
-
make
+
make
To use:
-
./prog
+
./prog
Try:
-
# Take a selfie
-./prog 1000 selfie.jpg output.jpg
-# Admire your portrait in cubist style
-
-# Also try:
-./try.sh
+
# Take a selfie
+ ./prog 1000 selfie.jpg output.jpg
+ # Admire your portrait in cubist style
+
+ # Also try:
+ ./try.sh
Judges’ remarks:
This entry has reminded us of a winning entry back in the early 90s. Can you
guess which one?
@@ -161,7 +161,7 @@ rectangles. What is the complexity? Is it obvious from the source code?
This program divides the image into a specified number of rectangles. This
process is content aware, so the algorithm tries to match most of the information.
However, it doesn’t find the best theoretically possible layout.
-
./prog 1000 input.jpg output.jpg
+
./prog 1000 input.jpg output.jpg
Building
You can build three versions, depending on the image format.
Default is JPEG version; if you have the libjpeg development package installed
@@ -169,9 +169,9 @@ in your system, then make without arguments should do the right thi
If you want to use libjpeg compiled from sources, then use the LIBJPEG define to
specify the path to includes and the library. For example using
libjpeg source version 9c:
-
make prog LIBJPEG="-Ijpeg-9c jpeg-9c/libjpeg.a"
+
make prog LIBJPEG="-Ijpeg-9c jpeg-9c/libjpeg.a"
Use this command to build a PNG version (you need libpng):
-
make prog_png LIBPNG="-lpng"
+
make prog_png LIBPNG="-lpng"
And the PPM version (no additional dependencies, can read raw/ASCII PPM, writes
raw PPM):
Made this thing while experimenting with the idea of representing an image with
rectangles (lossy compression). It’s not very good in that sense, but the
@@ -206,7 +206,7 @@ the picture data is split (halves may have different size) horizontally or
vertically to get the minimum difference.
You can use this command to make a GIF from output images (uses ImageMagick).
For instance after running the command suggested by the judges:
Also provided makegif.sh to aid with GIF creation.
make
```
@@ -10,14 +10,14 @@ code](#alternate-code) below.
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -29,7 +29,7 @@ The alternate version, [prog.alt.c](prog.alt.c), has the main code as a macro.
### Alternate build:
-```sh
+```
make alt
```
@@ -61,7 +61,7 @@ exactly what it says nonetheless.
Compile and try this:
-```sh
+```
cat input.txt | ./prog
```
diff --git a/2020/kurdyukov3/index.html b/2020/kurdyukov3/index.html
index 80d1ed3ed..409255004 100644
--- a/2020/kurdyukov3/index.html
+++ b/2020/kurdyukov3/index.html
@@ -141,17 +141,17 @@ Location: RU - Russian Federation
To build:
-
make
+
make
There is an alternate version of this program. See Alternate
code below.
To use:
-
./prog
+
./prog
Try:
-
./try.sh
+
./try.sh
Alternate code:
The alternate version, prog.alt.c, has the main code as a macro.
Alternate build:
-
make alt
+
make alt
Alternate use:
Use prog.alt as you would prog above.
Judges’ remarks:
@@ -169,7 +169,7 @@ exactly what it says nonetheless.
Author’s remarks:
Letter Mixer
Compile and try this:
-
cat input.txt |./prog
+
cat input.txt | ./prog
The program can work with letters that are not represented in English, as long
as these letters are encoded in the higher part of the single-byte character set
(use iconv to convert from UTF-8 and back).
diff --git a/2020/kurdyukov4/README.md b/2020/kurdyukov4/README.md
index e8f7234cd..56314f481 100644
--- a/2020/kurdyukov4/README.md
+++ b/2020/kurdyukov4/README.md
@@ -1,13 +1,13 @@
## To build:
-```sh
+```
make
```
## To use:
-```sh
+```
./prog text_file output_length context_length random_seed
```
@@ -17,7 +17,7 @@
When running this, ask yourself why it gets progressively slower when the
context length decreases:
-```sh
+```
./try.sh
```
@@ -70,7 +70,7 @@ Now can you appreciate the award title a bit better?
### Building:
-```sh
+```
cc prog.c -o prog
```
@@ -79,7 +79,7 @@ Now can you appreciate the award title a bit better?
This program generates random text from the provided dictionary using a Markov
chain, outputting to `stdout`.
-```sh
+```
./prog input.txt 2000 10 12345
```
@@ -110,7 +110,7 @@ You can try this with the inputs provided with
[2019/mills](../../2019/mills/index.html) from the IOCCC entries.
-```sh
+```
$ ./prog Shakespeare.txt 2001 10 12345
```
diff --git a/2020/kurdyukov4/index.html b/2020/kurdyukov4/index.html
index c68502143..2cd9f1eb1 100644
--- a/2020/kurdyukov4/index.html
+++ b/2020/kurdyukov4/index.html
@@ -141,13 +141,13 @@ Location: RU - Russian Federation
When running this, ask yourself why it gets progressively slower when the
context length decreases:
-
./try.sh
+
./try.sh
Performance depends on the number of same hashes found.
Too many identical strings if the context length is small.
@@ -183,11 +183,11 @@ Middle-earth (HoMe).
Now can you appreciate the award title a bit better?
Author’s remarks:
Building:
-
cc prog.c -o prog
+
cc prog.c -o prog
Usage:
This program generates random text from the provided dictionary using a Markov
chain, outputting to stdout.
-
./prog input.txt 2000 10 12345
+
./prog input.txt 2000 10 12345
Parameters are:
dictionary filename
@@ -209,7 +209,7 @@ the output of this size in bytes exists somewhere in the dictionary.
Example
You can try this with the inputs provided with
2019/mills from the IOCCC entries.
-
$ ./prog Shakespeare.txt 2001 10 12345
+
$ ./prog Shakespeare.txt 2001 10 12345
produces:
r sons, wives for them, as the hope I had it. This is the way they be not too ra
sh a trial of you only. Therefore will not out of door? Nurse: Marry, bachelor,
diff --git a/2020/otterness/README.md b/2020/otterness/README.md
index b7f3806ff..fce019a44 100644
--- a/2020/otterness/README.md
+++ b/2020/otterness/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -18,14 +18,14 @@ For more detailed information see [2020 otterness bugs](../../bugs.html#2020_ott
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
./try.sh
```
@@ -74,7 +74,7 @@ for most of my testing (see [cvikl.mid](cvikl.mid)).
Compile the program using the following command (I tested this using both
`clang` and `gcc`):
-```sh
+```
cc -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c
```
diff --git a/2020/otterness/index.html b/2020/otterness/index.html
index 26882e265..a51e2a7c9 100644
--- a/2020/otterness/index.html
+++ b/2020/otterness/index.html
@@ -141,15 +141,15 @@ Location: US - United States of America
Now play output.mid and output2.mid in an audio player that can play MIDI
files.
Judges’ remarks:
@@ -179,7 +179,7 @@ for most of my testing (see cvikl.mid).
Usage
Compile the program using the following command (I tested this using both
clang and gcc):
-
cc-pedantic-Wall-Werror-Wextra-O3-o prog prog.c
+
cc -pedantic -Wall -Werror -Wextra -O3 -o prog prog.c
The program expects a MIDI on stdin, and writes a modified MIDI to stdout:
./prog <input.mid >output.mid
If the program encounters an error, no output will generally be produced, and
diff --git a/2020/tsoj/README.md b/2020/tsoj/README.md
index f0584ee54..f3300a74d 100644
--- a/2020/tsoj/README.md
+++ b/2020/tsoj/README.md
@@ -1,6 +1,6 @@
## To build:
-```sh
+```
make
```
@@ -11,14 +11,14 @@ to those familiar with vi. See [Alternate code](#alternate-code) below.
## To use:
-```sh
+```
./prog
```
## Try:
-```sh
+```
# Make your terminal as large as possible, possibly reduce your font size
# then...
./prog
@@ -33,14 +33,14 @@ where instead of `w`, `a`, `s` and `d`, you can use `k`, `h`, `j` and `l`.
### Alternate build:
-```sh
+```
make alt
```
### Alternate use:
-```sh
+```
# Make your terminal as large as possible, possibly reduce your font size
# then...
./prog.alt
diff --git a/2020/tsoj/index.html b/2020/tsoj/index.html
index 299f12b18..ce72928a5 100644
--- a/2020/tsoj/index.html
+++ b/2020/tsoj/index.html
@@ -141,24 +141,24 @@ Location: DE - Federal Republic of Germ
To build:
-
make
+
make
There is an alternate version which has controls that will make much more sense
to those familiar with vi. See Alternate code below.
To use:
-
./prog
+
./prog
Try:
-
# Make your terminal as large as possible, possibly reduce your font size
-# then...
-./prog
+
# Make your terminal as large as possible, possibly reduce your font size
+ # then...
+ ./prog
Alternate code:
This version has the difference of moving forwards, left, backwards and right,
where instead of w, a, s and d, you can use k, h, j and l.
Alternate build:
-
make alt
+
make alt
Alternate use:
-
# Make your terminal as large as possible, possibly reduce your font size
-# then...
-./prog.alt
+
# Make your terminal as large as possible, possibly reduce your font size
+ # then...
+ ./prog.alt
..and maybe curse less than you might otherwise, but still probably curse (see
below) :-)
Judges’ remarks:
diff --git a/2020/yang/README.md b/2020/yang/README.md
index dac49559d..7e0bccf2a 100644
--- a/2020/yang/README.md
+++ b/2020/yang/README.md
@@ -1,20 +1,20 @@
## To build:
-```sh
+```-->
make
```
## To use:
-```sh
+```-->
./prog [PIN] < input.txt > output.c
```
## Try:
-```sh
+```-->
./try.sh
```
@@ -22,7 +22,7 @@
The author provided the file [cppp.cc](cppp.cc) which can preprocess the
generated output to make them more acceptable to typical compilers. To build:
-```sh
+```-->
make cppp
```
@@ -44,7 +44,7 @@ spoiler](spoiler.html) that shows how this entry was written.
### Synopsis
-```sh
+```-->
echo "Hello world" | ./prog 12345 > encoded.c
gcc -DPIN=12345 encoded.c -o ./decoded && ./decoded
@@ -63,14 +63,14 @@ Mile is a C code generator. Run without arguments for the help message below:
When run with an encoding PIN (first command line argument), Mile will
read bytes from `stdin` and generate C code on `stdout`. Example:
-```sh
+```-->
echo "Hello, world!" | ./prog 56789 > encoded.c
```
This generated code will reproduce the same input bytes on `stdout` when
executed, if it was compiled with the same encoding PIN.
-```sh
+```-->
gcc -DPIN=56789 encoded.c -o decoded
```
diff --git a/2020/yang/index.html b/2020/yang/index.html
index 7ce97c488..234afc888 100644
--- a/2020/yang/index.html
+++ b/2020/yang/index.html
@@ -141,14 +141,14 @@ Location: US - United States of America
To build:
-
make
+
make
To use:
-
./prog[PIN]< input.txt > output.c
+
./prog [PIN] < input.txt > output.c
Try:
-
./try.sh
+
./try.sh
The author provided the file cppp.cc which can preprocess the
generated output to make them more acceptable to typical compilers. To build:
-
make cppp
+
make cppp
See the author’s remarks for more details.
Judges’ remarks:
You might think of this entry as code obfuscater with a code.
@@ -159,9 +159,9 @@ What is compiling this entry about?
spoiler that shows how this entry was written.
Mile is a C code generator. Run without arguments for the help message below:
usage: [PIN] < input.txt > output.c
@@ -169,10 +169,10 @@ spoiler that shows how this entry was written.
where [PIN] is an integer in the range of 1..65535
When run with an encoding PIN (first command line argument), Mile will
read bytes from stdin and generate C code on stdout. Example:
-
echo"Hello, world!"|./prog 56789 > encoded.c
+
echo "Hello, world!" | ./prog 56789 > encoded.c
This generated code will reproduce the same input bytes on stdout when
executed, if it was compiled with the same encoding PIN.
-
gcc-DPIN=56789 encoded.c -o decoded
+
gcc -DPIN=56789 encoded.c -o decoded
The generated code reconstructs all data at compile time by seeding a
random number generator with the given PIN to reproduce the input bytes,
and simply does one fwrite(3) call at run time to print those bytes. Not
diff --git a/README.html b/README.html
index 02f009af9..d33ce58ec 100644
--- a/README.html
+++ b/README.html
@@ -194,7 +194,7 @@ you encounter should give you more appreciation for the entry.
If you have the energy to type in the text, or if you have access to a machine
readable version of these programs, you should next consider some preprocessing
such as:
-
sed-e'/^#.*include/d' prog.c |cc-E
+
sed -e '/^#.*include/d' prog.c | cc -E
This strips away comments and expands the program’s macros without having things
such as includes and macros cluttering up the output. If the entry requires or
suggests the use of compile line options (such as -Dindex=strchr) they should
diff --git a/README.md b/README.md
index d1ab4134c..bbf9e640b 100644
--- a/README.md
+++ b/README.md
@@ -92,7 +92,7 @@ If you have the energy to type in the text, or if you have access to a machine
readable version of these programs, you should next consider some preprocessing
such as:
-```sh
+```
sed -e '/^#.*include/d' prog.c | cc -E
```
diff --git a/archive/historic/README.md b/archive/historic/README.md
index 78187b197..a9238d640 100644
--- a/archive/historic/README.md
+++ b/archive/historic/README.md
@@ -79,7 +79,7 @@ Machine](https://web.archive.org) as of [2022 Dec
*HINT*: To uncompress a given bzip2 compressed tarball file, use:
-```sh
+```
tar -jxvf file.tar.bz2
```
@@ -88,7 +88,7 @@ where "_file.tar.bz2_" is the name of a file found in this directory.
To uncompress all of the 2022 Dec 28 archive using the year based
bzip2 compressed tarball files:
-```sh
+```
for year in 198{4,5,6,7,8,9} 199{0,1,2,3,4,5,6,8} 200{0,1,4,5,6} 201{1,2,3,4,5,8,9} 2020; do
rm -rf "$year"
tar -jxvf "archive-$year.tar.bz2"
diff --git a/archive/historic/index.html b/archive/historic/index.html
index 9c98c19dc..14417ccba 100644
--- a/archive/historic/index.html
+++ b/archive/historic/index.html
@@ -191,14 +191,14 @@ Machine as of [2022 Dec
28)(https://web.archive.org/web/20201228005211/https://www.ioccc.org/).
How to unpack
HINT: To uncompress a given bzip2 compressed tarball file, use:
-
tar-jxvf file.tar.bz2
+
tar -jxvf file.tar.bz2
where “file.tar.bz2” is the name of a file found in this directory.
To uncompress all of the 2022 Dec 28 archive using the year based
bzip2 compressed tarball files:
-
for year in 198{4,5,6,7,8,9} 199{0,1,2,3,4,5,6,8} 200{0,1,4,5,6} 201{1,2,3,4,5,8,9} 2020;do
-rm-rf"$year"
-tar-jxvf"archive-$year.tar.bz2"
-done
+
for year in 198{4,5,6,7,8,9} 199{0,1,2,3,4,5,6,8} 200{0,1,4,5,6} 201{1,2,3,4,5,8,9} 2020; do
+ rm -rf "$year"
+ tar -jxvf "archive-$year.tar.bz2"
+done
^[0-9a-z][0-9a-z_]*$
```
@@ -48,7 +48,7 @@ anonymous author in a given year.
Anonymous author_handle's match this regexp:
-```re
+```
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
```
@@ -56,14 +56,14 @@ Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
The `author_handle.json` must have the following JSON members:
-```json
+```
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"author_JSON_format_version" : "0.1 2023-05-22",
```
There must be the following JSON members:
-```json
+```
"full_name" : "Your Full Name",
"sort_word" : "lowercaselast",
"location_code" : "XX",
@@ -80,13 +80,13 @@ an `author` and the entry they submitted are to be listed.
A `sort_word` matches this regexp:
-```re
+```
^[a-z][0-9a-z]*
```
And there must be the following JSON members:
-```json
+```
"email" : "user0@example.com",
"url" : "https://a.host0.example.com/index.html",
"alt_url" : "https://b.host0.example.com/index.html",
@@ -109,7 +109,7 @@ And there must be the following JSON members:
If an author does not have one of the previous set of values, or wishes to not disclose it / keep it anonymous,
then the JSON value can be `null`. For example:
-```json
+```
"email" : null,
"url" : null,
"alt_url" : null,
@@ -125,7 +125,7 @@ NOTE: The JSON value of `null` is NOT enclosed in double quotes.
The `"winning_entry_set"` is an array of JSON members that indicate
each of the IOCCC winning entries that the author is the author of. :-)
-```json
+```
{ "entry_id" : "YYYY_dirname" }
```
@@ -136,7 +136,7 @@ of the winning entry under the given year directory.
NOTE: Due to mis-features in the JSON spec, the final JSON member must NOT be followed by a comma.
For example:
-```json
+```
"winning_entry_set" : [
{ "entry_id" : "1987_somedir" },
{ "entry_id" : "2020_entrydir" },
@@ -148,7 +148,7 @@ For example:
Here is a fictitious author_handle.json example:
-```json
+```
{
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"author_JSON_format_version" : "1.0 2023-06-10",
@@ -176,7 +176,7 @@ Here is a fictitious author_handle.json example:
Here is fictitious author_handle.json example where all entries that may be
withheld are null:
-```json
+```
{
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"author_JSON_format_version" : "1.0 2023-06-10",
diff --git a/bin/README.md b/bin/README.md
index 967feeaf7..1129af50d 100644
--- a/bin/README.md
+++ b/bin/README.md
@@ -18,13 +18,13 @@ Run a command on all winning entries.
For example:
-```sh
+```
bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
```
Or for example:
-```sh
+```
bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
@@ -35,19 +35,19 @@ Run a command on all IOCCC years.
For example:
-```sh
+```
bin/all-years.sh -v 1 bin/gen-year-index.sh -v 1
```
Or for example:
-```sh
+```
bin/all-years.sh -v 1 bin/chk-entry.sh
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make verify_entry_files
```
@@ -59,7 +59,7 @@ Check that files required by an entry match the entry's manifest as found in
For example:
-```sh
+```
bin/chk-entry.sh 2020/ferguson1
```
@@ -70,7 +70,7 @@ Generate the list of files in the entry's manifest, `.entry.json`.
For example:
-```sh
+```
awk -f bin/filelist.entry.json.awk 2020/ferguson1/.entry.json
```
@@ -81,7 +81,7 @@ Generate the top level `/authors.html` page.
Usage:
-```sh
+```
bin/gen-authors.sh -v 1
```
@@ -92,7 +92,7 @@ Generate the top level `/location.html` page.
Usage:
-```sh
+```
bin/gen-location.sh -v 1
```
@@ -104,7 +104,7 @@ files.
Usage:
-```sh
+```
bin/gen-other-html.sh -v 1
```
@@ -115,13 +115,13 @@ Generate an XML sitemap for the IOCCC web site.
Usage:
-```sh
+```
bin/gen-sitemap.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make gen_sitemap
```
@@ -135,31 +135,31 @@ Without argument, the `contest_status` is unchanged.
Usage:
-```sh
+```
bin/gen-status.sh -v 1
```
To force the `contest_status` to be closed:
-```sh
+```
bin/gen-status.sh -v 1 closed
```
To force the `contest_status` to be open:
-```sh
+```
bin/gen-status.sh -v 1 open
```
To see other valid statuses:
-```sh
+```
bin/gen-status -h
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make gen_status
```
@@ -170,7 +170,7 @@ Generate a number of top level HTML pages for the IOCCC web sites.
Usage:
-```sh
+```
bin/gen-top-html.sh -v 1
```
@@ -191,7 +191,7 @@ Examples of top level HTML pages built by this tool include:
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make gen_top_html
```
@@ -202,13 +202,13 @@ Generate an `index.html` page for an given IOCCC year.
Usage:
-```sh
+```
bin/gen-year-index.sh -v 1 2020
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make gen_year_index
```
@@ -219,13 +219,13 @@ Generate the top level `/years.html` page.
Usage:
-```sh
+```
bin/gen-years.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make gen_years
```
@@ -279,7 +279,7 @@ If only a few `index.hmtl` files need updating, then
this command will only briefly pause while the
slightly longer [readme2index.sh](readme2index.sh) is run:
-```sh
+```
bin/all-run.sh -v 3 bin/quick-readme2index.sh -v 1
```
@@ -289,7 +289,7 @@ and `index.html` are correct. If in doubt, use:
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make quick_entry_index
```
@@ -298,19 +298,19 @@ make quick_entry_index
Convert an entry README.md into entry directory index.html.
-```sh
+```
bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
To build `index.html` files for all entries:
-```sh
+```
bin/all-run.sh -v 3 bin/readme2index.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make entry_index
```
@@ -341,19 +341,19 @@ Sort a .gitignore in a entry directory.
Usage:
-```sh
+```
bin/sort.gitignore.sh -v 1 YYYY/dir
```
Suggested usage:
-```sh
+```
bin/all-run.sh bin/sort.gitignore.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make sort_gitignore
```
@@ -389,13 +389,13 @@ Form a compressed tarball for an entry.
Usage:
-```sh
+```
bin/tar-entry.sh -v 1 YYYY/dir
```
Suggested usage:
-```sh
+```
bin/all-run.sh -v 3 bin/tar-entry.sh -v 1 -W
```
@@ -406,19 +406,19 @@ Form a compressed tarball for an IOCCC year.
Usage:
-```sh
+```
bin/tar-year.sh -v 1 YYYY
```
Suggested usage:
-```sh
+```
bin/all-years.sh -v 3 bin/tar-year.sh -v 1 -W
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make form_year_tarball
```
@@ -429,19 +429,19 @@ Untar an entry's a compressed tarball.
Usage:
-```sh
+```
bin/untar-entry.sh -v 1 YYYY/dir
```
Suggested usage:
-```sh
+```
bin/all-run.sh -v 3 bin/untar-entry.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make untar_entry_tarball
```
@@ -452,19 +452,19 @@ Untar an IOCCC year's compressed tarball.
Usage:
-```sh
+```
bin/untar-year.sh -v 1 YYYY
```
Suggested usage:
-```sh
+```
bin/all-years.sh -v 3 bin/untar-year.sh -v 1
```
We recommend that this tool be invoked via the top level `Makefile`:
-```sh
+```
make untar_year_tarball
```
@@ -494,14 +494,14 @@ the file name form:
By using command line options of the form:
-```sh
+```
-H phase=name
```
where `phase` is the name of an HTML phase,
a non-default file may be used. For example:
-```sh
+```
-H topnav=up2index
```
@@ -512,7 +512,7 @@ used during the _topnav_ HTML phase.
If `name` is dot (i.e., `.`), then the given HTML phase is skipped.
For example:
-```sh
+```
-H footer=.
```
@@ -861,7 +861,7 @@ a POSIX safe string with the addition of `+` (for technical reasons beyond this
document). In particular, the `author_handle` must be an ASCII
string that matches this regexp:
-```re
+```
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
```
@@ -900,7 +900,7 @@ in the case of [2005/anon](../2005/anon/anon.c).
Anonymous `author_handle`'s match this regexp:
-```re
+```
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
```
@@ -932,7 +932,7 @@ Non-numeric `year` strings are lower case.
A `year` string matches this regexp:
-```re
+```
[0-9a-z][0-9a-z][0-9a-z][0-9a-z]
```
@@ -957,7 +957,7 @@ A `dir` is a POSIX safe string that holds an entry.
A `dir` is a string that matches this regexp:
-```re
+```
^[a-z][0-9a-z.-]*$
```
diff --git a/bin/index.html b/bin/index.html
index a70ecc470..5d27fcbf2 100644
--- a/bin/index.html
+++ b/bin/index.html
@@ -133,63 +133,63 @@ repo.
This is the primary tool that forms IOCCC generated HTML content from
markdown files (permanent markdown files or temporarily generated
@@ -247,19 +247,19 @@ the extra time can add up.
If only a few index.hmtl files need updating, then
this command will only briefly pause while the
slightly longer readme2index.sh is run:
If name is dot (i.e., .), then the given HTML phase is skipped.
For example:
-
-H footer=.
+
-H footer=.
will cause no HTML content to be produced during the footer HTML phase.
HTML phases
The following HTML phase files are used to build HTML content:
@@ -560,7 +560,7 @@ IOCCC. Each author has EXACTLY ONEauthor_handle.<
a POSIX safe string with the addition of + (for technical reasons beyond this
document). In particular, the author_handle must be an ASCII
string that matches this regexp:
-
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
+
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
Default author_handle’s do not have multiple consecutive _ (underscore)
characters. Nevertheless, multiple consecutive _ (underscore) characters are
allowed. Contest submitters who wish to override the author_handle may do so.
@@ -581,7 +581,7 @@ year.
NOTE: even if the directory name is not anonymous the above rules apply as in
in the case of 2005/anon.
Anonymous author_handle’s match this regexp:
-
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
+
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
entry
An IOCCC entry that won an award for a given IOCCC.
An entry has one more more authors.
@@ -598,7 +598,7 @@ may be limited to previous entrys that used them.
represent the year. Some special year strings are possible, such as mock.
Non-numeric year strings are lower case.
A year string matches this regexp:
-
[0-9a-z][0-9a-z][0-9a-z][0-9a-z]
+
[0-9a-z][0-9a-z][0-9a-z][0-9a-z]
The year directories reside directly below the top level directory.
.year
Each year directory will have a file under it named:
@@ -608,7 +608,7 @@ instance, 2020/.year has the string: 2020dir
A dir is a POSIX safe string that holds an entry.
A dir is a string that matches this regexp:
-
^[a-z][0-9a-z.-]*$
+
^[a-z][0-9a-z.-]*$
Each entry is under its own individual directory. This directory
is directly under a year directory.
entry_id
diff --git a/bugs.html b/bugs.html
index c9c140f78..65107ec52 100644
--- a/bugs.html
+++ b/bugs.html
@@ -417,9 +417,9 @@ own fix or suggest that they’re fixed!
The purpose of this program is to print out a string of rubbish. In particular
you should see something like:
-
$ ./decot
-'",x); /*
- \
+
$ ./decot
+ '",x); /*
+ \
without a newline after the \. This is not a bug.
1984/mullender
STATUS: INABIAF - please DO NOT fix
@@ -479,7 +479,7 @@ operators like /. To see what operators are supported check the sou
With version 2 it sometimes segfaults even with the same input where other times
it does not. We don’t believe this is because of the fix that lets some versions
be compiled with clang. An example invocation is:
-
./ver2< westley.c
+
./ver2 < westley.c
A useful note on changing/fixing this program
It should be noted that in additional to rot13 names there is code that is the
reverse of other code (also wrt names). See the source file and the index.html
@@ -511,12 +511,12 @@ the code. But it’s trickier than that as one might expect.
The comments are processed too. Furthermore it happens that the last line
becomes the first and the first line becomes the last! Now if you look at the
code you’ll see on the first line:
Observe that the ROT13 of pain is cnva and the ROT13 of main is znva.
The ROT13 of NOON is ABBA. vag is ROT13 of int, gnat and tang are
ROT13 of each other as well which is the reverse of the original (this is not
@@ -563,61 +563,61 @@ Enjoy! :-)
A point worth considering is that as the number passed into the program gets
bigger the number of lines of output gets substantially larger and it takes much
more time and resources to run as well. For instance:
-
$ for n in $(seq 1 18);doecho"$n";echo"$n"|time"./baruch"|wc-l|sed-E-e's/[[:space:]]//g';done
-1
-3
-./baruch 0.00s user 0.00s system 5% cpu 0.115 total
-2
-1
-./baruch 0.00s user 0.00s system 64% cpu 0.004 total
-3
-1
-./baruch 0.00s user 0.00s system 60% cpu 0.003 total
-4
-11
-./baruch 0.00s user 0.00s system 64% cpu 0.003 total
-5
-61
-./baruch 0.00s user 0.00s system 66% cpu 0.003 total
-6
-29
-./baruch 0.00s user 0.00s system 61% cpu 0.003 total
-7
-321
-./baruch 0.00s user 0.00s system 69% cpu 0.002 total
-8
-829
-./baruch 0.00s user 0.00s system 76% cpu 0.003 total
-9
-3521
-./baruch 0.00s user 0.00s system 87% cpu 0.005 total
-10
-7965
-./baruch 0.01s user 0.00s system 95% cpu 0.014 total
-11
-32161
-./baruch 0.05s user 0.00s system 98% cpu 0.053 total
-12
-184601
-./baruch 0.29s user 0.00s system 99% cpu 0.294 total
-13
-1031969
-./baruch 1.78s user 0.00s system 99% cpu 1.794 total
-14
-5483941
-./baruch 11.26s user 0.02s system 99% cpu 11.311 total
-15
-36466945
-./baruch 79.20s user 0.15s system 99% cpu 1:19.72 total
-16
-251132705
-./baruch 592.89s user 0.77s system 99% cpu 9:55.34 total
-17
-1724671873
-./baruch 4535.71s user 5.25s system 99% cpu 1:15:49.76 total
-18
-12655721857
-./baruch 37496.97s user 58.50s system 99% cpu 10:27:48.29 total
+
$ for n in $(seq 1 18); do echo "$n"; echo "$n" | time "./baruch" | wc -l | sed -E -e 's/[[:space:]]//g'; done
+ 1
+ 3
+ ./baruch 0.00s user 0.00s system 5% cpu 0.115 total
+ 2
+ 1
+ ./baruch 0.00s user 0.00s system 64% cpu 0.004 total
+ 3
+ 1
+ ./baruch 0.00s user 0.00s system 60% cpu 0.003 total
+ 4
+ 11
+ ./baruch 0.00s user 0.00s system 64% cpu 0.003 total
+ 5
+ 61
+ ./baruch 0.00s user 0.00s system 66% cpu 0.003 total
+ 6
+ 29
+ ./baruch 0.00s user 0.00s system 61% cpu 0.003 total
+ 7
+ 321
+ ./baruch 0.00s user 0.00s system 69% cpu 0.002 total
+ 8
+ 829
+ ./baruch 0.00s user 0.00s system 76% cpu 0.003 total
+ 9
+ 3521
+ ./baruch 0.00s user 0.00s system 87% cpu 0.005 total
+ 10
+ 7965
+ ./baruch 0.01s user 0.00s system 95% cpu 0.014 total
+ 11
+ 32161
+ ./baruch 0.05s user 0.00s system 98% cpu 0.053 total
+ 12
+ 184601
+ ./baruch 0.29s user 0.00s system 99% cpu 0.294 total
+ 13
+ 1031969
+ ./baruch 1.78s user 0.00s system 99% cpu 1.794 total
+ 14
+ 5483941
+ ./baruch 11.26s user 0.02s system 99% cpu 11.311 total
+ 15
+ 36466945
+ ./baruch 79.20s user 0.15s system 99% cpu 1:19.72 total
+ 16
+ 251132705
+ ./baruch 592.89s user 0.77s system 99% cpu 9:55.34 total
+ 17
+ 1724671873
+ ./baruch 4535.71s user 5.25s system 99% cpu 1:15:49.76 total
+ 18
+ 12655721857
+ ./baruch 37496.97s user 58.50s system 99% cpu 10:27:48.29 total
@@ -627,19 +627,19 @@ fixed some issues in this program and Yus
Endoh provided the btoa
script but it appears there is a bug in this entry. The judges wrote that to
test the entry one can do:
-
which seems to be an error message (one of the fixes was to make it not use
@@ -697,7 +697,7 @@ or do something funny. For instance adsleep and adbasename
Another thing is that the code:
-
printf((W,Y));
+
printf((W,Y));
appears to be wrong because W is a FILE * and Y is a char[] but if one
changes it to use fprintf() on the file (which, incidentally, is opened in
read only mode which is another reason) with the %s specifier it will make
@@ -726,22 +726,22 @@ have to remove the outer () pair.
the first factor is 101 and is usually found in an instant.
A quick debugging session from Cody suggests that the problem with this value
is that:
-
if( ppp->qq!=48)return;
+
if ( ppp->qq!=48 ) return;
is never reached because the value is never 48 (it is in other cases but not for
the example input). It varies in value at this point. Observe that the next
lines of code are:
so it is expected that that value is 48, before printing the numbers, but if
it’s not it should not proceed at all, not even to go past that loop. In other
words that loop should always be entered for at least one iteration. The check
for the != 48 is also required.
Perhaps more useful to know is that at this point in the code the code:
-
if(((((!(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
+
if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
appears to be entered because of the return value of setjmp(), not the other
condition.
The alt version does fix the problem but it is not obfuscated and not like the
@@ -851,12 +851,12 @@ terminal columns is >= 80 it will display properly, rather than having to wra
at 80 columns. However due to the nature of the program if the terminal is < 80
in column width it will not display right. To see the number of columns in your
terminal try:
-
echo$COLUMNS
+
echo $COLUMNS
STATUS: known bug - please help us fix
The author suggested that the alternate version, which Cody added (but fixed for
modern systems), should print
-
main(l,a,n,d)...
-[A M E R I C A]...
+
main(l,a,n,d)...
+ [A M E R I C A]...
…going down the left edge if your terminal auto-wraps at 80 characters.
This however does not seem to work. It does not appear to be because of the fix
for modern systems as it doesn’t work for gcc either, even before any changes.
@@ -909,18 +909,18 @@ through ctrl-c or such.
fixed except for an exercise to yourself, should you wish to try.
This program uses system(3) so if you provide invalid characters in the
question you might cause an error. For instance don’t do this:
-
$ ./schnitzi schnitzi.info
-This program answers questions about paragraphs
-of text posed to it in English. It is written
-inC. Mark Schnitzius is the author of this
-program.
-
-The Loch Ness monster has been captured. Elvis
-is alive. Hostler was a woman. The NASA moon
-landings were clearly faked.
-
-
-? What is foo'?
+
$ ./schnitzi schnitzi.info
+ This program answers questions about paragraphs
+ of text posed to it in English. It is written
+ in C. Mark Schnitzius is the author of this
+ program.
+
+ The Loch Ness monster has been captured. Elvis
+ is alive. Hostler was a woman. The NASA moon
+ landings were clearly faked.
+
+
+ ? What is foo'?
because doing so will result in something like:
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
@@ -982,10 +982,10 @@ like getting to a place that the next contest can run must be done first.
how this entry works, which will be necessary if this entry is to be fixed,
below.
You might wish to run the command:
-
make diff_orig_prog
+
make diff_orig_prog
to see what had to change for the buffer size, when looking at the below.
Furthermore you will want to look at:
-
diff schnitzi.alt.c schnitzi.alt2.c
+
diff schnitzi.alt.c schnitzi.alt2.c
as the fgets() version can compile it just can’t generate compilable code (let
alone using fgets()) when fed itself (to reiterate, just changing the call to
fgets(3) does not mean it can compile and there’s a further problem in that
@@ -1022,7 +1022,7 @@ o
h
>
If you join the lines you end up with:
-
#include <stdio.h>
+
#include <stdio.h>
If you look at column 25 which is the end of the word ‘mh111’ and you go down to
the next row you’ll see a 0 and if you go one row down another 0. This is the
buffer size, 100, for u! The column to the left is the same for the t
@@ -1041,7 +1041,7 @@ size but that only works on the original source.
To say just how sensitive this entry is: even a space, lack of space or a
character, wrong character, lack of character or character in the wrong place
can cause a compilation error! Make sure that the output of:
-
./schnitzi< schnitzi.c
+
./schnitzi < schnitzi.c
can be compiled and the output of that new program when fed itself can also be
compiled!
1994/shapiro
@@ -1100,12 +1100,12 @@ it calls getchar() via the pointer m. So this is a fea
but it is supposed to work in the pipeline as is. The second one does not appear
to work at all even if one redirects to a file (like the workaround for the
first) as it appears to just block.
@@ -1140,28 +1140,28 @@ it was instead requiring a login / password.
almost be done except that some of the output of the
try.sh is wrong, especially the last one.
This diff almost does it but not quite:
-
diff --git i/1996/huffman/huffman.c w/1996/huffman/huffman.c
- index a5745bc7f4fa28b834c004f4cf19633e40ad9165..5e5e5334f33f9dbd95c70eddece3189d9bcff5e9 100644
- --- i/1996/huffman/huffman.c
- +++ w/1996/huffman/huffman.c
- @@ -1,15 +1,16 @@
- #define x char
- #define z else
- #define w gets
- +#define gets(b) ((b)[0]='\0',(fgets((b), 100, stdin)))
- #define r if
- #define u int
- #define s main
- #define v putchar
- #define y while
- #define t " A?B?K?L?CIF?MSP?E?H?O?R?DJG?NTQ?????U?V?????X???????Z????W??Y??"
- - s ( ) { x* c , b[ 5 * 72 ]; u a, e , d [ 9
- + s ( ) { x* c , b[ 5 * 72 ]; u a, e , d [ 9
- *9 *9 ] ; y (w ( b) ){ r ( 0 [ b] -7 *
- 5 ) { c = b ; y ( (* c - 6
- * 7 )* * c )c = c+ 1 ; r (( -0 ) [ c ] && w ( b +
- 8 * 5* 3 ) && w (b +8 *5 * 6) )
- { a = 0; y ( a [ b ]
+
diff --git i/1996/huffman/huffman.c w/1996/huffman/huffman.c
+ index a5745bc7f4fa28b834c004f4cf19633e40ad9165..5e5e5334f33f9dbd95c70eddece3189d9bcff5e9 100644
+ --- i/1996/huffman/huffman.c
+ +++ w/1996/huffman/huffman.c
+ @@ -1,15 +1,16 @@
+ #define x char
+ #define z else
+ #define w gets
+ +#define gets(b) ((b)[0]='\0',(fgets((b), 100, stdin)))
+ #define r if
+ #define u int
+ #define s main
+ #define v putchar
+ #define y while
+ #define t " A?B?K?L?CIF?MSP?E?H?O?R?DJG?NTQ?????U?V?????X???????Z????W??Y??"
+ - s ( ) { x* c , b[ 5 * 72 ]; u a, e , d [ 9
+ + s ( ) { x* c , b[ 5 * 72 ]; u a, e , d [ 9
+ *9 *9 ] ; y (w ( b) ){ r ( 0 [ b] -7 *
+ 5 ) { c = b ; y ( (* c - 6
+ * 7 )* * c )c = c+ 1 ; r (( -0 ) [ c ] && w ( b +
+ 8 * 5* 3 ) && w (b +8 *5 * 6) )
+ { a = 0; y ( a [ b ]
But since it does not for the time being it is advisable to just redirect
stderr to /dev/null (2>/dev/null).
1996/jonth
@@ -1199,8 +1199,8 @@ to the page as well! You’ll have IOCCC fame for reviving a pootifier! :-)
A point worth considering is that as the number passed into the program gets
bigger the number of lines of output gets substantially larger. For instance:
-
$ ./schnitzi 9|wc-l
-771999
+
$ ./schnitzi 9|wc -l
+ 771999
The larger the number the bigger the file can become too, even becoming
gigabytes in size. The range is checked for >0 && <27 as not having this can
be a problem including a segfault.
@@ -1215,43 +1215,43 @@ is in the index.html file as something to try and ponder.
which should print out poot but it doesn’t, not in linux and not in macOS.
In linux it doesn’t crash but it doesn’t print anything out either.
In macOS it crashes; it might appear to not crash in macOS but this is because
of the pipeline. If you remove the | tr 876 tpo part of the command you will
see that it does indeed crash!
The reason for this not working is really strange.
-
$ echo "7 P 6 d P P 8 p"|./dlowe
-7668
-$ echo "7 P 6 d P P 8 p"|./dlowe|grep 7
-$
+
$ echo "7 P 6 d P P 8 p" | ./dlowe
+ 7668
+ $ echo "7 P 6 d P P 8 p" | ./dlowe | grep 7
+ $
Why? Is it writing to stdout? Let’s try some other things:
-
$ echo 7668 |tr 876 tpo
-poot
+
$ echo 7668 | tr 876 tpo
+ poot
Okay so we know that it SHOULD work. But we also know something funny is going on with stdout and the entry. Another experiment:
-
$ echo "7 P 6 d P P 8 p"|./dlowe1>&2|grep 7
-7668
+
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>&2 | grep 7
+ 7668
Okay so now it sees it, grep. But watch!
-
$ echo "7 P 6 d P P 8 p"|./dlowe2>foo 1>&1
-7668
-$ cat foo
+
$ echo "7 P 6 d P P 8 p" | ./dlowe 2>foo 1>&1
+ 7668
+ $ cat foo
.. so at this hour it does appear to be writing to stdout but yet somehow it doesn’t? But watch:
-
$ echo "7 P 6 d P P 8 p"|./dlowe1>foo 1>&1
-$ cat foo
-$
+
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>foo 1>&1
+ $ cat foo
+ $
Well this explains why the tr does not transliterate it to poot but why is
this happening? Why can’t it be redirected to another file even?
If it could be figured out why it’s not writing to stdout and yet at the same
time is writing to stdout one bug could be fixed. Maybe it’s the perl messing
with things but we don’t know.
Other commands do work, however, and give the appropriate output, such as:
-
$ echo 1 2 + p |./dlowe
-3
+
$ echo 1 2 + p | ./dlowe
+ 3
so something is wrong with some commands/operators.
Another feature that does work in linux is:
-
$ echo poot |./dlowe
-poot was here!
+
$ echo poot | ./dlowe
+ poot was here!
Can you help fix these problems?
Cody provided the C code that creates an unformatted perl script that will just
print ‘unimplemented’ for operators but it seems to work in some other ways (see
@@ -1259,29 +1259,29 @@ below for how to go further than unimplemented) which is the exact perl from the
C program except that it has the #!/usr/bin/env perl and use warnings; as
well. A note below might suggest that doing this creates incomplete perl.
Anyway:
-
#include <stdio.h>
-int main(void)
-{
- printf("#!/usr/bin/env perl\nuse warnings;_:$_= <> ; defined or exit; @ARGV"
-"=split; __:$_= shift;defined or goto _; chomp "
-";(m*^\\x70oO""\\x74$*i)?(pri""nt \"$_ w\\x"
-"61s h\\145r\\x""65!\\n\"):((m*""^\\s\\*(-?\\d+"
-"(\\.\\d+)?)\\s""\\*$*)?(push@SS ,$1):(&{chr(((o"
-"rd)%%39)+3**4)x2 } )); goto __; sub ff { @SS= ("
-")} sub __{print \"stack empty\\""n\"} sub ss{$#"
-"SS<0 and goto & __; print $SS[$""#SS].\"\\n\"} "
-"sub SS{ $#SS<0 and goto &__ ; print pop @SS}"
-"sub _ { print \"divide by zer""o\\n\"}sub ii{"
-"map{ print\"$_""\\n\" } reverse @SS} sub AUTOLO"
-"AD { print\"un""implemented\\n""\"} sub gg{ $#"
-"SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ "
-"$#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS"
-"[$#SS-1]=$SS[$""#SS]-$SS[$#SS-""1]; $SS[$#SS]-"
-"=$SS[$#SS-1]}");
-}
+
#include <stdio.h>
+ int main(void)
+ {
+ printf("#!/usr/bin/env perl\nuse warnings;_:$_= <> ; defined or exit; @ARGV"
+ "=split; __:$_= shift;defined or goto _; chomp "
+ ";(m*^\\x70oO" "\\x74$*i)?(pri" "nt \"$_ w\\x"
+ "61s h\\145r\\x" "65!\\n\"):((m*" "^\\s\\*(-?\\d+"
+ "(\\.\\d+)?)\\s" "\\*$*)?(push@SS ,$1):(&{chr(((o"
+ "rd)%%39)+3**4)x2 } )); goto __; sub ff { @SS= ("
+ ")} sub __{print \"stack empty\\" "n\"} sub ss{$#"
+ "SS<0 and goto & __; print $SS[$" "#SS].\"\\n\"} "
+ "sub SS{ $#SS<0 and goto &__ ; print pop @SS}"
+ "sub _ { print \"divide by zer" "o\\n\"}sub ii{"
+ "map{ print\"$_" "\\n\" } reverse @SS} sub AUTOLO"
+ "AD { print\"un" "implemented\\n" "\"} sub gg{ $#"
+ "SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ "
+ "$#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS"
+ "[$#SS-1]=$SS[$" "#SS]-$SS[$#SS-" "1]; $SS[$#SS]-"
+ "=$SS[$#SS-1]}");
+ }
Compiling this you can generate:
-
#!/usr/bin/env perl
-usewarnings;_:$_= <> ; definedorexit; @ARGV=split; __:$_= shift;definedorgoto _; chomp ;(m*^\x70oO\x74$*i)?(print "$_ w\x61s h\145r\x65!\n"):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print "stack empty\n"} sub ss{$#SS<0 and goto & __; print $SS[$#SS]."\n"} sub SS{ $#SS<0 and goto &__ ; print pop @SS}sub _ { print "divide by zero\n"}sub ii{map{ print"$_\n" } reverse @SS} sub AUTOLOAD { print"unimplemented\n"} sub gg{ $#SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ $#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]}
+
#!/usr/bin/env perl
+ use warnings;_:$_= <> ; defined or exit; @ARGV=split; __:$_= shift;defined or goto _; chomp ;(m*^\x70oO\x74$*i)?(print "$_ w\x61s h\145r\x65!\n"):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print "stack empty\n"} sub ss{$#SS<0 and goto & __; print $SS[$#SS]."\n"} sub SS{ $#SS<0 and goto &__ ; print pop @SS}sub _ { print "divide by zero\n"}sub ii{map{ print"$_\n" } reverse @SS} sub AUTOLOAD { print"unimplemented\n"} sub gg{ $#SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ $#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]}
Here is example input/output:
p
stack empty
@@ -1298,32 +1298,32 @@ Anyway:
how this does not happen in the C program in linux!) but if one uses ‘p’ by
itself it will print what’s on the stack (for example).
To not get ‘unimplemented’ you can remove from the perl:
-
sub AUTOLOAD { print"unimplemented\n"}
+
sub AUTOLOAD { print"unimplemented\n"}
(Note that the author stated this was used for exception handling so another
possibility is that the C code doesn’t generate the correct perl and indeed even
spaces is known to break the perl in at least one way, syntax errors, but maybe
others too.)
Here is an example run of several operations in the perl script after removing
that subroutine:
-
$ echo 5 5 p |./dlowe.pl
-5
-$ echo 5 5 + p |./dlowe.pl
-5
-Undefined subroutine &main::UU called at ./pl.pl line 2, <> line 1.
-$ echo 5 5 * p |./dlowe.pl
-5
-Undefined subroutine &main::ww called at ./pl.pl line 2, <> line 1.
-$ echo 5 5 - p |./dlowe.pl
-5
-Undefined subroutine &main::WW called at ./pl.pl line 2, <> line 1.
-$ echo 5 5 / p |./dlowe.pl
-5
-Undefined subroutine &main::YY called at ./pl.pl line 2, <> line 1.
-$ echo 5 P |./dlowe.pl
-5$ echo p |./dlowe.pl
-stack empty
-$ echo P |./dlowe.pl
-stack empty
+
$ echo 5 5 p | ./dlowe.pl
+ 5
+ $ echo 5 5 + p | ./dlowe.pl
+ 5
+ Undefined subroutine &main::UU called at ./pl.pl line 2, <> line 1.
+ $ echo 5 5 * p | ./dlowe.pl
+ 5
+ Undefined subroutine &main::ww called at ./pl.pl line 2, <> line 1.
+ $ echo 5 5 - p | ./dlowe.pl
+ 5
+ Undefined subroutine &main::WW called at ./pl.pl line 2, <> line 1.
+ $ echo 5 5 / p | ./dlowe.pl
+ 5
+ Undefined subroutine &main::YY called at ./pl.pl line 2, <> line 1.
+ $ echo 5 P | ./dlowe.pl
+ 5$ echo p | ./dlowe.pl
+ stack empty
+ $ echo P | ./dlowe.pl
+ stack empty
Note the undefined subroutine error: that happens with commands that are not
even in the program. Again the author used AUTOLOAD for exception handling so
it seems likely that there is something missing (which the below shows as well).
@@ -1336,9 +1336,9 @@ works in the code, at least in some cases.
invalid input. But as can be seen by the input I (Cody) gave the input is not
actually incorrect. It is also curious to note that it ends up printing what’s
on the stack at that point:
-
$ echo 5 5 + p |./dlowe.pl
-unimplemented
-5
+
$ echo 5 5 + p | ./dlowe.pl
+ unimplemented
+ 5
which might (?) suggest that the + operator is unimplemented. Unfortunately it
has been many years since I have used perl and I was never a guru either.
STATUS: INABIAF - please DO NOT fix
@@ -1346,34 +1346,34 @@ has been many years since I have used perl and I was never a guru either.
they said is in Perl_sv_upgrade. As this is documented it is not considered a
bug to be fixed. For the curious this will crash in macOS. Cody notes that the
code that crashes is:
-
perl_eval_sv
-(newSVpv("_:$_= <> ; defined or exit; @ARGV"
-"=split; __:$_= shift;defined or goto _; chomp "
-";(m*^\\x70oO""\\x74$*i)?(pri""nt \"$_ w\\x"
-"61s h\\145r\\x""65!\\n\"):((m*""^\\s\\*(-?\\d+"
-"(\\.\\d+)?)\\s""\\*$*)?(push@SS ,$1):(&{chr(((o"
-"rd)%39)+3**4)x2 } )); goto __; sub ff { @SS= ("
-")} sub __{print \"stack empty\\""n\"} sub ss{$#"
-"SS<0 and goto & __; print $SS[$""#SS].\"\\n\"} "
-"sub SS{ $#SS<0 and goto &__ ; print pop @SS}"
-"sub _ { print \"divide by zer""o\\n\"}sub ii{"
-"map{ print\"$_""\\n\" } reverse @SS} sub AUTOLO"
-"AD { print\"un""implemented\\n""\"} sub gg{ $#"
-"SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ "
-"$#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS"
-"[$#SS-1]=$SS[$""#SS]-$SS[$#SS-""1]; $SS[$#SS]-"
-"=$SS[$#SS-1]} ",0),0);
+
perl_eval_sv
+ (newSVpv("_:$_= <> ; defined or exit; @ARGV"
+ "=split; __:$_= shift;defined or goto _; chomp "
+ ";(m*^\\x70oO" "\\x74$*i)?(pri" "nt \"$_ w\\x"
+ "61s h\\145r\\x" "65!\\n\"):((m*" "^\\s\\*(-?\\d+"
+ "(\\.\\d+)?)\\s" "\\*$*)?(push@SS ,$1):(&{chr(((o"
+ "rd)%39)+3**4)x2 } )); goto __; sub ff { @SS= ("
+ ")} sub __{print \"stack empty\\" "n\"} sub ss{$#"
+ "SS<0 and goto & __; print $SS[$" "#SS].\"\\n\"} "
+ "sub SS{ $#SS<0 and goto &__ ; print pop @SS}"
+ "sub _ { print \"divide by zer" "o\\n\"}sub ii{"
+ "map{ print\"$_" "\\n\" } reverse @SS} sub AUTOLO"
+ "AD { print\"un" "implemented\\n" "\"} sub gg{ $#"
+ "SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ "
+ "$#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS"
+ "[$#SS-1]=$SS[$" "#SS]-$SS[$#SS-" "1]; $SS[$#SS]-"
+ "=$SS[$#SS-1]} ",0),0 );
and in particular it appears that it is the perl itself. In other words if one
changes it to be:
-
perl_eval_sv(newSVpv("",0),0);
+
perl_eval_sv(newSVpv("",0),0);
it will not crash. But of course it won’t do anything either. So it’s more
specifically that the call to newSVpv() crashes the code but INSIDE
(key point!) the call to perl_eval_sv() that does it. Given what the author
stated and that the version of perl is < than 5.6.0 which the author states can
crash this makes sense.
Note that with different perl libraries in macOS (for instance from
Homebrew and MacPorts) it will
@@ -1385,7 +1385,7 @@ of 92 warnings! Nonetheless neither works okay and both crash.
The loop seems to be stuck in the call to usleep(3) like:
-
usleep(p*200);
+
usleep(p*200);
which happens to be in a while() loop.
There is a way to get the code to crash. If you don’t do anything until
everything is destroyed (where you’d lose the game if it ended) and then you
@@ -1587,7 +1587,7 @@ sleeping.
Segmentation fault will occur in some systems. For instance on macOS with the
arm64 chip:
-
./gavin> kernel
+
./gavin > kernel
When trying to link gavin.o to produce sh, the linker generates:
Undefined symbols for architecture arm64:
"start", referenced from:
@@ -1599,32 +1599,32 @@ you have a fix? We welcome your help!
Recent 2004/gavin mods:
Although not related some recent changes were made to 2004/gavin to let it
compile under clang. The following patch was applied:
-
diff --git a/2004/gavin/gavin.c b/2004/gavin/gavin.c
- index c967b7e..2082b49 100644
- --- a/2004/gavin/gavin.c
- +++ b/2004/gavin/gavin.c
- @@ -1,8 +1,9 @@
- +int main(int t, char **q, char **d) { return cain(t, (int)q, (int)d); }
- #define G(n) int n(int t, int q, int d)
- #define X(p,t,s) (p>=t&&p<(t+s)&&(p-(t)&1023)<(s&1023))
- #define U(m) *((signed char *)(m))
- #define F if(!--q){
- -#define I(s) (int)main-(int)s
- +#define I(s) (int)cain-(int)s
- #define P(s,c,k) for(h=0; h>>14==0; h+=129)Y(16*c+h/1024+Y(V+36))&128>>(h&7)?U(s+(h&15367))=k:k
-
- G (B)
- @@ -52,7 +53,7 @@ else
-
- G (_);
- G (o);
- -G (main)
- +G (cain)
- {
- Z, k = K;
- if (!t)
+
diff --git a/2004/gavin/gavin.c b/2004/gavin/gavin.c
+ index c967b7e..2082b49 100644
+ --- a/2004/gavin/gavin.c
+ +++ b/2004/gavin/gavin.c
+ @@ -1,8 +1,9 @@
+ +int main(int t, char **q, char **d) { return cain(t, (int)q, (int)d); }
+ #define G(n) int n(int t, int q, int d)
+ #define X(p,t,s) (p>=t&&p<(t+s)&&(p-(t)&1023)<(s&1023))
+ #define U(m) *((signed char *)(m))
+ #define F if(!--q){
+ -#define I(s) (int)main-(int)s
+ +#define I(s) (int)cain-(int)s
+ #define P(s,c,k) for(h=0; h>>14==0; h+=129)Y(16*c+h/1024+Y(V+36))&128>>(h&7)?U(s+(h&15367))=k:k
+
+ G (B)
+ @@ -52,7 +53,7 @@ else
+
+ G (_);
+ G (o);
+ -G (main)
+ +G (cain)
+ {
+ Z, k = K;
+ if (!t)
The original Makefile from 2004 had the following to say about this entry:
-
# Special flags for the gavin entry
+
# Special flags for the gavin entry
#
# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1
#
@@ -1791,8 +1791,8 @@ used decimal mode, or any of the “undocumented” instructions.
obnoxious in macOS as it shows it at runtime (redirecting stderr to
/dev/null will silence it). The following diff will almost work but it crashes
with at least computer.tofu input file:
-
(at least in my tired head?) is NULL. But why does it work then?
NOTE: u is int.
Under macOS (with the arm64 chip) we get:
@@ -2006,11 +2006,11 @@ address allocated in macOS? Or is it?
==10983==ABORTING
/bin/bash: line 1: 10983 Abort trap: 6 ./richards
which corresponds to the code:
-
o rd(u v)
-{
- o *a =0,**b =&a,**c = b +32;
- x[v]= w;
-for(; b < c &&(*b <(o *)w ||*b >(o *) T ||*b ==&v); b++);/* LINE 132 */
+
o rd(u v)
+ {
+ o *a = 0, **b = &a, **c = b + 32;
+ x[v] = w;
+ for (; b < c && (*b < (o *)w || *b > (o *) T || *b == &v); b++); /* LINE 132 */
but this seems to not necessarily be relevant since without it it works in
linux.
A warning of interest when compiling is:
@@ -2265,9 +2265,9 @@ but this is not known.
machine to find problems as it will allow you to verify what is correct and what
is not. Again see his index.html for details. However it is also possible to not
rely on the entry as the below shows. One should be able to do:
-
echo'No. I want chocolate!'|./prog> chocolate.raw
-
-./prog e < chocolate.raw
+
echo 'No. I want chocolate!' | ./prog > chocolate.raw
+
+./prog e < chocolate.raw
When you run it on a JSON file you will see something like:
-
$ ./prog < ioccc.json > ioccc.html
-Assertion failed: (rulez), function C, file prog.c, line 124.
-Abort trap: 6
+
$ ./prog < ioccc.json > ioccc.html
+ Assertion failed: (rulez), function C, file prog.c, line 124.
+ Abort trap: 6
(from say running ./try.sh) but this is expected and the fileioccc.html` will
be generated properly.
Some JSON files might cause the program to continue to run and seemingly
@@ -2445,7 +2445,7 @@ values but his implementation matches that of macOS and FreeBSD.
that they can work but it might end up that the scripts don’t show any output
anyway as they use the full alphabet. To test that it works one can have a
script like:
-
This is NOT a bug and you’ll have to (at least at this time?) delete the files
manually. You shouldn’t have to worry about these being added to git: it seems
to ignore sockets (it did at least in macOS).
He provides the following tips on this situation. A simpler way to find sockets
in the directory:
though one might want to check that the program is not currently running. :-)
2019/endoh
STATUS: INABIAF - please DO NOT fix
diff --git a/bugs.md b/bugs.md
index 14c88f753..d95045dcd 100644
--- a/bugs.md
+++ b/bugs.md
@@ -421,7 +421,7 @@ own fix or suggest that they're fixed!
The purpose of this program is to print out a string of rubbish. In particular
you should see something like:
-```sh
+```
$ ./decot
'",x); /*
\
@@ -527,7 +527,7 @@ With version 2 it sometimes segfaults even with the same input where other times
it does not. We don't believe this is because of the fix that lets some versions
be compiled with clang. An example invocation is:
-```sh
+```
./ver2 < westley.c
```
@@ -575,7 +575,7 @@ The comments are processed too. Furthermore it happens that the last line
becomes the first and the first line becomes the last! Now if you look at the
code you'll see on the first line:
-```c
+```
/**//*/};)/**/pain(*//**/tang ,gnat/**//*/,ABBA~,0-0(avnz;)0-0,tang,raeN
```
@@ -583,13 +583,13 @@ In `ver0` it'll be the same but the others are more interesting.
In `ver1` you'll see on the last line:
-```c
+```
cnva((vag)NOON&2/*//*\\**/,gnat,tang ,NOON/**//*/(niam/**/);}/*//**/
```
and on the first line:
-```c
+```
/**//*/};)/**/cnva(*//**/gnat ,tang/**//*/,NOON~,0-0(niam;)0-0,gnat,enrA
```
@@ -653,7 +653,7 @@ A point worth considering is that as the number passed into the program gets
bigger the number of lines of output gets substantially larger and it takes much
more time and resources to run as well. For instance:
-```sh
+```
$ for n in $(seq 1 18); do echo "$n"; echo "$n" | time "./baruch" | wc -l | sed -E -e 's/[[:space:]]//g'; done
1
3
@@ -724,7 +724,7 @@ Endoh](../authors.html#Yusuke_Endoh) provided the `btoa`
script but it appears there is a bug in this entry. The judges wrote that to
test the entry one can do:
-```sh
+```
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
```
@@ -733,7 +733,7 @@ sentence.
But doing this shows instead:
-```sh
+```
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
a얖?)V...?????777??hC??h??-? )SSSSXXX????r?L=???*?-???ppp,,,?R
?j
@@ -746,7 +746,7 @@ Notice how there's no newline at the end: that final `$` is the prompt.
If one does, however:
-```sh
+```
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw | ./jaw
```
@@ -842,7 +842,7 @@ that that is the error message.
Another thing is that the code:
-```c
+```
printf((W,Y));
```
@@ -885,7 +885,7 @@ Leo Broukhis, before he was an IOCCC judge, sent the IOCCC judges an email:
A quick debugging session from Cody suggests that the problem with this value
is that:
-```c
+```
if ( ppp->qq!=48 ) return;
```
@@ -893,7 +893,7 @@ is never reached because the value is never 48 (it is in other cases but not for
the example input). It varies in value at this point. Observe that the next
lines of code are:
-```c
+```
while ( ppp->qq==48 )
{
printf("%ld\n",qqq-45);
@@ -909,7 +909,7 @@ for the `!= 48` is also required.
Perhaps more useful to know is that at this point in the code the code:
-```c
+```
if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
```
@@ -1064,7 +1064,7 @@ at 80 columns. However due to the nature of the program if the terminal is < 80
in column width it will not display right. To see the number of columns in your
terminal try:
-```sh
+```
echo $COLUMNS
```
@@ -1074,7 +1074,7 @@ terminal try:
The author suggested that the alternate version, which Cody added (but fixed for
modern systems), should print
-```c
+```
main(l,a,n,d)...
[A M E R I C A]...
```
@@ -1163,7 +1163,7 @@ fixed except for an exercise to yourself, should you wish to try.
This program uses `system(3)` so if you provide invalid characters in the
question you might cause an error. For instance don't do this:
-```sh
+```
$ ./schnitzi schnitzi.info
This program answers questions about paragraphs
of text posed to it in English. It is written
@@ -1275,7 +1275,7 @@ below.
You might wish to run the command:
-```sh
+```
make diff_orig_prog
```
@@ -1283,7 +1283,7 @@ to see what had to change for the buffer size, when looking at the below.
Furthermore you will want to look at:
-```sh
+```
diff schnitzi.alt.c schnitzi.alt2.c
```
@@ -1335,7 +1335,7 @@ h
If you join the lines you end up with:
-```c
+```
#include
```
@@ -1362,7 +1362,7 @@ To say just how sensitive this entry is: even a space, lack of space or a
character, wrong character, lack of character or character in the wrong place
can cause a compilation error! Make sure that the output of:
-```sh
+```
./schnitzi < schnitzi.c
```
@@ -1462,7 +1462,7 @@ it calls `getchar()` via the pointer `m`. So this is a feature not a bug.
The judges suggested that the following commands should result in output:
-```sh
+```
./leo 1 | cat - /dev/tty | gs -
./leo 37 80 | cat - /dev/tty | gs -
@@ -1470,7 +1470,7 @@ The judges suggested that the following commands should result in output:
The first one can work if one does instead:
-```sh
+```
echo "" | ./leo 1 > foo.ps
gs foo.ps
```
@@ -1532,7 +1532,7 @@ almost be done except that some of the output of the
This diff almost does it but not quite:
-```diff
+```
diff --git i/1996/huffman/huffman.c w/1996/huffman/huffman.c
index a5745bc7f4fa28b834c004f4cf19633e40ad9165..5e5e5334f33f9dbd95c70eddece3189d9bcff5e9 100644
--- i/1996/huffman/huffman.c
@@ -1620,7 +1620,7 @@ See above entry [1998/dlowe](1998/dlowe/dlowe.c).
A point worth considering is that as the number passed into the program gets
bigger the number of lines of output gets substantially larger. For instance:
-```sh
+```
$ ./schnitzi 9|wc -l
771999
```
@@ -1651,7 +1651,7 @@ There was no IOCCC in 1999.
The author gives an example command:
-```sh
+```
echo "7 P 6 d P P 8 p" | ./dlowe | tr 876 tpo
```
@@ -1665,7 +1665,7 @@ see that it does indeed crash!
The reason for this not working is really strange.
-```sh
+```
$ echo "7 P 6 d P P 8 p" | ./dlowe
7668
$ echo "7 P 6 d P P 8 p" | ./dlowe | grep 7
@@ -1674,21 +1674,21 @@ The reason for this not working is really strange.
Why? Is it writing to stdout? Let's try some other things:
-```sh
+```
$ echo 7668 | tr 876 tpo
poot
```
Okay so we know that it SHOULD work. But we also know something funny is going on with stdout and the entry. Another experiment:
-```sh
+```
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>&2 | grep 7
7668
```
Okay so now it sees it, `grep`. But watch!
-```sh
+```
$ echo "7 P 6 d P P 8 p" | ./dlowe 2>foo 1>&1
7668
$ cat foo
@@ -1696,7 +1696,7 @@ Okay so now it sees it, `grep`. But watch!
.. so at this hour it does appear to be writing to stdout but yet somehow it doesn't? But watch:
-```sh
+```
$ echo "7 P 6 d P P 8 p" | ./dlowe 1>foo 1>&1
$ cat foo
$
@@ -1712,7 +1712,7 @@ with things but we don't know.
Other commands do work, however, and give the appropriate output, such as:
-```sh
+```
$ echo 1 2 + p | ./dlowe
3
```
@@ -1721,7 +1721,7 @@ so something is wrong with some commands/operators.
Another feature that does work in linux is:
-```sh
+```
$ echo poot | ./dlowe
poot was here!
```
@@ -1735,7 +1735,7 @@ C program except that it has the `#!/usr/bin/env perl` and `use warnings;` as
well. A note below might suggest that doing this creates incomplete perl.
Anyway:
-```c
+```
#include
int main(void)
{
@@ -1761,7 +1761,7 @@ Anyway:
Compiling this you can generate:
-```perl
+```
#!/usr/bin/env perl
use warnings;_:$_= <> ; defined or exit; @ARGV=split; __:$_= shift;defined or goto _; chomp ;(m*^\x70oO\x74$*i)?(print "$_ w\x61s h\145r\x65!\n"):((m*^\s\*(-?\d+(\.\d+)?)\s\*$*)?(push@SS ,$1):(&{chr(((ord)%39)+3**4)x2 } )); goto __; sub ff { @SS= ()} sub __{print "stack empty\n"} sub ss{$#SS<0 and goto & __; print $SS[$#SS]."\n"} sub SS{ $#SS<0 and goto &__ ; print pop @SS}sub _ { print "divide by zero\n"}sub ii{map{ print"$_\n" } reverse @SS} sub AUTOLOAD { print"unimplemented\n"} sub gg{ $#SS<0 and goto &__;push@SS,$SS[ $#SS]} sub uu{ $#SS<1 and goto &__;$SS[ $#SS]+= $SS[$#SS-1];$SS[$#SS-1]=$SS[$#SS]-$SS[$#SS-1]; $SS[$#SS]-=$SS[$#SS-1]}
```
@@ -1789,7 +1789,7 @@ itself it will print what's on the stack (for example).
To not get 'unimplemented' you can remove from the perl:
-```perl
+```
sub AUTOLOAD { print"unimplemented\n"}
```
@@ -1801,7 +1801,7 @@ others too.)
Here is an example run of several operations in the perl script after removing
that subroutine:
-```sh
+```
$ echo 5 5 p | ./dlowe.pl
5
$ echo 5 5 + p | ./dlowe.pl
@@ -1841,7 +1841,7 @@ invalid input. But as can be seen by the input I (Cody) gave the input is not
actually incorrect. It is also curious to note that it ends up printing what's
on the stack at that point:
-```sh
+```
$ echo 5 5 + p | ./dlowe.pl
unimplemented
5
@@ -1858,7 +1858,7 @@ they said is in `Perl_sv_upgrade`. As this is documented it is not considered a
bug to be fixed. For the curious this will crash in macOS. Cody notes that the
code that crashes is:
-```c
+```
perl_eval_sv
(newSVpv("_:$_= <> ; defined or exit; @ARGV"
"=split; __:$_= shift;defined or goto _; chomp "
@@ -1881,7 +1881,7 @@ code that crashes is:
and in particular it appears that it is the perl itself. In other words if one
changes it to be:
-```c
+```
perl_eval_sv(newSVpv("",0),0);
```
@@ -1893,7 +1893,7 @@ crash this makes sense.
The example command above _should_ print:
-```sh
+```
$ echo "13 14 15 16 17 + - * / p" | ./dlowe
-0.0515873015873016
```
@@ -1916,7 +1916,7 @@ of 92 warnings! Nonetheless neither works okay and both crash.
This program does not do what you might think it does! Running it like:
-```sh
+```
./primenum 13
```
@@ -2173,13 +2173,13 @@ Since the game never ends properly the score is not printed either.
It appears that the crash happens in more than one place. For instance it has
happened at
-```c
+```
XCheckMaskEvent(d, 4,&e)
```
but it's also happened at
-```c
+```
else XDrawPoint(d ,w,g,(l.s+=l.a)>>9, h=(l.c+=l.b)>>9)
```
@@ -2192,7 +2192,7 @@ In both cases the pointer `d` was corrupted:
It is believed that it also happened at
-```c
+```
XDrawString(d,w,g,W/3,H/2,m,B);
```
@@ -2200,7 +2200,7 @@ in `J()` and for the same reason.
The loop seems to be stuck in the call to `usleep(3)` like:
-```c
+```
usleep(p*200);
```
@@ -2238,7 +2238,7 @@ There was no IOCCC in 2003.
Segmentation fault will occur in some systems. For instance on macOS with the
arm64 chip:
-```sh
+```
./gavin > kernel
```
@@ -2260,7 +2260,7 @@ you have a fix? We welcome your help!
Although not related some recent changes were made to 2004/gavin to let it
compile under clang. The following patch was applied:
-```patch
+```
diff --git a/2004/gavin/gavin.c b/2004/gavin/gavin.c
index c967b7e..2082b49 100644
--- a/2004/gavin/gavin.c
@@ -2289,7 +2289,7 @@ compile under clang. The following patch was applied:
The original Makefile from 2004 had the following to say about this entry:
-```make
+```
# Special flags for the gavin entry
#
# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1
@@ -2519,7 +2519,7 @@ obnoxious in macOS as it shows it at runtime (redirecting `stderr` to
`/dev/null` will silence it). The following diff will almost work but it crashes
with at least `computer.tofu` input file:
-```diff
+```
12a13
#define gets(c) fgets((c),PI,stdin)&&(((c)[strlen((c))-1]='\0'),c!=NULL)
```
@@ -2731,7 +2731,7 @@ With `address` in linux:
but it actually works. This code is:
-```c
+```
} else
p++;
W(c)} /* LINE 101 */
@@ -2740,13 +2740,13 @@ but it actually works. This code is:
Okay but what about argument 2? Well `W` is defined as:
-```c
+```
#define W(c) e=memmove(e,x[(u)c], y[(u)c])+y[(u)c];
```
so it would appear that
-```c
+```
x[(u)c]
```
@@ -2842,7 +2842,7 @@ Now with `address` sanitiser both linux and macOS crash at:
which corresponds to the code:
-```c
+```
o rd(u v)
{
o *a = 0, **b = &a, **c = b + 32;
@@ -3224,7 +3224,7 @@ is not. Again see his index.html for details. However it is also possible to not
rely on the entry as the below shows. One should be able to do:
-```sh
+```
echo 'No. I want chocolate!' | ./prog > chocolate.raw
./prog e < chocolate.raw
@@ -3367,7 +3367,7 @@ loop printing whitespace.
When you run it on a JSON file you will see something like:
-```sh
+```
$ ./prog < ioccc.json > ioccc.html
Assertion failed: (rulez), function C, file prog.c, line 124.
Abort trap: 6
@@ -3505,7 +3505,7 @@ that they can work but it might end up that the scripts don't show any output
anyway as they use the full alphabet. To test that it works one can have a
script like:
-```sh
+```
LC_ALL=C aäbcdefghijklmnoöpqrsßtuüvwxyz | LC_ALL=C grep .. | LC_ALL=de_DE.UTF-8 ./prog aäbcdefghijklmnoöpqrsßtuüvwxyz
```
@@ -3557,7 +3557,7 @@ This program will also very likely leave sockets lying about in the current
working directory. For instance [Cody Boone
Ferguson](authors.html#Cody_Boone_Ferguson) showed us this:
-```sh
+```
$ ls -al |grep '^s'
srwxr-xr-x 1 cody staff 0 Apr 6 08:19 .BDHFHALG=
srwxr-xr-x 1 cody staff 0 Apr 6 08:15 .CGGHAMGC=
@@ -3573,13 +3573,13 @@ to ignore sockets (it did at least in macOS).
He provides the following tips on this situation. A simpler way to find sockets
in the directory:
-```sh
+```
file .*|grep socket|cut -f1 -d:
```
To delete them you can do:
-```sh
+```
find . -exec file '{}' \;|grep socket|cut -f 1 -d: | xargs rm -f
```
diff --git a/faq.html b/faq.html
index 69d2f68f8..52466a4b3 100644
--- a/faq.html
+++ b/faq.html
@@ -379,7 +379,7 @@ command that is compatible with GNU Make version 3.81.
FAQ 0.3: May I use a different source or compiled filename than prog.c or prog?
While your entry’s source filename, as submitted, must be prog.c, your entry’s Makefile
may copy prog.c to a different filename as part of the compiling/building process. For example:
-
all: desired_name
+
all: desired_name
desired_name: desired_name.c
cc desired_name.c -o $@
@@ -394,7 +394,7 @@ may copy prog.c to a different filename as part of the compiling/bu
creates as part of the compiling/building process.
You may also copy the compiled prog into a different file as part of compiling process.
For example:
-
different_name: prog
+
different_name: prog
rm -f $@
cp -f prog $@
FAQ 0.4: What platform should I assume for my entry?
@@ -779,7 +779,7 @@ winning entries page.
Section 3: Compiling and running IOCCC entries
FAQ 3.0: What Makefile rules are available to build or clean up IOCCC entries?
In general the best way to compile everything in an entry directory is to run:
-
make clobber all
+
make clobber all
If you wish to compile every entry for every year you should go to the top level
directory and run the same command as above, make clobber all.
The all rule will build everything necessary except for the alternate
@@ -788,10 +788,10 @@ alternate version exists. To build all the entries along with any alternate code
you can do from the top level directory:
make clobber everything
If you wish to only build alternate code you can do:
-
make clobber alt
+
make clobber alt
If you wish to not remove the entry binaries and only compile the additional alt
versions:
-
make alt
+
make alt
The following Makefile rules should be in all Makefiles:
all: build the entry programs (main program and any supplementary program)
@@ -968,7 +968,7 @@ XQuartz, preferably on an Apple su
macOS, preferably the most recent version.
After it is installed, open the “XQuartz” application (usually located in
/Applications/Utilities/XQuartz.app) by typing at the command line:
-
In the past it was said that one might need to run make like:
-
make ... SDL2_INCLUDE_ROOT=/usr
+
make ... SDL2_INCLUDE_ROOT=/usr
or set the following environment variable:
-
exportSDL2_INCLUDE_ROOT=/usr
+
export SDL2_INCLUDE_ROOT=/usr
but this might not be necessary in more modern days especially as we use
sdl-config and sdl2-config which should find the proper paths.
Other Linux distributions
@@ -1075,10 +1075,10 @@ as a GitHub pull request for more information about pull requests.
macOS with alternative methods for macOS and different package managers with Linux.
Red Hat based Linux
Execute the following as root or via sudo:
-
dnf install ncurses ncurses-devel
+
dnf install ncurses ncurses-devel
macOS
With macOS it should already be installed. If it is not you might have to do:
-
xcode-select--install
+
xcode-select --install
and agree to the terms and conditions and proceed with the install.
macOS via Homebrew
Not applicable, see above.
@@ -1086,7 +1086,7 @@ macOS with alternative methods for macOS and different package managers with Lin
Not applicable, see above.
Debian based Linux
Execute the following as root or via sudo:
-
apt install libncurses6
+
apt install libncurses6
and then try make all again.
Other Linux distributions
Use your package manager to install the appropriate packages. Try the search
@@ -1103,18 +1103,18 @@ processing programs, SoX, will work. H
install depends on your OS.
Red Hat based Linux
As root or via sudo:
-
dnf install -y sox sox-devel
+
dnf install -y sox sox-devel
macOS
For macOS there are two well known options.
macOS via Homebrew
If you have not already done so, install Homebrew.
Then to install SoX, execute the following command:
If you haven’t already, install
MacPorts. Then run:
-
sudo port install sox
+
sudo port install sox
Debian based Linux
Usually the index.html file will explain how to use it under Debian so we do not
include this here, at least for now.
@@ -1135,13 +1135,13 @@ when they do, -Weverything is enabled with all of its challenges, p
warnings, and sometimes warnings about things that do not matter, some of which
are frankly frivolous and often downright dubious.
To enable this feature:
-
make clobber all CC=clang
+
make clobber all CC=clang
or:
-
make clobber all 'CWARN+= -Weverything'
+
make clobber all 'CWARN+= -Weverything'
though it should be noted that if one tries -Weverything with compilers that
are not clang they might see something like:
which means that it can’t even be compiled. Thus the proper way to do it is the
first way, make clobber all CC=clang.
IOCCC authors who have access to clang might wish to try their
@@ -1184,11 +1184,11 @@ Ferguson was able to
get much of it to work and looking at that entry might be of value to your
submissions, at least if you can figure the code out :-). To see the
differences, try from 1989/westley:
As you can see, using clang has some additional problems to work out but if
you can get your entry to work well in clang it might very well be considered
better than other entries.
@@ -1202,14 +1202,14 @@ special characters. There are typical defaults like (where ^ = ctrl
and various others. But if you don’t know this you can find out through the
stty(1) command with the -a option. For instance with macOS you might see:
If you know the name you can use grep to find the correct line and if your
implementation of grep(1) has the -o option you can filter it. For instance
to find what the intr is set to:
… assuming of course that it’s a ctrl combination :-) If for some strange
reason it’s not you might have to do something else including just piping it to
just grep intr or whatever.
@@ -1246,19 +1246,19 @@ Please see FAQ 5.2 for how to submit a fix to an IOC
If your OS package manager does not have the package tcpserver you can
download, making sure you’re in a temporary directory, and compile the source
like:
Older RHEL distributions might have to use “yum” instead of “dnf”
in the above command.
macOS
@@ -1304,14 +1304,14 @@ the package website.
macOS via Homebrew
If you have not already done so, install Homebrew.
Then to install libjpeg-turbo, execute the following command:
-
brew install libjpeg-turbo
+
brew install libjpeg-turbo
macos via MacPorts
If you haven’t already, install
MacPorts. Then run:
-
sudo port install libjpeg-turbo libjpeg-turbo-devel
+
sudo port install libjpeg-turbo libjpeg-turbo-devel
Debian based Linux
Execute the following as root or via sudo:
-
apt install libturbojpeg0 libturbojpeg0-dev
+
apt install libturbojpeg0 libturbojpeg0-dev
and then try make all again.
Other Linux distributions
Use your package manager to install the appropriate packages. Try the search
@@ -1326,7 +1326,7 @@ for downloading, installing and using libjpeg-turbo.
This depends on your operating system for which we describe a couple below.
Red Hat based Linux
Execute the following as root or via sudo:
-
dnf install ImageMagick
+
dnf install ImageMagick
Older RHEL distributions might have to use “yum” instead of “dnf”
in the above command.
macOS
@@ -1338,14 +1338,14 @@ the package website.
macOS via Homebrew
If you have not already done so, install Homebrew.
Then to install ImageMagick, execute the following command:
-
brew install ImageMagick
+
brew install ImageMagick
macos via MacPorts
If you haven’t already, install
MacPorts. Then run:
Older RHEL distributions might have to use “yum” instead of “dnf”
in the above command.
@@ -1380,7 +1380,7 @@ should be able to go. However in Apple drops support for OpenGL later on,
you might look to install OpenGL via Homebrew or MacPorts.
@@ -1409,9 +1409,9 @@ because of alarming warnings that can be displayed, in some systems at runtime
interspersed with the output of the program.
For instance in macOS the entry 1990/tbr would output the
warning in such a way that caused confusing output for the entry, looking like:
-
$ ./tbr
-$ warning: this program uses gets(), which is unsafe.
-# nothing here, what to do?
+
$ ./tbr
+ $ warning: this program uses gets(), which is unsafe.
+ # nothing here, what to do?
In some cases changing the code to use fgets() is not so easy to fix and in
one case at least there is an alternate version that has the fix instead due to
a problem it creates (correct output but segfaults after the output in one of
@@ -1486,7 +1486,7 @@ allows for easily seeing the diffs.
As some examples we’ll first look at one that has really long lines which
will make it harder to see what is different,
2001/anonymous. What you would do is cd 2001/anonymous and then do:
-
make diff_orig_prog
+
make diff_orig_prog
and then be really confused! :-)
But for an entry like 1991/dds, you can see the
differences much more easily. 1991/dds is a good example where it’s very
@@ -1503,13 +1503,13 @@ when you have compiler errors :-) (though there are, as noted, some examples
where it’s quite easy to see the differences).
1991/dds is also a good example to see the alt difference
very easily. To do that cd 1991/dds and then do:
-
make diff_alt_prog
+
make diff_alt_prog
and you’ll see a single line changed and very simply.
Tip: if you have colordiff installed it’s a lot easier to see the differences
To use these rules but provide a different diff, for instance colordiff,
just do:
-
make DIFF=colordiff diff_orig_prog # for orig to prog diff
-make DIFF=colordiff diff_alt_prog # for alt to prog diff
+
make DIFF=colordiff diff_orig_prog # for orig to prog diff
+ make DIFF=colordiff diff_alt_prog # for alt to prog diff
Obviously if you want to view the alt code or the orig code you can just open
the files as described above.
FAQ 4.3 - Why do author remarks sometimes not match the source and/or why are there other inconsistencies with the original entry?
@@ -1778,7 +1778,7 @@ how they are used.
POSIX safe string plus the use of + (for technical reasons beyond this
answer). In particular, the author_handle must be an ASCII string that
matches this regexp:
-
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
+
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
Default author_handle’s do not have multiple consecutive _ (underscore)
characters. Nevertheless, multiple consecutive _ (underscore) characters are
allowed. Contest submitters who wish to override their default author_handle may do so.
@@ -1799,7 +1799,7 @@ year.
NOTE: even if the directory name is not anonymous the above rules apply as in
in the case of 2005/anon.
Anonymous author_handle’s match this regexp:
-
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
+
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
See FAQ 5.5 for information about how to update
and/or correct IOCCC author information.
FAQ 6.6: What is a author_handle.json file and how are they used?
@@ -1828,52 +1828,52 @@ for information on the So-called JSON spec.
is to look at an example, the author_handle.json file for Yusuke Endoh:
author/Yusuke_Endoh.json
As of Thu Nov 30 23:51:12 UTC 2023, the contents was as follows:
-
{
-"no_comment":"mandatory comment: because comments were removed from the original JSON spec",
-"author_JSON_format_version":"1.0 2023-06-10",
-"author_handle":"Yusuke_Endoh",
-"full_name":"Yusuke Endoh",
-"sort_word":"endoh",
-"location_code":"JP",
-"email":"mame@ruby-lang.org",
-"url":"https://mametter.hatenablog.com",
-"alt_url":null,
-"deprecated_twitter_handle":null,
-"mastodon":"@mame@ruby.social",
-"mastodon_url":"https://ruby.social/@mame",
-"github":"@mame",
-"affiliation":null,
-"winning_entry_set":[
-{"entry_id":"2012_endoh1"},
-{"entry_id":"2012_endoh2"},
-{"entry_id":"2013_endoh1"},
-{"entry_id":"2013_endoh2"},
-{"entry_id":"2013_endoh3"},
-{"entry_id":"2013_endoh4"},
-{"entry_id":"2014_endoh1"},
-{"entry_id":"2014_endoh2"},
-{"entry_id":"2015_endoh1"},
-{"entry_id":"2015_endoh2"},
-{"entry_id":"2015_endoh3"},
-{"entry_id":"2015_endoh4"},
-{"entry_id":"2018_endoh1"},
-{"entry_id":"2018_endoh2"},
-{"entry_id":"2019_endoh"},
-{"entry_id":"2020_endoh1"},
-{"entry_id":"2020_endoh2"},
-{"entry_id":"2020_endoh3"}
-]
-}
<!--- json--> "no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
Because the authors of the so-called JSON spec removed the ability to use comments in JSON
(for reason(s) that seem to be less than credible), the IOCCC mandates this JSON member
be present in all IOCCC related JSON files.
There MUST be one and only one no_commentJSON member and the JSON valueMUST
be the exact JSON string as shown above.
author_JSON_format_version
-
"author_JSON_format_version":"1.02023-06-10",
+
"author_JSON_format_version" : "1.0 2023-06-10",
This JSON member holds the format version of the author_handle.json JSON file.
There MUST be one and only one author_JSON_format_versionJSON member and the JSON valueMUST be a JSON string.
@@ -1885,7 +1885,7 @@ of the these files is modified: and then only those who maintain the
official IOCCC web site would be the one to do this
in conjunction with changes to bin directory tools.
author_handle
-
"author_handle":"Yusuke_Endoh",
+
"author_handle" : "Yusuke_Endoh",
This JSON member holds the author handle of the author.
There MUST be one and only one author_handleJSON member
and the JSON valueMUST be a JSON string that is also a value author handle.
@@ -1899,14 +1899,14 @@ without the trailing .json) of the author_handle.json
a change of author_handleJSON value would also require the
author_handle.json file to also be renamed.
full_name
-
"full_name":"YusukeEndoh",
+
"full_name" : "Yusuke Endoh",
This JSON member holds the full name of the author.
There MUST be one and only one full_nameJSON member and the JSON valueMUST
be a JSON string.
The full name of an author may use non-ASCII characters so long as the
full name is properly encoded as a JSON string.
sort_word
-
"sort_word":"endoh",
+
"sort_word" : "endoh",
This JSON member holds the string that will be used to sort the author.
There MUST be one and only one sort_wordJSON member and the JSON valueMUST
be a JSON string. Moreover the string MUST be a lower case ASCII
@@ -1920,7 +1920,7 @@ wishes to be found in the /authors.html file under a different
string, such as if they wish to be listed under their first name
or their username, then they may change this accordingly.
location_code
-
"location_code":"JP",
+
"location_code" : "JP",
This JSON member holds the string that is the
ISO 3166-1 alpha-2 code
of the author’s location or country.
@@ -1937,38 +1937,38 @@ ISO 3166-1 alpha-2 codes belong to locations that are not technically
a country, such as “Antarctica” or a User-assigned code.
If the author wishes to not specify a location, they should select XX.
email
-
"email":"mame@ruby-lang.org",
+
"email" : "mame@ruby-lang.org",
This JSON member holds the email address of the author, or is the value null.
There MUST be one and only one emailJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null.
If the author wishes to not specify an email address, or if the email address is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"email":null,
+
"email" : null,
NOTE: The JSON null is NOT enclosed in quotes!
url
-
"url":"https://mametter.hatenablog.com",
+
"url" : "https://mametter.hatenablog.com",
This JSON member holds the URL of the author’s home page.
There MUST be one and only one urlJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null.
If the author wishes to not specify an email address, or if the URL is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"url":null,
+
"url" : null,
NOTE: The JSON null is NOT enclosed in quotes!
alt_url
-
"alt_url":null,
+
"alt_url" : null,
This JSON member holds an alternate or 2nd URL a home page for the author.
There MUST be one and only one urlJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null.
In some cases the author may wish to record a special URL for their IOCCC entry,
or a 2nd URL such as a work or school or personal home page. For example,
Cody as of Thu Nov 30 23:51:12 UTC 2023 used:
-
"alt_url":"https://ioccc.xexyl.net",
+
"alt_url" : "https://ioccc.xexyl.net",
If the author wishes to not specify an email address, or if the alternate URL is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"url":null,
+
"url" : null,
NOTE: The JSON null is NOT enclosed in quotes!
deprecated_twitter_handle
This JSON member used to hold the twitter handle of the author.
@@ -1978,14 +1978,14 @@ be a JSON string or it MUST be a JSON null.
and so the deprecated_twitter_handle is no longer used. A JSON value that is
not a JSON null is kept for only historic reasons. For example, Anthony C. Howe
once used:
-
"deprecated_twitter_handle":"@SirWumpus",
+
"deprecated_twitter_handle" : "@SirWumpus",
If the author wishes to not specify an twitter handle, or if the twitter handle is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
For more information in Mastodon, see the Mastodon help guide.
See the “Mastodon Address” section of that page in particular.
The IOCCC Mastodon handle is:
-
@ioccc@fosstodon.org
+
@ioccc@fosstodon.org
The IOCCC uses the Mastodon social network for announcements such
as the opening and closing of a new IOCCC, changes to the IOCCC web
site, updates during the judging process, and when new IOCCC entries
@@ -2005,10 +2005,10 @@ are selected. We recommend you follow us on Mastodon.
If the author wishes to not specify an Mastodon handle, or if the Mastodon handle is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"mastodon":null,
+
"mastodon" : null,
NOTE: The JSON null is NOT enclosed in quotes!
mastodon_url
-
"mastodon_url":"https://ruby.social/@mame",
+
"mastodon_url" : "https://ruby.social/@mame",
This JSON member holds the URL of the author’s Mastodon page.
There MUST be one and only one mastodon_urlJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null. The JSON string just be a valid URL.
@@ -2022,10 +2022,10 @@ For example, if the Mastodon handle is:
If the author wishes to not specify an Mastodon URL, or if the Mastodon URL is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"mastodon_url":null,
+
"mastodon_url" : null,
NOTE: The JSON null is NOT enclosed in quotes!
github
-
"github":"@mame",
+
"github" : "@mame",
This JSON member holds the GitHub handle of the author.
There MUST be one and only one githubJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null. The githubJSON stringMUST
@@ -2037,10 +2037,10 @@ and hosts official IOCCC web site on GitHub
If the author wishes to not specify an GitHub handle, or if the GitHub handle is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
-
"github":null,
+
"github" : null,
NOTE: The JSON null is NOT enclosed in quotes!
affiliation
-
"affiliation":null,
+
"affiliation" : null,
This JSON member holds the affiliation of the author.
There MUST be one and only one affiliationJSON member and the JSON valueMUST
be a JSON string or it MUST be a JSON null.
@@ -2051,19 +2051,19 @@ For example, the affiliation for the IOCCC would be:
If the author wishes to not specify an affiliation, or if the affiliation is
unknown, they should use the JSON null as the JSON value of this JSON member.
For example:
The winning_entry_setJSON member holds JSON array containing one or more entry_id _JSON member_s.
There MUST be one and only one winning_entry_set and the JSON valueMUST
be a non-empty JSON array. Each value in that JSON arrayMUST must contain
@@ -2091,7 +2091,7 @@ of the IOCCC entry directories for a given year. For example, see the 1984/anonymous/.path.
The .top, .year and .path files are generated from the top level Makefile, by:
-
make genpath
+
make genpath
<a name”terms”>FAQ 6.9: What is the current meaning of the IOCCC terms Author, Entry, and Submission?
The IOCCC is now attempting to use the following terms:
@@ -2163,7 +2163,7 @@ instructions. Once you’ve completed this task make sure you log in to GitHub.<
Assuming you do not have an ssh key you should go to the command prompt and
type (if you already have one and are okay using it for GitHub you can use that
one):
-
ssh-keygen-t rsa -b 4096 -C"luser@example.com"
+
ssh-keygen -t rsa -b 4096 -C "luser@example.com"
where luser@example.com is the email you want associated with your key.
Follow the instructions. It will tell you the key files.
Once you have forked the repo you are ready to clone it to your system. For
instance Cody Boone Ferguson has the GitHub handle xexyl so he would type in:
Once that is completed you will need to change to that directory. The default
directory would be the name of the repo but if you specified a target directory
it will be that. For instance using the above example you might do:
-
cd temp-test-ioccc
+
cd temp-test-ioccc
You’re ready to make your changes now!
Making changes, fixes etc.
Here you must use your wits, knowledge, creativity and whatever else you have.
@@ -2210,7 +2210,7 @@ or an exercise in sibilance!
starts with # Last updated: to refer to 01 March 2024 rather than what it
is now (at the time of writing this), 15 April 2023.
But what if he wanted to add a file? He’d create the file and then type:
-
git add foo
+
git add foo
where foo is the file to add.
When he’s ready to make a commit he would need to create a new branch for the
pull request.
@@ -2218,26 +2218,26 @@ pull request.
First, as an aside, if this is your first pull request (which we assume is if you’re
reading this :-) ) you need to make sure that you can push changes to GitHub
with your ssh key. To do this you need to do:
-
ssh-T git@github.com
+
ssh -T git@github.com
Cody would see:
Hi xexyl! You’ve successfully authenticated, but GitHub does not provide shell access.
Before doing anything else, however, a new branch needs to be created.
Continuing the example above for
2020/ferguson1/play.sh, it might be that:
-
git checkout -B human-snakes
+
git checkout -B human-snakes
This would change the branch to the newly created branch human-snakes branch.
Now Cody could commit the changes:
-
git commit play.sh # if specifying specific files
-git commit -a# if committing everything
+
git commit play.sh # if specifying specific files
+ git commit -a # if committing everything
He could also have done:
-
git add play.sh
-git commit
+
git add play.sh
+ git commit
In any case this would open an editor (in his case vim) to write a commit log.
It is recommended that the first line is <=51 chars and the next line is blank.
Then if necessary add a description for the log. For instance the above might
@@ -2250,7 +2250,7 @@ warrant the log:
Opening a pull request
To do this depends on the branch name. Assuming the branch from above,
human-snakes, you would type:
-
git push --set-upstream origin human-snakes
+
git push --set-upstream origin human-snakes
This might show:
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
@@ -2296,7 +2296,7 @@ in the matter.
When the judges have merged the pull request you now need to make sure your fork
has the merge. To do this from the command line, assuming the fork in the above
example, you would type:
all: desired_name
desired_name: desired_name.c
@@ -336,7 +336,7 @@ creates as part of the compiling/building process.
You may also copy the compiled `prog` into a different file as part of compiling process.
For example:
-```make
+```
different_name: prog
rm -f $@
cp -f prog $@
@@ -840,7 +840,7 @@ winning entries page](../years.html).
In general the best way to compile everything in an entry directory is to run:
-```sh
+```
make clobber all
```
@@ -858,14 +858,14 @@ you can do from the top level directory:
If you wish to only build alternate code you can do:
-```sh
+```
make clobber alt
```
If you wish to not remove the entry binaries and only compile the additional alt
versions:
-```sh
+```
make alt
```
@@ -1078,7 +1078,7 @@ First, see the above note on [installing and starting Xorg](#X11_general).
Install Xorg and related packages:
-```sh
+```
sudo dnf install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*'
```
@@ -1107,7 +1107,7 @@ macOS, preferably the most recent version](https://support.apple.com/macos).
After it is installed, open the "XQuartz" application (usually located in
`/Applications/Utilities/XQuartz.app`) by typing at the command line:
-```sh
+```
open /Applications/Utilities/XQuartz.app
```
@@ -1141,7 +1141,7 @@ First, see the above note on [installing and starting Xorg](#X11_general).
According to the [Debian Xorg wiki](https://wiki.debian.org/Xorg), installing
X11 requires:
-```sh
+```
sudo apt install xorg
```
@@ -1167,13 +1167,13 @@ See also:
For systems that have the `dnf(1)` command:
-```sh
+```
sudo dnf install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*'
```
For systems that have the `yum(1)` command:
-```sh
+```
sudo yum install --skip-broken --best --exclude xorgxrdp --exclude xorgxrdp-glamor '*xorg*' 'libx*' 'libX*' 'fontconfig*'
```
@@ -1201,7 +1201,7 @@ macOS with alternative methods for macOS and different package managers with Lin
Execute the following as root or via sudo:
-```sh
+```
dnf install SDL2 SDL2-devel sdl12-compat sdl12-compat-devel
```
@@ -1210,13 +1210,13 @@ in the above command.
In the past it was said that one might need to run `make` like:
-```sh
+```
make ... SDL2_INCLUDE_ROOT=/usr
```
or set the following environment variable:
-```sh
+```
export SDL2_INCLUDE_ROOT=/usr
```
@@ -1239,7 +1239,7 @@ If you have not already done so, install [Homebrew](https://brew.sh).
Then to install SDL and SDL2, execute the following command:
-```sh
+```
brew install sdl2 sdl12-compat
eval "$(opt/homebrew/bin/brew shellenv)"
```
@@ -1251,7 +1251,7 @@ If you haven't already, install
[MacPorts](https://www.macports.org/install.php). Then run:
-```sh
+```
sudo port install libsdl libsdl2
```
@@ -1260,7 +1260,7 @@ If you haven't already, install
Execute the following as root or via sudo:
-```sh
+```
apt install libsdl1.2debian libsdl1.2-dev libsdl2-dev
```
@@ -1268,13 +1268,13 @@ and then try `make all` again.
In the past it was said that one might need to run `make` like:
-```sh
+```
make ... SDL2_INCLUDE_ROOT=/usr
```
or set the following environment variable:
-```sh
+```
export SDL2_INCLUDE_ROOT=/usr
```
@@ -1319,7 +1319,7 @@ macOS with alternative methods for macOS and different package managers with Lin
Execute the following as root or via sudo:
-```sh
+```
dnf install ncurses ncurses-devel
```
@@ -1328,7 +1328,7 @@ Execute the following as root or via sudo:
With macOS it should already be installed. If it is not you might have to do:
-```sh
+```
xcode-select --install
```
@@ -1349,7 +1349,7 @@ Not applicable, see above.
Execute the following as root or via sudo:
-```sh
+```
apt install libncurses6
```
@@ -1382,7 +1382,7 @@ install depends on your OS.
As root or via sudo:
-```sh
+```
dnf install -y sox sox-devel
```
@@ -1396,7 +1396,7 @@ If you have not already done so, install [Homebrew](https://brew.sh).
Then to install SoX, execute the following command:
-```sh
+```
brew install sox
eval "$(opt/homebrew/bin/brew shellenv)"
```
@@ -1408,7 +1408,7 @@ If you haven't already, install
[MacPorts](https://www.macports.org/install.php). Then run:
-```sh
+```
sudo port install sox
```
@@ -1447,20 +1447,20 @@ are frankly frivolous and often downright dubious.
To enable this feature:
-```sh
+```
make clobber all CC=clang
```
or:
-```sh
+```
make clobber all 'CWARN+= -Weverything'
```
though it should be noted that if one tries `-Weverything` with compilers that
are not `clang` they _might_ see something like:
-```sh
+```
echo 'int main(void) {}' > foo.c ; cc -Weverything foo.c -o foo
cc: error: unrecognized command-line option '-Weverything'
```
@@ -1513,19 +1513,19 @@ get much of it to work and looking at that entry might be of value to your
submissions, at least if you can figure the code out :-). To see the
differences, try from `1989/westley`:
-```sh
+```
make diff_orig_prog
```
If you have `colordiff` try:
-```sh
+```
make DIFF=colordiff diff_orig_prog
```
Alternatively you can try:
-```sh
+```
git diff d2a42f42e8f477f29e9d5ed09ce2bb349eaf7397..eb9e69fde657acc8c85a618a8a99af4c2f93b21d westley.c
```
@@ -1546,7 +1546,7 @@ special characters. There are typical defaults like (where `^` = ctrl):
and various others. But if you don't know this you can find out through the
`stty(1)` command with the `-a` option. For instance with macOS you might see:
-```sh
+```
$ stty -a
speed 9600 baud; rows 40; columns 155;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; [..snip..]
@@ -1556,7 +1556,7 @@ If you know the name you can use `grep` to find the correct line and if your
implementation of `grep(1)` has the `-o` option you can filter it. For instance
to find what the `intr` is set to:
-```sh
+```
$ stty -a |grep -o 'intr = ^[[:alpha:]]'
intr = ^C
```
@@ -1610,7 +1610,7 @@ If your OS package manager does not have the package `tcpserver` you can
download, making sure you're in a temporary directory, and compile the source
like:
-```sh
+```
wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
tar ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
@@ -1619,7 +1619,7 @@ like:
Then as root or via `sudo(1)` enter:
-```sh
+```
make setup check
```
@@ -1636,7 +1636,7 @@ This depends on your operating system for which we describe a couple below.
Execute the following as root or via sudo:
-```sh
+```
dnf install netpbm-progs netpbm
```
@@ -1660,7 +1660,7 @@ If you have not already done so, install [Homebrew](https://brew.sh).
Then to install netpbm, execute the following command:
-```sh
+```
brew install netpbm
```
@@ -1671,7 +1671,7 @@ If you haven't already, install
[MacPorts](https://www.macports.org/install.php). Then run:
-```sh
+```
sudo port install libnetpbm netpbm
```
@@ -1680,7 +1680,7 @@ If you haven't already, install
Execute the following as root or via sudo:
-```sh
+```
apt install netpbm
```
@@ -1713,7 +1713,7 @@ This depends on your operating system for which we describe a couple below.
Execute the following as root or via sudo:
-```sh
+```
dnf install libjpeg-turbo-utils libjpeg-turbo-devel libjpeg-turbo
```
@@ -1737,7 +1737,7 @@ If you have not already done so, install [Homebrew](https://brew.sh).
Then to install libjpeg-turbo, execute the following command:
-```sh
+```
brew install libjpeg-turbo
```
@@ -1748,7 +1748,7 @@ If you haven't already, install
[MacPorts](https://www.macports.org/install.php). Then run:
-```sh
+```
sudo port install libjpeg-turbo libjpeg-turbo-devel
```
@@ -1758,7 +1758,7 @@ If you haven't already, install
Execute the following as root or via sudo:
-```sh
+```
apt install libturbojpeg0 libturbojpeg0-dev
```
@@ -1790,7 +1790,7 @@ This depends on your operating system for which we describe a couple below.
Execute the following as root or via sudo:
-```sh
+```
dnf install ImageMagick
```
@@ -1813,7 +1813,7 @@ If you have not already done so, install [Homebrew](https://brew.sh).
Then to install ImageMagick, execute the following command:
-```sh
+```
brew install ImageMagick
```
@@ -1824,7 +1824,7 @@ If you haven't already, install
[MacPorts](https://www.macports.org/install.php). Then run:
-```sh
+```
sudo port install ImageMagick
```
@@ -1833,7 +1833,7 @@ If you haven't already, install
Execute the following as root or via sudo:
-```sh
+```
apt install imagemagick
```
@@ -1867,7 +1867,7 @@ general information about X11.
Once X11 is install and the X Window Server is running, one needs to compile
and link with the two libraries, _GL_ and _GLU_:
-```sh
+```
cc ... -lGL -lGLU -L _location-where-X11-libs-are-installed_ -lX11
```
@@ -1879,7 +1879,7 @@ We suggest you check out their resource for further information on OpenGL.
Execute the following as root or via sudo:
-```sh
+```
sudo dnf install glew-devel SDL2-devel SDL2_image-devel glm-devel freetype-devel
```
@@ -1903,7 +1903,7 @@ you might look to install OpenGL via Homebrew or MacPorts.
Execute the following as root or via sudo:
-```sh
+```
sudo apt-get install libglew-dev libsdl2-dev libsdl2-image-dev libglm-dev libfreetype6-dev
```
@@ -1954,7 +1954,7 @@ interspersed with the output of the program.
For instance in macOS the entry [1990/tbr](1990/tbr/index.html) would output the
warning in such a way that caused confusing output for the entry, looking like:
-```sh
+```
$ ./tbr
$ warning: this program uses gets(), which is unsafe.
# nothing here, what to do?
@@ -2044,7 +2044,7 @@ will make it harder to see what is different,
[2001/anonymous](2001/anonymous/index.html). What you would do is `cd
2001/anonymous` and then do:
-```sh
+```
make diff_orig_prog
```
@@ -2069,7 +2069,7 @@ where it's quite easy to see the differences).
[1991/dds](1991/dds/index.html) is also a good example to see the alt difference
very easily. To do that `cd 1991/dds` and then do:
-```sh
+```
make diff_alt_prog
```
@@ -2081,7 +2081,7 @@ and you'll see a single line changed and very simply.
To use these rules but provide a different `diff`, for instance `colordiff`,
just do:
-```sh
+```
make DIFF=colordiff diff_orig_prog # for orig to prog diff
make DIFF=colordiff diff_alt_prog # for alt to prog diff
```
@@ -2475,7 +2475,7 @@ POSIX safe string plus the use of `+` (for technical reasons beyond this
answer). In particular, the `author_handle` must be an ASCII string that
matches this regexp:
-```re
+```
^[0-9A-Za-z][0-9A-Za-z._+-]*$"
```
@@ -2514,7 +2514,7 @@ in the case of [2005/anon](2005/anon/anon.c).
Anonymous `author_handle`'s match this regexp:
-```re
+```
Anonymous_[0-9][0-9][0-9][0-9][.0-9]*$
```
@@ -2564,7 +2564,7 @@ is to look at an example, the `author_handle.json` file for Yusuke Endoh:
As of _Thu Nov 30 23:51:12 UTC 2023_, the contents was as follows:
-```json
+```
{
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"author_JSON_format_version" : "1.0 2023-06-10",
@@ -2608,7 +2608,7 @@ We now will walk thru the above JSON document looking at various JSON members:
##### no_comment
-``` json
+```
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
```
@@ -2622,7 +2622,7 @@ be the exact _JSON string_ as shown above.
##### author_JSON_format_version
-```json
+```
"author_JSON_format_version" : "1.0 2023-06-10",
```
@@ -2643,7 +2643,7 @@ in conjunction with changes to [bin directory tools](bin/index.html).
##### author_handle
-```json
+```
"author_handle" : "Yusuke_Endoh",
```
@@ -2666,7 +2666,7 @@ a change of _author_handle_ _JSON value_ would also require the
##### full_name
-```json
+```
"full_name" : "Yusuke Endoh",
```
@@ -2681,7 +2681,7 @@ full name is properly encoded as a _JSON string_.
##### sort_word
-```json
+```
"sort_word" : "endoh",
```
@@ -2704,7 +2704,7 @@ or their username, then they may change this accordingly.
##### location_code
-```json
+```
"location_code" : "JP",
```
@@ -2731,7 +2731,7 @@ If the author wishes to not specify a location, they should select **XX**.
##### email
-```json
+```
"email" : "mame@ruby-lang.org",
```
@@ -2744,7 +2744,7 @@ If the author wishes to not specify an email address, or if the email address is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"email" : null,
```
@@ -2753,7 +2753,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### url
-```json
+```
"url" : "https://mametter.hatenablog.com",
```
@@ -2766,7 +2766,7 @@ If the author wishes to not specify an email address, or if the URL is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"url" : null,
```
@@ -2775,7 +2775,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### alt_url
-```json
+```
"alt_url" : null,
```
@@ -2788,7 +2788,7 @@ In some cases the author may wish to record a special URL for their IOCCC entry,
or a 2nd URL such as a work or school or personal home page. For example,
Cody as of _Thu Nov 30 23:51:12 UTC 2023_ used:
-```json
+```
"alt_url" : "https://ioccc.xexyl.net",
```
@@ -2796,7 +2796,7 @@ If the author wishes to not specify an email address, or if the alternate URL is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"url" : null,
```
@@ -2815,7 +2815,7 @@ and so the `deprecated_twitter_handle` is **no longer used**. A _JSON value_ th
not a _JSON null_ is kept for only historic reasons. For example, Anthony C. Howe
once used:
-```json
+```
"deprecated_twitter_handle" : "@SirWumpus",
```
@@ -2823,7 +2823,7 @@ If the author wishes to not specify an twitter handle, or if the twitter handle
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"deprecated_twitter_handle" : null,
```
@@ -2832,7 +2832,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### mastodon
-```json
+```
"mastodon" : "@mame@ruby.social",
```
@@ -2851,7 +2851,7 @@ See the "Mastodon Address" section of that page in particular.
The IOCCC Mastodon handle is:
-```json
+```
@ioccc@fosstodon.org
```
@@ -2864,7 +2864,7 @@ If the author wishes to not specify an Mastodon handle, or if the Mastodon handl
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"mastodon" : null,
```
@@ -2873,7 +2873,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### mastodon_url
-```json
+```
"mastodon_url" : "https://ruby.social/@mame",
```
@@ -2901,7 +2901,7 @@ If the author wishes to not specify an Mastodon URL, or if the Mastodon URL is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"mastodon_url" : null,
```
@@ -2910,7 +2910,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### github
-```json
+```
"github" : "@mame",
```
@@ -2933,7 +2933,7 @@ If the author wishes to not specify an GitHub handle, or if the GitHub handle is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"github" : null,
```
@@ -2942,7 +2942,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### affiliation
-```json
+```
"affiliation" : null,
```
@@ -2963,7 +2963,7 @@ If the author wishes to not specify an affiliation, or if the affiliation is
unknown, they should use the _JSON null_ as the _JSON value_ of this _JSON member_.
For example:
-```json
+```
"affiliation" : null,
```
@@ -2973,7 +2973,7 @@ NOTE: The _JSON null_ is **NOT** enclosed in quotes!
##### winning_entry_set
##### entry_id
-```json
+```
"winning_entry_set" : [
{ "entry_id" : "2012_endoh1" },
{ "entry_id" : "2012_endoh2" },
@@ -3035,7 +3035,7 @@ For example see [1984/anonymous/.path](1984/anonymous/.path).
The .top, .year and .path files are generated from the top level Makefile, by:
-```sh
+```
make genpath
```
@@ -3128,7 +3128,7 @@ Assuming you do not have an ssh key you should go to the command prompt and
type (if you already have one and are okay using it for GitHub you can use that
one):
-```sh
+```
ssh-keygen -t rsa -b 4096 -C "luser@example.com"
```
@@ -3165,7 +3165,7 @@ instructions in forking the repo.
Once you have forked the repo you are ready to clone it to your system. For
instance Cody Boone Ferguson has the GitHub handle _xexyl_ so he would type in:
-```sh
+```
git clone https://github.com/xexyl/temp-test-ioccc [target_dir]
```
@@ -3173,7 +3173,7 @@ Once that is completed you will need to change to that directory. The default
directory would be the name of the repo but if you specified a target directory
it will be that. For instance using the above example you might do:
-```sh
+```
cd temp-test-ioccc
```
@@ -3199,7 +3199,7 @@ is now (at the time of writing this), `15 April 2023`.
But what if he wanted to add a file? He'd create the file and then type:
-```sh
+```
git add foo
```
@@ -3214,7 +3214,7 @@ First, as an aside, if this is your first pull request (which we assume is if yo
reading this :-) ) you need to make sure that you can push changes to GitHub
with your ssh key. To do this you need to do:
-```sh
+```
ssh -T git@github.com
```
@@ -3226,7 +3226,7 @@ Now, assuming that the forked repo is
, you'd type:
-```sh
+```
git remote set-url origin git@github.com:xexyl/temp-test-ioccc.git
```
@@ -3237,21 +3237,21 @@ Continuing the example above for
[2020/ferguson1/play.sh](2020/ferguson1/play.sh), it might be that:
-```sh
+```
git checkout -B human-snakes
```
This would change the branch to the newly created branch `human-snakes` branch.
Now Cody could commit the changes:
-```sh
+```
git commit play.sh # if specifying specific files
git commit -a # if committing everything
```
He could also have done:
-```sh
+```
git add play.sh
git commit
```
@@ -3276,7 +3276,7 @@ Now a pull request has to be opened.
To do this depends on the branch name. Assuming the branch from above,
`human-snakes`, you would type:
-```sh
+```
git push --set-upstream origin human-snakes
```
@@ -3339,7 +3339,7 @@ When the judges have merged the pull request you now need to make sure your fork
has the merge. To do this from the command line, assuming the fork in the above
example, you would type:
-```sh
+```
git checkout master && git pull https://github.com/ioccc-src/temp-test-ioccc.git master && git push origin master
```
diff --git a/news.html b/news.html
index c4b9f134a..71f22d4b3 100644
--- a/news.html
+++ b/news.html
@@ -206,8 +206,8 @@ in date(1) format.
status.json page,
a “latest_news” JSON member whose value is the date
of the most recent news item.
-
"status_date" : "Mon Jan 30 02:28:44 PST 2023",
+ "latest_news" : "Mon Jan 30 02:28:44 PST 2023"
2022-12-18
As per the suggestion of Toni Mikkola
(_@Virtaava@home.social_) we now maintain a
diff --git a/news.md b/news.md
index 2327166fc..536c448bd 100644
--- a/news.md
+++ b/news.md
@@ -107,7 +107,7 @@ We also added to the
a _"latest_news"_ JSON member whose value is the date
of the most recent news item.
-```json
+```
"status_date" : "Mon Jan 30 02:28:44 PST 2023",
"latest_news" : "Mon Jan 30 02:28:44 PST 2023"
```
diff --git a/status.html b/status.html
index a5db42d87..7e0b0b75c 100644
--- a/status.html
+++ b/status.html
@@ -132,7 +132,7 @@
"no_comment":"mandatory comment: because comments were removed from the original JSON spec","IOCCC_status_version":"1.0 2024-03-09","contest_status":"closed",
-"news_update":"2024-04-01T09:56:43+00:00",
+"news_update":"2024-04-04T21:27:31+00:00","status_update":"2024-03-31T05:02:06+00:00"}
@@ -147,7 +147,7 @@
This is a mandatory comment for which we offer no comment other
than this comment. :-)
The JSON member value must be the following JSON quoted string:
"mandatory comment: because comments were removed from the original JSON spec"
IOCCC_status_version
This is the version of format of the status.json file.
The JSON member value of is a JSON quoted string the form “version YYYY-MM-DD”.
@@ -197,7 +197,7 @@ mastodon feed for information about future IOCCC openings.
This shows the latest modification date for the IOCCC news page.
The JSON member value is a JSON quoted string obtained from the date field
of the following ls(1) command:
-
TZ=UTC ls -D '%FT%T+00:00' -ld news.html
+
TZ=UTC ls -D '%FT%T+00:00' -ld news.html
NOTE: The date and time are given with respect to UTC timezone.
Sorry: It is possible that for some reason, the IOCCC news page
was modified without the content being changed. While we will try to minimize
@@ -206,7 +206,7 @@ the cases where this happen, we apologize in advance (Sorry tm Canada 🇨🇦)
This shows the latest modification date status.json file.
The JSON member value is a JSON quoted string obtained from the date field
of the following ls(1) command:
-
TZ=UTC ls -D '%FT%T+00:00' -ld status.json
+
TZ=UTC ls -D '%FT%T+00:00' -ld status.json
NOTE: The date and time are given with respect to UTC timezone.
Sorry: It is possible that for some reason, the status.json file
was modified without the content being changed. While we will try to minimize
diff --git a/status.json b/status.json
index 53efeec6a..6367b1d25 100644
--- a/status.json
+++ b/status.json
@@ -2,6 +2,6 @@
"no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
"IOCCC_status_version" : "1.0 2024-03-09",
"contest_status" : "closed",
- "news_update" : "2024-04-01T09:56:43+00:00",
+ "news_update" : "2024-04-04T21:27:31+00:00",
"status_update" : "2024-03-31T05:02:06+00:00"
}
diff --git a/status.md b/status.md
index 27e981ecb..7e371daf4 100644
--- a/status.md
+++ b/status.md
@@ -10,7 +10,7 @@ than this comment. :-)
The JSON member value must be the following JSON quoted string:
-```json
+```
"mandatory comment: because comments were removed from the original JSON spec"
```
@@ -100,7 +100,7 @@ This shows the latest modification date for the [IOCCC news](news.html) page.
The JSON member value is a JSON quoted string obtained from the date field
of the following `ls(1)` command:
-```ls
+```
TZ=UTC ls -D '%FT%T+00:00' -ld news.html
```
@@ -118,7 +118,7 @@ This shows the latest modification date [status.json](status.json) file.
The JSON member value is a JSON quoted string obtained from the date field
of the following `ls(1)` command:
-```ls
+```
TZ=UTC ls -D '%FT%T+00:00' -ld status.json
```
diff --git a/thanks-for-help.html b/thanks-for-help.html
index 9b8ec4056..fbb965865 100644
--- a/thanks-for-help.html
+++ b/thanks-for-help.html
@@ -186,9 +186,9 @@ bringing back an extern declaration (slightly changing it to match the symbol
that it is i.e. extern double floor(double); instead of extern int floor;)
and also bringing back double (x1, y1) b; and even this funny code that could
be kept in:
-
#define char k['a']
-char x {sizeof(
-double(%s,%D)(*)())
+
#define char k['a']
+ char x {sizeof(
+ double(%s,%D)(*)())
This does mean that there cannot be a second arg to main()
as clang requires that to be a char ** and thecharredefined would not allow this. Some versions of clang say thatmain()must have either 0, 2 or 3 args but these versions do not object to 1 arg. However as thecharmacro seems more obscure and it is possible that a new version of clang will be even more strict theint iparameter inmain()was moved to be insidemain(), set to non-zero (settingito 0 will not work). This waymain()` has zero
args.
@@ -203,7 +203,7 @@ seems possible) it is easy to fix but it is hoped that this won’t happen.
Originally Yusuke supplied a patch so that this entry would compile with gcc -
but not clang - or at least some versions.
Cody also fixed this to not crash when no arg is specified. Note that if the arg
@@ -288,7 +288,7 @@ as close to the original as one can get without causing compiler errors.
To get this to all work the following changes were made. If you really want to
understand this Cody provides the following. First run the following command
from the directory:
-
make diff_orig_prog
+
make diff_orig_prog
and then read the following (you might also wish to look at the code in an
editor with syntax highlighting):
@@ -296,11 +296,11 @@ editor with syntax highlighting):
were actually not what they appear: the only arg that existed in main() was
Manual. Thus it now looks like:
-
main(
-/* C program. (If you don't
- * understand it look it
- * up.) (In the C*/ Manual)
-{
+
main(
+ /* C program. (If you don't
+ * understand it look it
+ * up.) (In the C*/ Manual)
+ {
The macros C and V were changed to lower case. This is because it felt
like the C=" ..’ part in subr() would be better to be upper case as it talks
@@ -318,13 +318,13 @@ in case the first does not. Originally the macros were kept the same and the
case as c.
The code:
-
C="Lint says "argument Manual isn't used." What's that
- mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+
-'\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1));
+
C="Lint says "argument Manual isn't used." What's that
+ mean?"; while (write((read(C_C('"'-'/*"'/*"*/))?__:__-_+
+ '\b'b'\b'|((_-52)%('\b'b'\b'+C_C_('\t'b'\n'))+1),1),&_,1));
while (read(0,&__,1) & write((_=(_=C_C_(__),
+ V))?__:__-_+'\b'b'\b'|((_-52)%('\b'b'\b'+~
+ ' '&'\t'b'\n')+1),1),&_,1))_=c-v+subr(&v));
Note how numerous of the macros (though two changed in case) can still be
used but some cannot be. Can you figure out why? Why too is it that the
subr() function is called but it appears that some of the code in that
@@ -399,14 +399,14 @@ for entertainment!
Cody changed the alt code (which was not the same as the original - see above
for details or try make diff_orig_alt in the directory) slightly so that it
was possible to silence it. In particular:
-
P ( a )char a ;{ a ;while( a >" B "
+
P ( a ) char a ; { a ; while( a > " B "
which gave:
marshall.alt.c:13:55: warning: ordered comparison between pointer and integer ('char' and 'char *')
P ( a ) char a ; { a ; while( a > " B "
~ ^ ~~~~~~~~
1 warning generated.
was changed to:
-
P ( a )char a ;{ a ;while((char*)a >" B "
+
P ( a ) char a ; { a ; while((char *)a > " B "
which gave:
marshall.alt.c:13:48: warning: cast to 'char *' from smaller integer type 'char' [-Wint-to-pointer-cast]
P ( a ) char a ; { a ; while((char *)a > " B "
@@ -435,54 +435,54 @@ below.
work with gcc but it still required -traditional-cpp.
If you’d like to see the difference between the version that requires
-traditional-cpp and the fixed version, try:
-
cd 1986/wall ;make diff_orig_prog
+
cd 1986/wall ; make diff_orig_prog
Some of the changes required:
Instead of using the c_, defined as c_(cc)c cc=, like:
And of course as noted two strings had to be strdup()d.
@@ -562,45 +562,45 @@ as well, however.
First of all, as noted above, the entry required -traditional-cpp (which
not all compilers supportclang does not support). It needed
that option in modern systems because of two things it did:
This macro, a, formed the functions (the names) getuid() and getgid(), but
this no longer works. The code still uses the macro a to form the names but
it’s done differently, using the C token paste operator ##. It’s done like
thus:
-
--- i/1988/dale/dale.c
- +++ w/1988/dale/dale.c
- @@ -9,18 +9,18 @@
- #define L if
- #define I goto
- #define l 1
- #define f write
- #define J else
- -#define a(x)get/***/x/***/id())
- +#define a(x)get##x##id())
+
--- i/1988/dale/dale.c
+ +++ w/1988/dale/dale.c
+ @@ -9,18 +9,18 @@
+ #define L if
+ #define I goto
+ #define l 1
+ #define f write
+ #define J else
+ -#define a(x)get/***/x/***/id())
+ +#define a(x)get##x##id())
The second is that
-
for/*/(;;);/*/k()){O/*/*/c);
+
for/*/(;;);/*/k()){O/*/*/c);
cannot form fork()) in modern C compilers. Since it was not done through a
macro it was simply changed to be fork(), rather than adding a new macro.
The other problem that could not be resolved by the -traditional-cpp was that
modern compilers do not allow directives like:
-
#define _ define
-#_ P char
-#_ p int
-#_ O close(
-/* ... */
+
#define _ define
+ #_ P char
+ #_ p int
+ #_ O close(
+ /* ... */
so Cody changed the lines to be in the form of:
-
#define P char
-#define p int
-#define O close(
-/* ... */
+
#define P char
+ #define p int
+ #define O close(
+ /* ... */
However, to keep the entry as close to as possible in look, Cody kept the _
macro in place it’s just no longer used.
See the index.html file for details on the original code, provided as an alt
@@ -658,21 +658,21 @@ not strictly necessary but nonetheless more correct, even if not warned against.
fubar.sh.
A strange problem occurred where if one made modifications to the C file it
might end up failing to work even after changing it back. This was resolved by:
-
--- i/1989/fubar/fubar.sh
- +++ w/1989/fubar/fubar.sh
- @@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then
- exit 1
- fi
-
- # run/compile it
- rm -f ouroboros.c x1 x
- -ex - <<EOF
- -r fubar.c
- +ex fubar.c <<EOF
- 8,9j
- w ouroboros.c
- EOF
- chmod +x ouroboros.c
+
--- i/1989/fubar/fubar.sh
+ +++ w/1989/fubar/fubar.sh
+ @@ -7,13 +7,12 @@ if [[ $# -ne 1 ]]; then
+ exit 1
+ fi
+
+ # run/compile it
+ rm -f ouroboros.c x1 x
+ -ex - <<EOF
+ -r fubar.c
+ +ex fubar.c <<EOF
+ 8,9j
+ w ouroboros.c
+ EOF
+ chmod +x ouroboros.c
Cody also ‘modernised’ the script to use bash and fixed for ShellCheck. The
if [ .. ] was changed in the C code as well as the script.
Cody fixed this for modern systems. There were two problems to be resolved.
One can no longer do:
-
#define d define
-
-#d b12(x) 12 x
-
-/* etc. */
+
#define d define
+
+ #d b12(x) 12 x
+
+ /* etc. */
so the use of #d is now instead #define (the macro was originally deleted
but later Cody added it back to make it more like the original).
The second problem was suggested by the judges at the time of judging, to do
@@ -904,7 +904,7 @@ again (since it did not work anyway a segfault prevention was added here). He
also fixed some array addressing (some of which might not be strictly necessary
but as he was testing the fibonacci.c bug he ended up changing it anyway).
if (a[1]==NULL||a[2]==NULL||a[3]==NULL||a[4]==NULL||a[5]==NULL) return 1;
be changed to just test the value of A when a is argv and A is argc?
Cody also changed the code to use fgets(3).
Since this program is so incredible the extra fixes were deemed worth having and
@@ -993,21 +993,21 @@ making the generated code return a value from main() rather than ju
changed from char*s to char s[]):
But then there is the matter of getting the C to use fgets(3). As can be seen
above it’s not as simple as changing gets(3) to fgets(3). This was more magic
characters that had to be updated and some added. The C code:
-
atoi(gets(b))
+
atoi(gets(b))
is in the string:
bupj)hfut)c**
which was changed to be (in C):
-
atoi(fgets(b,99,stdin))
+
atoi(fgets(b,99,stdin))
which in the program is:
bupj)ghfut)c-::-tuejo**
That’s fine and well but since the code does not include stdio.h there
@@ -1024,16 +1024,16 @@ the system(q-86) had to be changed to system(q-104).
But then to prevent the need for disabling a warning and to be more correct
code, the generated code was changed to return 1; rather than just return;.
Thus in full the string became:
It is hoped that this is the last time the string has to be updated to work with
all versions of clang but if not the above is how it works.
@@ -1104,16 +1104,16 @@ the change to check for a NULL file was added. Then it was noticed
problem is that adgrep.c was an incorrect reference that never existed and it
was never fixed in any of the files, not the code or the documentation, and thus
was entirely incorrect code. A fun fact is that one can do:
-
W= fopen(wc>= 2 ? V[1] : __FILE__,"rt");if(!W)exit(1);
+ if (W==NULL)exit(1);
because adwc.c will be empty! The difference is it is on a newline, the check.
This is an example of how a simple change in code can break it and this is also
true of another change as further below.
Cody also restored a slightly more obscure line of code that had been changed:
though it’s questionable how much more (if at all) obscure that is :-)
Cody also changed the location that it used gets() to be fgets(3).
This was complicated because of how the other source files are generated (as
@@ -1133,7 +1133,7 @@ removal of the extra line (as in with a comma operator or a &&adwc.c)! Thus after the gets(3) call in the line that looks
like:
one must keep the Y[strlen(Y)-1]='\0'; part and keep it there.
These fixes are complex changes due to the way the program and Makefile generate
the additional tools.
@@ -1305,8 +1305,8 @@ mentioned script on all the data files.
Both Cody and Yusuke fixed this so that it will work with modern systems. Yusuke
provided some fixes of the X code and Cody fixed the C pre-processor directives
so that it would compile. It used to be that you could get away with code like:
-
G int i,j
- K case
+
G int i,j
+ K case
and expect G; to equate to int i, j; (though it’s now a long) and K to mean
case but that’s no longer the case so the offending lines had #define
prepended to them.
@@ -1708,7 +1708,7 @@ larger the resulting program becomes. It can be gigabytes in length if it
doesn’t crash. At this point since the author stated it has no while,
do...while, for, if/else, switch, ?: Cody removed the if statement by
doing:
-
@@ -1732,7 +1732,7 @@ was changed back to the original.)
not exist, it would dereference a NULL pointer and very likely crash or halt and
catch fire :-), preventing the entry from working. Notice how H is a funny
macro defined as:
-
%:define H(x)<st%:%:x##.h>
+
%:define H(x) <st%:%:x##.h>
and yet the FILE * can be called H! This might or might not make sense to
you but if it doesn’t can you figure out why?
Another fix is that previously the program would return 1 if a file failed to
@@ -1928,9 +1928,9 @@ was supposed to do; instead it reported text file busy error.
Notice that the location of munmap() and close() followed by execv()does
matter!
To get this to compile with clang, main() had to change from:
-
main (char*ck,char**k)
+
main (char *ck, char **k)
to:
-
main (int cka,char**k){char*ck =(char*)cka;/* ... */}
The following change was also made to be more portable, in case the constants
PROT_READ and/or PROT_WRITE are not standardised or some platform does not
follow it:
@@ -1939,16 +1939,16 @@ follow it:
macOS and Linux).
NOTE: there might be educational value to see the progress of this fix; if you
wish to see, try the following commands from the 2001/anonymous directory:
Cody added a value to return in main() to make it more portable.
Cody fixed this to compile with clang in Linux. The problem was C99 does not
support implicit int:
-
coupard.c:31:10: error: parameter 'h' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int[-Wimplicit-int]
-void e(n,h){
-^
- coupard.c:31:8: error: parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int[-Wimplicit-int]
-void e(n,h){
-^
+
coupard.c:31:10: error: parameter 'h' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
+ void e(n,h){
+ ^
+ coupard.c:31:8: error: parameter 'n' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
+ void e(n,h){
+ ^
and for some reason it was being reported as an error. This was not really worth
a thanks per se but it was originally done by adding int. The better solution
is to disable the warning which is what was done later on to make it more like
@@ -2156,20 +2156,20 @@ Wayback Machine.
Cody fixed this to compile with gcc (it worked with clang). The problem was the
cpp being unable to parse the generated code (see the index.html for details) and
this ended up with a number of errors like:
-
jdalbec.c:64:5: error: stray '##' in program
-64| B N##B (I); \
-|^~
-
-
-..
-
- jdalbec.c:65:5: error: stray '##' in program
-65| V F##B (B); \
-|^~
- jdalbec.c:65:5: error: expected ';' before 'B'
-65| V F##B (B); \
-|^~
-|;
+
jdalbec.c:64:5: error: stray '##' in program
+ 64 | B N##B (I) ; \
+ | ^~
+
+
+ ..
+
+ jdalbec.c:65:5: error: stray '##' in program
+ 65 | V F##B (B) ; \
+ | ^~
+ jdalbec.c:65:5: error: expected ';' before 'B'
+ 65 | V F##B (B) ; \
+ | ^ ~
+ | ;
and various other problems.
Cody also added alt code which allows
one to control how many numbers after the : to print before printing a
@@ -2209,41 +2209,41 @@ to the repo for the script instead.
Cody fixed this to compile in Linux. Although it compiled cleanly in macOS (and
BSD?) the code failed to compile at all in Linux due to:
-
cc -E vik2_1.c > vik2_2.c
- In file included from vik2.c:945,
- from vik2.c:959,
- from vik2.c:972,
- from vik2.c:1025:
- vik2.c:383:8: error: no macro name given in #ifdef directive
-383| O \
-|^
- In file included from vik2.c:946:
- vik2.c:383:8: error: no macro name given in #ifdef directive
-383| O \
-|^
- In file included from vik2.c:947:
- vik2.c:383:8: error: no macro name given in #ifdef directive
-383| O \
-|^
- In file included from vik2.c:948:
- vik2.c:383:8: error: no macro name given in #ifdef directive
-383| O \
-|^
-
-...
-
- In file included from vik2.c:182:
-
- vik2.c:992:85: error: #include nested depth 201 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
-992| I
-|^
- vik2.c:1497:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- vik2.c:1498:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- vik2.c:1499:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- vik2.c:1500:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- vik2.c:1501:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- vik2.c:1504:21: error: #include nested depth 200 exceeds maximum of 200(use -fmax-include-depth=DEPTH to increase the maximum)
- make:***[Makefile:133: vik2] Error 1
+
cc -E vik2_1.c > vik2_2.c
+ In file included from vik2.c:945,
+ from vik2.c:959,
+ from vik2.c:972,
+ from vik2.c:1025:
+ vik2.c:383:8: error: no macro name given in #ifdef directive
+ 383 | O \
+ | ^
+ In file included from vik2.c:946:
+ vik2.c:383:8: error: no macro name given in #ifdef directive
+ 383 | O \
+ | ^
+ In file included from vik2.c:947:
+ vik2.c:383:8: error: no macro name given in #ifdef directive
+ 383 | O \
+ | ^
+ In file included from vik2.c:948:
+ vik2.c:383:8: error: no macro name given in #ifdef directive
+ 383 | O \
+ | ^
+
+ ...
+
+ In file included from vik2.c:182:
+
+ vik2.c:992:85: error: #include nested depth 201 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ 992 | I
+ | ^
+ vik2.c:1497:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ vik2.c:1498:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ vik2.c:1499:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ vik2.c:1500:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ vik2.c:1501:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ vik2.c:1504:21: error: #include nested depth 200 exceeds maximum of 200 (use -fmax-include-depth=DEPTH to increase the maximum)
+ make: *** [Makefile:133: vik2] Error 1
Unfortunately the fix required heavy modification to the original file (see
below) and also inclusion of what used to be generated by the
Makefile but now it at least works for both Linux and
@@ -2294,7 +2294,7 @@ and 64-bit. The solution has to do with the size difference between intlong so that the long*E is now int*E. This solves a specific problem for
Linux (32-bit, 64-bit) and macOS (arm64).
To get the self-test feature to work it was required to remove from the code:
-
O-b-f-u -s-c-a-t-e;
+
O-b-f-u -s-c-a-t-e;
as it caused a compilation error in some of the generated code but served no
purpose, didn’t affect the output of the puzzle and since the ‘string’ is
already in the code there is no problem omitting it.
@@ -2305,19 +2305,19 @@ also not have been necessary if using different flags to cc but thi
portable and caused other problems. This was a complicated fix as it’s in the
comments but in a funny way; the final result to get the test feature to work
is:
-
Cody also added the try.sh script which also lets one see
the beauty of the entry without having to use vi(m), should they be afraid of
getting stuck in it (and for ease of use). :-)
@@ -2335,12 +2335,12 @@ not do it implicitly (like macOS does).
Cody fixed this to work in Linux. The problem was an unknown escape sequence,
\N, which caused a funny compiler error:
-
};n b[2048];int i
- mikeash.c: In function 'R':
- mikeash.c:7:1: error:'\N' not followed by '{'
-7|;C!='\n';A()
-|^
- mikeash.c:7:1: error: incomplete universal character name \Ne
+
};n b[2048];int i
+ mikeash.c: In function 'R':
+ mikeash.c:7:1: error: '\N' not followed by '{'
+ 7 | ;C!='\n';A()
+ | ^
+ mikeash.c:7:1: error: incomplete universal character name \Ne
The problem was that in the string above there was a \Newline but this is
invalid C. This was changed to be \nNewline and then, because the code is
supposed to output itself when fed itself, the reference to 'N' had to be
@@ -2370,7 +2370,7 @@ test it on.
Cody added the saved (with the SAVE command) BASIC program PET which was:
-
10 PRINT "2005'S IOCCC BEST EMULATOR"
+
10 PRINT "2005'S IOCCC BEST EMULATOR"
20 PRINT "BY STEPHEN SYKES!"
followed by the commands:
SAVE "PET"
@@ -2799,12 +2799,12 @@ might violate rule 2: the program is really just a decompressor to generate the
real source of the program. So the source of the entry has to be compiled and
then run, and the output has to be compiled to be hou. This allows the real
program to be used. Thus the Makefile rule looks like:
-
The LDFLAGS were updated to have -lm as the author suggested it uses the
math.h library which not all systems link in by default (Linux for instance
does not).
@@ -2925,12 +2925,12 @@ output.
Cody fixed the code so one can make use of the echo feature, where the
first character of the filename starts with e. The only way it would work
before that is if one did something like:
-
ln-sf prog eprog
-PATH=$PATH:. ;eprog'...'
+
ln -sf prog eprog
+ PATH=$PATH:. ; eprog '...'
since otherwise the first character would not be e but rather a dot
(./eprog). This was done by adding to the Makefile -include libgen.h and
adding to main() after the variable declaration (V*A;) the code:
-
*K=basename(*K);
+
*K=basename(*K);
This was done for both the prog.c and
prog.alt.c. The Makefile was also updated to build
eprog and eprog.alt to make use of the feature more easily. Each is a new
@@ -3241,8 +3241,8 @@ longer known.