Merge pull request #368 from xexyl/1990-jaw-typos

Check 1990/jaw/README.md for typos
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-04-09 13:39:15 -07:00
commit 21d09ad649
21 files changed
+755 -547

No files matched your search

+8 -7
View File
@@ -1,11 +1,12 @@
.*.sw[a-z]
.sw[a-z]
.sv[a-z]
.*.sv[a-z]
*.dSYM
*.bak *.bak
*.bku *.bku
*.dSYM
.*.sv[a-z]
.*.sw[a-z]
.DS_Store .DS_Store
.sv[a-z]
.sw[a-z]
/NOTES
/archive/1984/ /archive/1984/
/archive/1985/ /archive/1985/
/archive/1986/ /archive/1986/
@@ -35,6 +36,6 @@
/archive/2020/ /archive/2020/
/bugs.html /bugs.html
/faq.html /faq.html
mkentry
/NOTES
iocccsize iocccsize
mkentry
readme.html
+2 -2
View File
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ALT_TARGET= ${PROG}.alt
################# #################
+69 -41
View File
@@ -1,25 +1,59 @@
# Best Small Program # Best Small Program
Doron Osovlanski Baruch Nissenbaum
CADTECH - CAD/CAM Systems Ltd Tel-Aviv University
24 Ben-Yosef st. The Faculty of Engineering
Givat-Shmuel 51905 Tel-Aviv
Israel Israel
Baruch Nissenbaum Doron Osovlanski
Tel-Aviv University CADTECH - CAD/CAM Systems Ltd
The Faculty of Engineering 24 Ben-Yosef St.
Tel-Aviv Givat-Shmuel 51905
Israel Israel
## To build: ## To build:
make all ```sh
make all
```
## To run: ## To run:
echo 4 | ./baruch ```sh
echo 7 | ./baruch echo 4 | ./baruch
echo 7 | ./baruch
```
## Try:
```sh
echo 2 | ./baruch
echo 3 | ./baruch
```
Why is there no output?
### Alternate code:
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) provided alternate code
for users using Turbo-C or MSC, based on the authors' comments below, except
that he did not change the `" #Q"` string as that showed worse looking output
instead of improved output though he has no way to test the compilers in
question. YMMV. Thank you Cody (though we all think <strike>[no
one](https://en.wiktionary.org/wiki/no_one#Pronoun)</strike> [very
few](https://en.wikipedia.org/wiki/0)
[users](https://en.wikipedia.org/wiki/Microsoft_Windows)
[here](https://www.ioccc.org) will need it :-) )!
To compile:
```sh
make alt
```
Use `baruch.alt` as you would `baruch`.
## Judges' comments: ## Judges' comments:
@@ -30,44 +64,38 @@ added a final newline to the file to make unpacking easy.
## Authors' comments: ## Authors' comments:
The goal of this work was to write a program that solves the The goal of this work was to write a program that solves the classic [n-queens
classic n-queen problem, with a board size of up to 99x99, while problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle), with a board size
keeping the program as short as possible. of up to 99x99, while keeping the program as short as possible.
The program finds all possibilities to place N chess queens on The program finds all possibilities to place N chess queens on a NxN
a NxN chess board so that no queen is in range of any other queen [chessboard](https://en.wikipedia.org/wiki/Chessboard) so that no queen is in
(not in the same column row or diagonal). For each solution the range of any other queen (not in the same column row or diagonal). For each
chess board and the place of the queens is printed to stdout. solution the chess board and the place of the queens is printed to stdout.
This program is about as simple and as readable as possible. To make things
even more simple we used a very limited subset of C:
This program is about as simple and as readable as possible. - No pre-processor statements
To make things even more simple we used a very limited subset of C: - Only one, harmless, `for` statement
- No `if`s
No pre-processor statements - No `break`s
Only one, harmless, 'for' statement - No `case`s
No ifs - No functions outside the standard C library
No breaks - No `goto`s
No cases - No structures
No functions
No gotos
No structures
In short, it contains no C language that might confuse the
innocent reader. :-)
In short, it contains no C language that might confuse the innocent reader. :-)
This program demonstrates the claim that in C, any program This program demonstrates the claim that in C, any program
can be written using a single 'for' statement, as long as it is can be written using a single 'for' statement, as long as it is
long enough.. long enough..
The authors' further note: ### For PC users:
For PC users: In order to compile the program under Turbo-C or MSC, `'int '` should be inserted
at the beginning of the program. For better looking results it is recommended
In order to compile the program under Turbo-C or MSC, 'int ' to replace the `" #Q"` string with `" \261\2"`.
should be inserted at the beginning of the program.
For better looking results it is recommended to replace the " #Q"
string with " \261\2".
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+1 -1
View File
@@ -2,5 +2,5 @@ int v,i,j,k,l,s,a[99];
main() main()
{ {
for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i]) for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i])
; ;puts("");
} }
+17 -21
View File
@@ -1,10 +1,10 @@
# Best Game # Best Game
Chris Mills Chris Mills
Wyse Technology Wyse Technology
3471 N. 1st St. 3471 N. 1st St.
San Jose CA 95134 San Jose CA 95134
USA USA
## To build: ## To build:
@@ -24,7 +24,7 @@ for your assistance!
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this safer by [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this safer by
using `fgets()` instead of `gets()`. This avoids a potentially alarming warning using `fgets()` instead of `gets()`. This avoids a potentially alarming warning
at linking or runtime. Thank you Cody for your assistance! at compiling and/or linking and/or runtime. Thank you Cody for your assistance!
For the original code see the [1992 archive](/archive/archive-1990.tar.bz2). For the original code see the [1992 archive](/archive/archive-1990.tar.bz2).
@@ -42,29 +42,25 @@ For the original code see the [1992 archive](/archive/archive-1990.tar.bz2).
The Makefile uses several `-D` defines. The following is is a list of the macros The Makefile uses several `-D` defines. The following is is a list of the macros
that may be changed: that may be changed:
-DM=<max bet allowed> - `-DM=<max bet allowed>`
-DN=<52 * number of decks used> - `-DN=<52 * number of decks used>`
-DX=<how to seed the rand() generator> - `-DX=<how to seed the rand() generator>`
The macro `V` should remain `void`. The macro `V` should remain `void`.
## Author's comments: ## Author's comments:
This is a blackjack program. It does splits, doubling down, This is a blackjack program. It does splits, doubling down, insurance, etc.
insurance, etc.
As best I can figure, it should be ANSI-compliant, as well as As best I can figure, it should be ANSI-compliant, as well as portable to BSD &
portable to BSD & sysV (as well as the irritating compiler I SysV (as well as the irritating compiler I was using which assumes `x=*p++`
was using which assumes `x=*p++` means `x*=p++`!). It is means `x*=p++`!). It is reasonably robust in its error handling---it won't let
reasonably robust in its error handling---it won't let you you split, double, etc. unless you actually have the cash, etc. To terminate
split, double, etc. unless you actually have the cash, etc. To the program, hit EOF or type 0 or a negative number for you wager.
terminate the program, hit EOF or type 0 or a negative number
for you wager.
The way it deals with splits is particularly cool (IMHO). You The way it deals with splits is particularly cool (IMHO). You can split many
can split many times, and it will show all hands as they are times, and it will show all hands as they are played.
played.
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
-30
View File
@@ -1,30 +0,0 @@
#include<stdio.h>
#include<time.h>
#define S(q)B(*e=0),q,p);
#define W(w)if((w)<22)v= -v;else v-=10;else
#define F for(r=d;r<d+N;
#define H(v,g)v=h(v,*g++= *r++),*g=0;
#define B(n)b(l,n),(V)printf(l
V
exit();char*g,c[M],d[N],q[N],p[N],*e,*r=d+N,l[M],t[]="??",*k,*m="DEATHISDSev2oinpohae3ttsluuln4a?uibfe 5l\0rtlfrb6 ?a?el:e7$!n\0?e t8%ccp\0.%s9deelc.s T.@?-t.\t<J /\0=a\nP=Q Sex \0l KW Sin a$\0ane-lay% ge#-slediefuk ar r$via-:o ?+}:r? n \0:) ee%lone 1-esy666!-~v\n.!^`'~@#\0\np~===:=q";b(o,n)char*o;{for(k=n+m;*o++=*k;k+=9);}int
y=M*2,v,x,s,f,j,o;u(s){B(s));if(!gets(l))exit(0);return(o=
*l)=='y'||o=='Y'||o!='n'&&o!='N'&&u(s);}h(v,m){for(k=c;*k!='J';)if(m==*k++)break;m=k-c;if(v<0)W(v=m-v)
if(m==1)W(v+=11)
v+=m;return
v;}main(w,z)char**z;{b(c,2)*X;for(--w&&(y=atoi(1[z]));y>1;){if(r-d>N*3/4){B(8));F++r)*r=c[(r-d)%13];F)w=
*(g=d+rand()%N),*g=
*r,*r++=w;r=d;}for(;;){B(3),y);if(!gets(l)||(w=atoi(l))<1)exit(0);if(w&1||w>M||w>y)B(1),y<M?y:M);else
break;}y-=w,s=f=j=x=v=0,g=q,e=p;H(x,g)H(x,g)H(v,e)H(v,e)*t=
*q;S(t)*q=='A'&&y>=w/2&&u(5)&&(y+=(3*(h(0,1[q])==10)-1)*w/2);if(x==-21)goto
_;if(v==-21){y+=w/2;goto
_;}while(x>-17&&x<17)H(x,g)while((v==20||*p==-1[e])&&y>=w&&u(6)){y-=w;++s;for(g=e++;2[g]=
*g,g!=p;)--g;*g++=
*e;*g=' ';i:v=h(h(0,*p),*e++=
*r++);S(t)if(*p=='A'&&-1[e]!=
*p)goto
_;}if(f=y>=w&&u(7))y-=w,H(v,e)while(!f&&v<22&&u(4)){H(v,e)if(v<22)S(t)}_:x<0&&(x=
-x);v<0&&(v=
-v);if(v<22)if(v==x)j+=w*++f;else
if(x>21||v>x)j+=w*2*++f;if(s--){*e++=' ';*e++=
*p;*e=0;for(e=p;*e=2[e];)e++;goto
i;}y+=j;S(q)};}
+70 -60
View File
@@ -1,10 +1,10 @@
# Best Language Tool # Best Language Tool
Diomidis Spinellis Diomidis Spinellis
Imperial College, University of London Imperial College, University of London
Myrsinis 1 Myrsinis 1
GR-145 62 Kifissia GR-145 62 Kifissia
Greece Greece
## To build: ## To build:
@@ -16,26 +16,28 @@ you Yusuke!
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) removed the erroneous [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) removed the erroneous
prototype to `fopen()` and made this use `fgets()` instead of `gets()` to make prototype to `fopen()` and made this use `fgets()` instead of `gets()` to make
it safer and to prevent a potentially alarming warning at linking or runtime. it safer and to prevent a potentially alarming warning at compiling and/or
Thank you Cody for your assistance! linking and/or runtime. Thank you Cody for your assistance!
## To run ## To run
./dds ```sh
./dds
```
## Try: ## Try:
Give the following lines as input: Give the following lines as input:
OLD LANDER.BAS ```
RUN OLD LANDER.BAS
RUN
```
NOTE: this is case sensitive. NOTE: this is case sensitive.
## Judges' comments: ## Judges' comments:
Be sure not to run out of fuel! Be sure not to run out of fuel!
@@ -43,40 +45,53 @@ Be sure not to run out of fuel!
This is the DDS-BASIC Interpreter (Version 1.00). This is the DDS-BASIC Interpreter (Version 1.00).
Immediate commands: ### Immediate commands:
RUN LIST NEW OLD filename - RUN
BYE SAVE filename - LIST
- NEW
- OLD filename
- BYE
- SAVE filename
Program commands: ### Program commands:
variable names a to z variables initialized to 0 on RUN - variable names a to z
FOR var = exp TO exp NEXT variable - variables initialized to 0 on RUN
GOSUB exp RETURN - FOR var = exp TO exp
GOTO exp IF exp THEN exp - NEXT variable
INPUT variable PRINT string - GOSUB exp
PRINT exp var = exp - RETURN
REM any text END - GOTO exp
- IF exp THEN exp
- INPUT variable
- PRINT string
- PRINT exp
- var = exp
- REM any text
- END
Expressions (ranked by precedence): ### Expressions (ranked by precedence):
Bracketed expressions - Bracketed expressions
number (leading 0 for octal, 0x for hex, else decimal), variable - number (leading 0 for octal, 0x for hex, else decimal), variable
Unary - - Unary -
* / - `*` `/`
+ - - `+` `-`
= <> - `=` `<>`
> < - `>` `<`
<= >= - `<=` `>=`
(* and + are also used for boolean AND and boolean OR)
Boolean expressions evaluate to 0 for false and 1 for true
Editing: (`*` and `+` are also used for boolean AND and boolean OR)
Boolean expressions evaluate to 0 for false and 1 for true.
### Editing:
- Line editor using line re-entry. - Line editor using line re-entry.
- A line number with nothing following it, deletes the line. - A line number with nothing following it, deletes the line.
Input format: ### Input format:
- Free format positioning of tokens on the line. - Free format positioning of tokens on the line.
- No space is allowed before the line number. - No space is allowed before the line number.
@@ -85,38 +100,33 @@ Input format:
- ALL INPUT MUST BE UPPERCASE. - ALL INPUT MUST BE UPPERCASE.
Limits: ### Limits:
Line numbers 1-10000 - Line numbers 1-10000
Line length 999 characters - Line length 999 characters
FOR nesting 26 - FOR nesting 26
GOSUB 999 levels - GOSUB 999 levels
Program Dynamically allocated - Program Dynamically allocated
Expressions -32768 - 32767 for 16 bit machines, - Expressions -32768 - 32767 for 16 bit machines, -2147483648 - 2147483647 for 32 bit machines
-2147483648 - 2147483647 for 32 bit machines
Error checking / error reports:
### Error checking / error reports:
No error checking is performed. No error checking is performed.
It might dump core if a syntax or semantic error is encountered. It might dump core if a syntax or semantic error is encountered.
### Hosting Environment:
Hosting Environment: ANSI C, traditional K&R C or OSF ANDF ASCII or EBCIDIC character set 48K bytes
memory.
ANSI C, traditional K&R C or OSF ANDF The Speed of DDS-BASIC Interpreter (Version 1.00) relative to Microsoft Advanced
ASCII or EBCIDIC character set BASIC 3.31 is approximately 60%.
48K bytes memory
The Speed of DDS-BASIC Interpreter (Version 1.00). relative to The code size could be further reduced by doing ugly things like not declaring
Microsoft Advanced BASIC 3.31 is Approximately 60%. the return type of functions, not freeing memory, #defining define, and joining
lines. In its present 1536 character form the program is reasonably portable
The code size could be further reduced by doing ugly things like (it may fail to run in a tagged object architecture) and nicely formatted (it
not declaring the return type of functions, not freeing memory, fits in an `80*25` screen).
#defining define, and joining lines. In its present 1536 character
form the program is reasonably portable (it may fail to run in a
tagged object architecture) and nicely formatted (it fits in an
80*25 screen).
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+24 -15
View File
@@ -1,44 +1,53 @@
# Best Abuse of the C Preprocessor # Best Abuse of the C Preprocessor
David Goodenough David Goodenough
anonymous organization anonymous organization
541 Commonwealth Ave, 541 Commonwealth Ave
Newton, MA 02159 Newton, MA 02159
USA USA
## To build: ## To build:
make all ```sh
make all
```
## To run: ## To run:
echo foo bar | ./dg ```sh
echo foo bar | ./dg
```
## Try: ## Try:
echo "to C or not to C" | ./dg ```sh
echo "to C or not to C" | ./dg
```
## Judges' comments: ## Judges' comments:
Some C preprocessors got confused about single quotes in certain cases. Some C preprocessors got confused about single quotes in certain cases.
In particular, the following source line: In particular, the following source line:
b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A)))))))))))))))))))))))))))))) ```c
b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
```
sometimes has to be changed to: sometimes has to be changed to:
b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A')))))))))))))))))))))))))))) ```c
b12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
```
if the C preprocessor botches single quotes in cpp expansions, which we have particularly if the C preprocessor botches single quotes in cpp expansions,
done for the wider audience. which we have done for the wider audience.
## Author's comments: ## Author's comments:
If my preprocessor could hack it, I could write this as one single If my preprocessor could hack it, I could write this as one single line rather
line rather than 4, but when I do that I get a complaint "defines than 4, but when I do that I get a complaint "defines nested too deeply".
nested too deeply".
Spoiler: (rot13 to read) Spoiler: (rot13 to read)
+141 -138
View File
@@ -1,28 +1,29 @@
# Best Entropy-reducer # Best Entropy-reducer
James A. Woods James A. Woods
Research Institute for Advanced Computer Science Research Institute for Advanced Computer Science
MS 230-5 MS 230-5
NASA Ames Research Center NASA Ames Research Center
Moffett Field, CA 94131 Moffett Field, CA 94131
USA USA
Karl F. Fox Karl F. Fox
Morning Star Technologies, Inc. Morning Star Technologies, Inc.
1760 Zollinger Road 1760 Zollinger Road
Columbus, OH 43221 Columbus, OH 43221
USA USA
Paul Eggert Paul Eggert
Twin Sun Inc. Twin Sun Inc.
360 N. Sepulveda Blvd. #2055 360 N. Sepulveda Blvd. #2055
El Segundo, CA 90245 El Segundo, CA 90245
USA USA
## To build: ## To build:
make all ```sh
make all
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed the script to [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed the script to
work properly in modern environments (to do with PATH not having '.' in it). He work properly in modern environments (to do with PATH not having '.' in it). He
@@ -40,122 +41,125 @@ Endoh](/winners.html#Yusuke_Endoh). Thank you Yusuke for your implementation of
To test the official C entry, one might try: To test the official C entry, one might try:
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw ```sh
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
which should apply the identity transformation to a minimal ```
holoalphabetic sentence.
NOTE: Cody notes the above will not work under macOS. The `sh shark.sh jaw.*
README.md > receive` and following commands below do work with macOS after the
fixes he made.
which should apply the identity transformation to a minimal holoalphabetic
sentence.
## Judges' comments: ## Judges' comments:
The program, in its base form, implements two useful utilities: The program, in its base form, implements two useful utilities:
atob - ascii to binary conversion
zcat - decompression filter
Included with this entry is a shell script (with comments edited down - `atob` - ascii to binary conversion
to reduce it to 1530 bytes) which implements the complete - `zcat` - decompression filter
shark utility. The script, shark.sh, contains a 'jaw.c' embedded
within it! Included with this entry is a shell script (with comments edited down to reduce
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: The sender must have `compress` and `btoa`. To send, try:
sh shark.sh jaw.* README.md > receive ```sh
sh shark.sh jaw.* README.md > receive
```
The resulting file, 'receive', unpacks the input files The resulting file, `receive`, unpacks the input files
even if the receiver lacks `uncompress` and `btoa`: even if the receiver lacks `uncompress` and `btoa`:
mkdir -p test ```sh
cd test mkdir -p test
sh ../receive cd test
cmp ../jaw.c jaw.c sh ../receive
cmp ../README.md README.md cmp ../jaw.c jaw.c
cmp ../README.md README.md
```
## Authors' comments: ## Authors' comments:
ABSTRACT ### ABSTRACT
Minimal, Universal File Bundling #### Minimal, Universal File Bundling (or, Functional Obfuscation in a Self-Decoding Unix Shell Archive)
(or, Functional Obfuscation in a Self-Decoding Unix Shell Archive)
James A. Woods
Universities Space Research Association
NASA Ames Research Center
James A. Woods ---
Universities Space Research Association
NASA Ames Research Center
> "Use an algorithm, go to jail."
>
> -- anon., circa 1988, pre-Morris worm era
"Use an algorithm, go to jail." ----
[anon., circa 1988, pre-Morris worm era]
Myriad formats have been proposed for network-mailable data. A major difficulty
undermining the popularity of most file/message bundlers is that the sender
assumes prior installation of the computational dual of such bundling software
by the receiver. Command shell archives alleviate this problem somewhat, but
still require standardization for the function of data compression and
mail-transparency encoding. On Unix, these coding format quandaries are overcome
by planting a novel Trojan Horse in the archive header to perform
negotiation-less decoding.
Myriad formats have been proposed for network-mailable Specifically, we outline the development of an extraordinarily compact portable
data. A major difficulty undermining the popularity of most (un)bundler to (dis)assemble data-compressed, binary-to-ASCII-converted,
file/message bundlers is that the sender assumes prior length-split, and checksummed directory structures using standard Unix tools.
installation of the computational dual of such bundling Miniature versions of counterparts to a Lempel-Ziv coder (`compress` or
software by the receiver. Command shell archives alleviate `squeeze`) and an efficient bit packetizer (`btoa`) are compiled on-the-fly at
this problem somewhat, but still require standardization for mail destination sites where they may not already exist. These are written in
the function of data compression and mail-transparency purposefully obfuscated-C to accompany similarly-shrunk shell command glue. This
encoding. On Unix, these coding format quandaries are over- resulting shell archiver is dubbed `shark`.
come by planting a novel Trojan Horse in the archive header
to perform negotiation-less decoding.
Specifically, we outline the development of an extraordinarily compact `shark` procedure overhead consumes as few as three dozen shell lines (or
portable (un)bundler to (dis)assemble data-compressed, `~1100` bytes), commensurate with the size of many Internet mail headers; it
binary-to-ASCII-converted, length-split, and checksummed directory structures amortizes favorably with message size. `shark` is portable across Unix
using standard Unix tools. Miniature versions of counterparts to a Lempel-Ziv
coder ('compress' or 'squeeze') and an efficient bit packet- izer ('btoa') are
compiled on-the-fly at mail destination sites where they may not already
exist. These are written in purposefully obfuscated-C to accompany
similarly-shrunk shell command glue. This resulting shell archiver is dubbed
'shark'.
'Shark' procedure overhead consumes as few as three dozen shell lines (or
~1100 bytes), commensurate with the size of many Internet mail headers; it
amortizes favorably with message size. 'Shark' is portable across Unix
variants, while the underlying technique is inherently generalizable to other variants, while the underlying technique is inherently generalizable to other
encoding schemes. encoding schemes.
In the function-theoretic sense of minimal In the function-theoretic sense of minimal Chaitin/Kolmogorov complexity, and
Chaitin/Kolmogorov complexity, and within a modified Shannon within a modified Shannon model of communication, the 'shark' effort aims to
model of communication, the 'shark' effort aims to construct construct a "shortest program" for source decoding in the Turing-universal Unix
a "shortest program" for source decoding in the Turing- environment.
universal Unix environment.
---------------------------------------------- ----------------------------------------------
Oh, the shark has pretty teeth, dear-- > Oh, the shark has pretty teeth, dear--
And he shows them pearly white > And he shows them pearly white
Just a jackknife has Macheath, dear-- > Just a jackknife has Macheath, dear--
And he keeps it out of sight. > And he keeps it out of sight.
>
[Bertolt Brecht, Threepenny Opera] > -- Bertolt Brecht, Threepenny Opera
---------------------------------------------- ----------------------------------------------
### Portability:
We have ported this program to a wide variety of systems. Among We have ported this program to a wide variety of systems. Among
these are: these are:
SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1') - SunOS 4.1 / Sun SPARCstation 1 (using both 'cc' and 'gcc 1.37.1')
SunOS 4.0.3 / Sun 3 - SunOS 4.0.3 / Sun 3
BSD 4.3 / VAX 8650 - BSD 4.3 / VAX 8650
SEIUX / Sumitomo Electric Ustation/S - SEIUX / Sumitomo Electric Ustation/S
Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD) - Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD)
System V.? / Hitachi 2050 - System V.? / Hitachi 2050
System V.? / NEC EWS 4800 - System V.? / NEC EWS 4800
UNIOS-B / Omron Luna - UNIOS-B / Omron Luna
Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36') - Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36')
Unicos / Cray 2 - Unicos / Cray 2
### Obfuscation:
We (the authors) feel this program is obfuscated for the We (the authors) feel this program is obfuscated for the
following reasons: following reasons:
0. This is one of the few programs you'll see WHOSE VERY UTILITY DEPENDS ON ITS 0. This is one of the few programs you'll see _WHOSE VERY UTILITY DEPENDS ON ITS
OBFUSCATION! OBFUSCATION_!
1. The contest entry may be used to send its wonderful self to anyone in the 1. The contest entry may be used to send its wonderful self to anyone in the
Unix world! Virus writers need not apply... Unix world! Virus writers need not apply...
@@ -164,74 +168,73 @@ Unix world! Virus writers need not apply...
kindness of our hearts (as well as to maintain eligibility for the large IOCCC kindness of our hearts (as well as to maintain eligibility for the large IOCCC
prize fund), dedicated to the public domain. Claude Shannon, meet Alan Turing. prize fund), dedicated to the public domain. Claude Shannon, meet Alan Turing.
3. Meta-obfuscation is via obfuscated description (see ABSTRACT). 3. Meta-obfuscation is via obfuscated description (see _ABSTRACT_).
4. "Literary" allusion. Production code contains a reference to self-reference, 4. "Literary" allusion. Production code contains a reference to self-reference,
preserved at amazing cost for sheer perversity. preserved at amazing cost for sheer perversity.
5. Many, many micro obfuscations below, honed over three years time, in shell as 5. Many, many micro obfuscations below, honed over three years time, in shell as
well as C. Ask about the 'tar' pit escape, the argv[0] flip, Paul's &4294967295 well as C. Ask about the 'tar' pit escape, the `argv[0]` flip, Paul's
portability hack, the "void where prohibited by flaw" fix, the scanf() `&4294967295` portability hack, the "void where prohibited by flaw" fix, the
spacesaver, shift shenanigans, signal madness, exit()ing stage left, and `scanf()` space-saver, shift shenanigans, signal madness, `exit()`ing stage
source-to-source transformations galore. left, and source-to-source transformations galore.
For extra credit: ### For extra credit:
Construct 'sharkmail', to auto-split sharkives into mailable Construct `sharkmail`, to auto-split `sharkives` into mailable segments and mail
segments and mail them. Here's a simple one, which could be them. Here's a simple one, which could be extended to enable auto-reassembly
extended to enable auto-reassembly with one shell cmd at the with one shell cmd at the far end.
far end.
------------------------ cut here for sharkmail ----------------------- ```sh
#!/bin/sh #!/bin/sh
m=$1; shift m=$1; shift
shark $* | split -800 - /tmp/shark$$ shark $* | split -800 - /tmp/shark$$
n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'` n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
p=0 p=0
for f in `ls /tmp/shark$$*` for f in `ls /tmp/shark$$*`
do do
p=`expr $p + 1` p=`expr $p + 1`
mail -s "bundle ($p of $n) from '`whoami`'" $m < $f mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
done done
rm /tmp/shark$$* rm /tmp/shark$$*
------------------------ end of sharkmail ----------------------------- ```
Shark history: ### Shark history:
May 1987: Karl Fox introduces 1023-byte zcat.c to USENET. - May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
It's too late for the 4th IOCCC. It's too late for the 4th IOCCC.
May 21, 1987: James A. Woods extends idea to construct self - May 21, 1987: James A. Woods extends idea to construct self
decompressing shar Trojan horse, utilizing 'cc', 'shar', decompressing shar Trojan horse, utilizing 'cc', 'shar',
'zcat', & 'btoa'; size: 2303 bytes. 'zcat', & 'btoa'; size: 2303 bytes.
May 23, 1987: 'jaw' trims 250 bytes without much thought. - May 23, 1987: 'jaw' trims 250 bytes without much thought.
June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar', - June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar',
short-circuit C-compile at far end, dual-use main.c, short-circuit C-compile at far end, dual-use main.c,
portability mods. (jaw) portability mods. (jaw)
Mar-May 1988: abortive run at 5th IOCCC. - Mar-May 1988: abortive run at 5th IOCCC.
jaw.c - 1529 bytes. compile line: 152 bytes. jaw.c - 1529 bytes. compile line: 152 bytes.
generated funny code with execvp() to invoke shell. generated funny code with execvp() to invoke shell.
Aug 29, 1988: production version, now at 1830 bytes. - Aug 29, 1988: production version, now at 1830 bytes.
Jan 1990: Paul Eggert does tour-de-force shark re-engineering. - Jan 1990: Paul Eggert does tour-de-force shark re-engineering.
May 24, 1990: collaboration yields 999-byte jaw.c core (see above) - May 24, 1990: collaboration yields 999-byte jaw.c core (see above)
and 1530-byte production shell code (w/comments). and 1530-byte production shell code (w/comments).
Eggert comes through with lion's share of improvements. Eggert comes through with lion's share of improvements.
7th IOCCC code now faster than the btoa/zcat it replaces. 7th IOCCC code now faster than the btoa/zcat it replaces.
May 1990: 'jaw' develops experimental replacement using - May 1990: 'jaw' develops experimental replacement using
Dan Bernstein's high-compression 'squeeze'. Dan Bernstein's high-compression 'squeeze'.
To which we add: To which we add:
June 1990: 'shark' wins the IOCCC, finally! :-) - June 1990: 'shark' wins the IOCCC, finally! :-)
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+26 -20
View File
@@ -1,20 +1,24 @@
# Most Unusual Data Structure # Most Unusual Data Structure
Peter J Ruczynski. Peter J Ruczynski
Pyramid Technology Ltd. Pyramid Technology Ltd.
Pyramid House, Pyramid House
Solatron Road Solatron Road
Farnborough. Farnborough
Hants GU14 7PL Hants GU14 7PL
England, U.K. England, U.K.
## To build: ## To build:
make all ```sh
make all
```
## To run: ## To run:
./pjr ```sh
./pjr
```
## Judges' comments: ## Judges' comments:
@@ -24,26 +28,28 @@ it is done?
By use of pointers to functions returning a struct of pointers By use of pointers to functions returning a struct of pointers
to functions! to functions!
Note that some compilers will be unable to compile the Note that some compilers will be unable to compile the expression `X=g()...` in
expression 'X=g()...' in main due to lack of temporary main() due to lack of temporary stack space. One might want to try replacing
stack space. One might want to try replacing main with: main with:
```c
main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}
```
main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}
if this is a problem. if this is a problem.
Spoiler: (rot13 to read) ### Spoiler:
Guvf cebtenz cevagf bhg gur fgevat: This program prints out the string:
gur dhvpx oebja sbk whzcrq bire gur ynml qbt > the quick brown fox jumped over the lazy dog
ol hfr bs cbvagref gb shapgvbaf ergheavat n fgehpg bs cbvagref by use of pointers to functions returning a struct of pointers
gb shapgvbaf! to functions!
## Author's comments ## Author's comments:
Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf. Rnpu Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf. Rnpu
nycunorgvpny punenpgre sebz n gb m vf cevagrq bhg nf vgf nycunorgvpny punenpgre sebz n gb m vf cevagrq bhg nf vgf
+44 -42
View File
@@ -1,23 +1,26 @@
# ANSI Committee's Worst Abuse of C # ANSI Committee's Worst Abuse of C
Larry Jones Larry Jones
SDRC SDRC
2000 Eastman Dr 2000 Eastman Dr
Milford, OH 45150 Milford, OH 45150
USA USA
## To build: ## To build:
make all ```sh
make all
```
Modern compilers failed to compile this entry: Modern compilers failed to compile this entry:
scjones.c:1:7: error: expected ';' after top level declarator ```c
char*a??(??)=??< scjones.c:1:7: error: expected ';' after top level declarator
^ char*a??(??)=??<
; ^
;
```
but we were able to get it to compile with modern compilers by specifying the but we were able to get it to compile with modern compilers by specifying the
`-ansi` flag with a tip from [Yusuke Endoh](/winners.html#Yusuke_Endoh). Thank `-ansi` flag with a tip from [Yusuke Endoh](/winners.html#Yusuke_Endoh). Thank
@@ -29,43 +32,42 @@ compiler option `-trigraphs` would also have worked.
## To run: ## To run:
./scjones ```sh
./scjones
```
## Judges' comments: ## Judges' comments:
The addition of trigraphs has made it easier to make programs The addition of trigraphs has made it easier to make programs hard to read. It
hard to read. It was a dark and stormy night for C when the was a dark and stormy night for C when the ANSI C committee added trigraphs to
ANSI C committee added trigraphs to the standard. Too bad the standard. Too bad that they didn't just simply require a more reasonable
that they didn't just simply require a more reasonable ISO ISO character set.
character set.
The Author sent us this note after he was informed that he won:
> Although I am quite grateful for the "ANSI Committee's Worst Abuse of C" title
> (were you aware that I am a member of the committee or is the double meaning
> unintentional?), I was really hoping for something more along the lines of
> "Closest Resemblance to Line Noise." :-)
... it was unintentional.
## Author's comments: ## Author's comments:
Since this year's contest is dedicated to ANSI C, here is a Since this year's contest is dedicated to ANSI C, here is a strictly conforming
strictly conforming entry. In accordance with the ANSI entry. In accordance with the ANSI definition of a strictly conforming program
definition of a strictly conforming program it does not produce it does not produce output dependent on any unspecified, undefined, or
output dependent on any unspecified, undefined, or implementation implementation defined behavior, and it does not exceed any of the minimum
defined behavior, and it does not exceed any of the minimum implementation limits. It adheres to all of the syntactic and semantic
implementation limits. It adheres to all of the syntactic and constraints of the standard: it `#include`s the relevant headers for the
semantic constraints of the standard, #includes the relevant functions it uses, and it uses the `EXIT_SUCCESS` and `EXIT_FAILURE` macros to
headers for the functions it uses, and uses the EXIT_SUCCESS and return a correct success/fail status to the invoking program. It also uses
EXIT_FAILURE macros to return a correct success/fail status to trigraphs for characters which are not in the `Invariant Code Set` of `ISO
the invoking program. It also uses trigraphs for characters 646:1983`, so it will be portable to machines with deficient (from C's
which are not in the Invariant Code Set of ISO 646:1983, so it standpoint) character sets. In short, it should be very widely portable. As an
will be portable to machines with deficient (from C's standpoint) extra added attraction, all of the lines are under 72 characters long, which
character sets. In short, it should be very widely portable. As would allow for sequence numbers to be punched in columns 73-80 :-).
an extra added attraction, all of the lines are under 72
characters long, which would allow for sequence numbers to be
punched in columns 73-80 :-).
[[ The Author sent us this note after he was informed that he won ]]
> Although I am quite grateful for the "ANSI Committee's Worst Abuse of C" title
(were you aware that I am a member of the committee or is the double meaning
unintentional?), I was really hoping for something more along the lines of
"Closest Resemblance to Line Noise." :-)
[[ ... it was unintentional ]]
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+30 -30
View File
@@ -1,55 +1,55 @@
# Strangest Abuse of the Rules # Strangest Abuse of the Rules
Stig Hemmer Stig Hemmer
Norwegian Institute of Technology Norwegian Institute of Technology
N-7034 Trondheim-NTH N-7034 Trondheim-NTH
Norway Norway
## To build: ## To build:
make all ```sh
make all
```
## To run ## To run:
make all ```sh
make all
```
NOTE: that's not a typo or mistake but one can also do: NOTE: that's not a typo or mistake but one can also do:
./o ```sh
./o
```
## Judges' comments ## Judges' comments
We changed the alias that the author's suggested alias from a We changed the alias that the author's suggested alias from a
C-shell alias to a zsh alias. C-shell alias to a zsh alias.
Note that shst.c is renamed to stig.c in the distribution. Note that `shst.c` is renamed to [stig.c](stig.c) in the distribution.
WARNING: This program's 'how to compile' is too specific to a particular WARNING: This program's `how to compile` is too specific to a particular shell.
shell. The obfuscation of this program to more related to The obfuscation of this program is more related to shell obfuscation than C
shell obfuscation than C obfuscation. This type of entry will obfuscation. This type of entry will not be permitted in future contests.
not be permitted in future contests.
## Author's comments ## Author's comments:
If you like shell programming you may also admire my If you like shell programming you may also admire my creative quoting. (I use
creative quoting. (I use echo to create an alias echo to create an alias which when run calls cc with the -D option to create a C
which when run calls cc with the -D option to create a macro with double quotes in it. ARRRRRGGGHHH!)
C macro with double quotes in it. ARRRRRGGGHHH!)
The program is totally portable, but the compile The program is totally portable, but the compile commands are very shell
commands are very shell specific so don't be TOO mad specific so don't be TOO mad at me if they don't work for you.
at me if they don't work for you.
If you want to put these commands in a Makefile you If you want to put these commands in a Makefile you must add 4 - four -
must add 4 - four - backslashes at the end on first backslashes at the end on first line. (At least that's what works here.)
line. (At least that's what works here.)
If everything works correctly it create an executable If everything works correctly it create an executable named `o` which checks
named c which checks whether your compiler supports whether your compiler supports nested comments. I've stolen the `"/*/*/0*/**/1"`
nested comments. I've stolen the `"/*/*/0*/**/1"` from from somewhere so don't give me any points for it. Of course neither ANSI nor
somewhere so don't give me any points for it. Of K&R support nested comments when properly implemented, but what the heck.
course neither ANSI nor K&R support nested comments
when properly implemented, but what the heck.
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+31 -26
View File
@@ -1,16 +1,16 @@
# Best Utility # Best Utility
Byron Rakitzis Byron Rakitzis
Princeton University Princeton University
5707 Old Lodge Dr. 5707 Old Lodge Dr.
Houston, TX 77066 Houston, TX 77066
USA USA
Sean Dorward Sean Dorward
Princeton University Princeton University
10274 Burleigh Cottage Lane 10274 Burleigh Cottage Lane
Ellicott City, MD 21043 Ellicott City, MD 21043
USA USA
## To build: ## To build:
@@ -28,7 +28,7 @@ due to the warning being interspersed with the program's output. Thank you Cody
for your assistance! for your assistance!
For the original version with `gets()` see the [archive For the original version with `gets()` see the [archive
tarball](/archive-1990.tar.bz2). tarball](/archive/archive-1990.tar.bz2).
## To run: ## To run:
@@ -44,13 +44,15 @@ or ctrl-c (or kill it from another terminal :-) ).
## Try: ## Try:
./tbr ```sh
ls -l tbr tbr.c ./tbr
# notice how the following does not work: ls -l tbr tbr.c
ls tbr* # notice how the following does not work:
# try figuring out how this entry works in an editor: ls tbr*
vi tbr.c # try figuring out how this entry works in an editor:
# then figure out how to exit vi :-) vi tbr.c
# then figure out how to exit vi :-)
```
What happens if you try using `cd -` to return to previous directory? What about What happens if you try using `cd -` to return to previous directory? What about
`cd` with no args? `cd` with no args?
@@ -68,22 +70,25 @@ Shell source was a major inspiration for the formation of the IOCCC back in
The author supplied us with a slightly smaller unformatted version The author supplied us with a slightly smaller unformatted version
of the program which we include below: of the program which we include below:
#define D ,close( ```c
char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]= #define D ,close(
32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);} char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]= 32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||(exit(0),0);r(0,0))for(;*++c;);}
*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u= r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o? *u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D ++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;} 0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||(exit(1),0):5;} 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;}
```
It has the `exit()` returns void fix but not the `gets()` to `fgets()` fix
applied.
## Author's comments: ## Author's comments:
Rot13: ### Rot13:
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
naq pq. Vg syntf reebef ba snvyrq puqve'f, bcra'f, perng'f naq pq. Vg syntf reebef ba snvyrq puqve'f, bcra'f, perng'f
+46 -33
View File
@@ -1,15 +1,17 @@
# Best of Show # Best of Show
Adrian Mariano Adrian Mariano
University of Washington University of Washington
2729 72nd Ave SE 2729 72nd Ave SE
Mercer Island, WA 98040 Mercer Island, WA 98040
USA USA
## To build: ## To build:
make all ```sh
make all
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed some bugs that [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed some bugs that
impacted the usability of this program including some segfaults under modern impacted the usability of this program including some segfaults under modern
@@ -32,7 +34,9 @@ initially. Thank you Yusuke!
## To run: ## To run:
./theorem expression x1 x2 h y1 ```sh
./theorem expression x1 x2 h y1
```
where: where:
@@ -46,8 +50,9 @@ NOTE: this entry will segfault on no arg specified.
## Try: ## Try:
./theorem y 0 1 0.1 1 ```sh
./theorem y 0 1 0.1 1
```
## Judges' comments: ## Judges' comments:
@@ -70,54 +75,62 @@ left to right. (i.e., parenthesis aren't supported).
Try running the program with the following args: Try running the program with the following args:
./theorem y 0 1 0.1 1 ```sh
./theorem 1/x 1 2 0.1 0 ./theorem y 0 1 0.1 1
./theorem 'x^2/y+x' 0 1 0.1 6 ./theorem 1/x 1 2 0.1 0
./theorem 'x^2/y+x' 0 1 0.1 6
```
But wait, there is more! You also get, free of charge, a But wait, there is more! You also get, free of charge, a
reversing filter! Try: reversing filter! Try:
./theorem -r 0 0 0 0 < theorem.c > sorter.c ```sh
./theorem -r 0 0 0 0 < theorem.c > sorter.c
```
Still not impressed? The author throws in for free, a Still not impressed? The author throws in for free, a
sort program! Try: sort program! Try:
make sorter ```sh
ls | ./sorter make sorter
ls | ./sorter
```
This program is safe for home use as well. The author has This program is safe for home use as well. The author has
included a safety feature in case you misplace the original included a safety feature in case you misplace the original
program source: program source:
./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c ```sh
./sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c
```
And finally, as a special offer to users of this entry, And finally, as a special offer to users of this entry,
the author provides a Fibonacci sequence generator! Try: the author provides a Fibonacci sequence generator! Try:
./sorter 0 0 0 0 < theorem.c > fibonacci.c ```sh
make fibonacci ./sorter 0 0 0 0 < theorem.c > fibonacci.c
./fibonacci 1 1 make fibonacci
./fibonacci 2 1 ./fibonacci 1 1
./fibonacci 2 1
```
Program available 9 track and cartridge cassette. Gensu knife Program available on 9 track and cartridge cassette. Neither [Ginsu
not included! :-) knife](https://ginsu.com) nor [Swiss army
knife](https://en.wikipedia.org/wiki/Swiss_Army_knife) included! :-)
When this program was first shown at the 1990 Summer Usenix When this program was first shown at the 1990 Summer Usenix conference, it
conference, it received a standing ovation; a first for received a standing ovation; a first for a contest entry.
a contest entry.
## Author's comments:
Differential equations are solved via the Runge-Kutta method, which guarantees
## Author's comments local error proportional to h^5, and total error across a finite interval is at
most a constant times `h^4`.
Differential equations are solved via the Runge-Kutta method,
which guarantees local error proportional to h^5, and total
error across a finite interval is at most a constant times h^4.
Sorting is accomplished with a standard shell sort. Sorting is accomplished with a standard shell sort.
Note that the sorting and reversing is limited to files with Note that the sorting and reversing is limited to files with fewer than 500
fewer than 500 lines, each less than 99 characters long. lines, each less than 99 characters long.
## Copyright and CC BY-SA 4.0 License: ## Copyright and CC BY-SA 4.0 License:
+2 -2
View File
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
DATA= DATA=
TARGET= ${PROG} TARGET= ${PROG}
# #
ALT_OBJ= ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ALT_TARGET= ${PROG}.alt
################# #################
+36 -19
View File
@@ -1,23 +1,28 @@
# Best Layout # Best Layout
Brian Westley (Merlyn LeRoy on usenet) Brian Westley (Merlyn LeRoy on usenet)
DigiBoard, Inc. DigiBoard, Inc.
1026 Blair Ave. 1026 Blair Ave.
St. Paul, MN 55104 St. Paul, MN 55104
USA USA
<http://www.westley.org>
http://www.westley.org
## To build: ## To build:
make all ```sh
make all
```
## To run: ## To run:
./westley number ```sh
./westley number
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed this for modern
systems. Thank you Cody for your assistance! systems. It had `1s` in places for a short int which was changed to just `1`.
Since it's instructional to see the differences he has provided an alternate
version with the original code. See below. Thank you Cody for your assistance!
NOTE: this entry will segfault without an arg and will enter an infinite loop if NOTE: this entry will segfault without an arg and will enter an infinite loop if
input is not a positive number. input is not a positive number.
@@ -25,12 +30,27 @@ input is not a positive number.
## Try: ## Try:
./westley 1 ```sh
./westley 2 ./westley 1
./westley 3 ./westley 2
./westley 5 ./westley 3
./westley 5
```
## Judges' comments ### Alternate code:
To see how C has changed over the years Cody provided the original source in
[westley.alt.c](westley.alt.c). If you have an old enough compiler try:
```sh
make alt
```
Use `westley.alt` as you would `westley`.
## Judges' comments:
If you would rather "Daisy" someone other than Westley, rename If you would rather "Daisy" someone other than Westley, rename
@@ -49,11 +69,8 @@ The original source had control-L's after each code block. To
make it easier on news readers, we converted each control-L to make it easier on news readers, we converted each control-L to
a blank line. a blank line.
Some modern compilers will not accept '1s' as a short integer - for
these compilers we replaced the instances of `1s` with `1`.
## Author's comments:
## Author's comments
This is a "Picking the Daisy" simulation. Now, instead of mangling a This is a "Picking the Daisy" simulation. Now, instead of mangling a
daisy, simply run this program with the number of petals desired as daisy, simply run this program with the number of petals desired as
+107
View File
@@ -0,0 +1,107 @@
char*lie;
double time, me= !0XFACE,
not; int rested, get, out;
main(ly, die) char ly, **die ;{
signed char lotte,
dear; (char)lotte--;
for(get= !me;; not){
1 - out & out ;lie;{
char lotte, my= dear,
**let= !!me *!not+ ++die;
(char*)(lie=
"The gloves are OFF this time, I detest you, snot\n\0sed GEEK!");
do {not= *lie++ & 0xF00L* !me;
#define love (char*)lie -
love 1s *!(not= atoi(let
[get -me?
(char)lotte-
(char)lotte: my- *love -
'I' - *love - 'U' -
'I' - (long) - 4 - 'U' ])- !!
(time =out= 'a'));} while( my - dear
&& 'I'-1l -get- 'a'); break;}}
(char)*lie++;
(char)*lie++, (char)*lie++; hell:0, (char)*lie;
get *out* (short)ly -0-'R'- get- 'a'^rested;
do {auto*eroticism,
that; puts(*( out
- 'c'
-('P'-'S') +die+ -2 ));}while(!"you're at it");
for (*((char*)&lotte)^=
(char)lotte; (love ly) [(char)++lotte+
!!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; }
else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -=
'4' - ('I'-1l); not; for(get=!
get; !out; (char)*lie & 0xD0- !not) return!!
(char)lotte;}
(char)lotte;
do{ not* putchar(lie [out
*!not* !!me +(char)lotte]);
not; for(;!'a';);}while(
love (char*)lie);{
register this; switch( (char)lie
[(char)lotte] -1s *!out) {
char*les, get= 0xFF, my; case' ':
*((char*)&lotte) += 15; !not +(char)*lie*'s';
this +1s+ not; default: 0xF +(char*)lie;}}}
get - !out;
if (not--)
goto hell;
exit( (char)lotte);}
+50 -49
View File
@@ -1,26 +1,32 @@
# Best Utility: # Best Utility:
Anthony C Howe Anthony C Howe
Mortice Kern Systems Inc. #CL-23 Mortice Kern Systems Inc. #CL-23
35 King St. N 268 Phillip St. 35 King St. N 268 Phillip St.
Waterloo, On Waterloo, On Waterloo, On Waterloo, On
Canada, N2J 2W9 Canada, N2L 6G9 Canada, N2J 2W9 Canada, N2L 6G9
## To build: ## To build:
make all ```sh
make all
```
## To run: ## To run:
./ant some_file ```sh
./ant some_file
```
NOTE: the file must already exist and not specifying any arg will make the NOTE: the file must already exist and not specifying any arg will make the
program exit without doing anything. program exit without doing anything.
## Try: ## Try:
cp README.md hill ```sh
./ant hill cp README.md hill
./ant hill
```
## Judges' comments: ## Judges' comments:
@@ -42,64 +48,59 @@ commands section for other commands.
Ant's Editor vIOCCC91 Ant's Editor vIOCCC91
Text files consists of lines of printable text or tab characters. Text files consists of lines of printable text or tab characters. A line can be
A line can be of arbitrary length and is delimited by either a of arbitrary length and is delimited by either a newline or the end of file.
newline or the end of file. Carriage return is mapped to newline Carriage return is mapped to newline on input and ignored on output. Tab stops
on input and ignored on output. Tab stops are every eight columns. are every eight columns. Non-printable characters may have unpredictable
Non-printable characters may have unpredictable results depending results depending on the implementation of `curses`.
on the implementation of CURSES.
### COMMANDS: ### COMMANDS:
h j k l left, down, up, right cursor movement - h j k l left, down, up, right cursor movement
H J K L word left, page down, page up, word right - H J K L word left, page down, page up, word right
[ ] beginning and end of line - [ ] beginning and end of line
t b top and bottom of file - t b top and bottom of file
i enter insert mode, formfeed to quit - i enter insert mode, form-feed to quit
x delete character under the cursor - x delete character under the cursor
W write buffer to file - W write buffer to file
R refresh the screen - R refresh the screen
Q quit - Q quit
### EXIT STATUS: ### EXIT STATUS:
0 success - 0 success
2 missing edit filename - 2 missing edit filename
### ABOUT THIS ENTRY: ### ABOUT THIS ENTRY:
The BUF size should be set at compile time to 32767. This value The BUF size should be set at compile time to 32767. This value was used
was used because the Sozobon C compiler for the Atari ST has 16 because the Sozobon C compiler for the Atari ST has 16 bit ints and a limit on
bit ints and a limit on the size of arrays & structures of 32k. the size of arrays & structures of 32k. Also the WatCom C compiler for the PC
Also the WatCom C compiler for the PC also has 16 bits ints. On also has 16 bits ints. On machines that have 32 bit ints (most unix boxes), a
machines that have 32 bit ints (most unix boxes), a larger value larger value for BUF could be used.
for BUF could be used.
It is recommend that compact memory model be used on PC class It is recommend that compact memory model be used on PC class machines. Small
machines. Small memory model may work too provided BUF is not memory model may work too provided BUF is not too large.
too large.
The character constants '\b', '\f', '\n', '\r', '\t' are used The character constants `'\b'`, `'\f'`, `'\n'`, `'\r'`, `'\t'` are used in order
in order to provide more portable code, since the compiler should to provide more portable code, since the compiler should handle the translation
handle the translation of them into the native character set. of them into the native character set. Note that `'\f'` (form-feed) was used to
Note that '\f' (formfeed) was used to exit insert mode because exit insert mode because K&R C had no escape constant for the escape-key.
K&R C had no escape constant for the escape-key.
My goals for this project were to learn and experiment with the My goals for this project were to learn and experiment with the
Buffer Gap Scheme [Fin80][net90], write a useful and *portable* Buffer Gap Scheme [Fin80][net90], write a useful and *portable*
programme, and meet the requirements of the IOCCC. I initially program, and meet the requirements of the IOCCC. I initially
planned to have a mini CURSES built-in like the IOCCC Tetris entry planned to have a mini `curses` built-in like the IOCCC Tetris entry
from a previous year, however this was not as portable as using a from a previous year, however this was not as portable as using a
CURSES library with TERMINFO/TERMCAP support. `curses` library with `TERMINFO`/`TERMCAP` support.
I plan to post followups such as unobfuscated versions and bugs I plan to post follow-ups such as unobfuscated versions and bugs fixes to
fixes to comp.editors. Reposts of the editor.101, gap.doc, and comp.editors. Reposts of the editor.101, gap.doc, and editor.102 can be found
editor.102 can be found in the same group every so often. in the same group every so often.
This entry will display a file with long lines, but has trouble This entry will display a file with long lines, but has trouble scrolling the
scrolling the screen with long lines. Paging up and down should screen with long lines. Paging up and down should work correctly, however.
work correctly, however.
### REFERENCES: ### REFERENCES:
+12 -1
View File
@@ -11,7 +11,7 @@ The following is a known list of **BUGS and (mis)FEATURES** in IOCCC winners.
Can you fix/improve entries not under the INABIAF (it's not a bug it's a Can you fix/improve entries not under the INABIAF (it's not a bug it's a
feature)? You are **VERY WELCOME** to try. feature)? You are **VERY WELCOME** to try.
Please submit your fixes fix in a [GitHub pull Please submit your fixes in a [GitHub pull
request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL
REQUEST *PER* FIX, please)! REQUEST *PER* FIX, please)!
@@ -477,6 +477,17 @@ this entry that prevented it from working. However if not enough args are
specified this program will crash. This should NOT be fixed. specified this program will crash. This should NOT be fixed.
## [1990/westley](1990/westley/westley.c) ([README.md](1990/westley/README.md))
## STATUS: INABIAF - please **DO NOT** fix
This entry will crash without an arg. At this time this is not considered worth
fixing so it should not be fixed.
## STATUS: known bug - please help us fix
However a negative number will make the program enter an infinite loop. This
will be fixed in time but it's noted here for now.
# 1991 # 1991
+16 -10
View File
@@ -151,23 +151,29 @@ eval "$(/opt/homebrew/bin/brew shellenv)"
## Q: How did entry XYZZY win? It breaks rule 2! ## Q: How did entry XYZZY win? It breaks rule 2!
As entries have been fixed it is entirely possible that some of the entries no As entries have been fixed it is entirely possible that some of the entries no
longer fit within the year's size restrictions. For the original version see the longer fit within the year's size restrictions. Invariably the length of columns
[/archive](/archive) directory where you can find all the original winning and number of rows might also be changed.
entries.
For the original version see the [/archive](/archive) directory where you can
find all the original winning entries.
## Q: I found a bug in a previous winner, what should I do? ## Q: I found a bug in a previous winner, what should I do?
We do not 'maintain' the contest winners. The code is made available on an 'AS We do not 'maintain' the contest winners as such. The code is made available on an 'AS
IS' basis. If you have a FIX for a entry, we suggest that you try and email it IS' basis. If you have a FIX for an entry, we suggest that you try and email it
to the authors and to CC: us using the instructions on the [contacting the IOCCC to the authors and to submit your fixes in a [GitHub pull
Judges](contact.hml) page. request](https://github.com/ioccc-src/temp-test-ioccc/pulls) (with ONE PULL
REQUEST *PER* FIX, please!).
IF you have a FIX, and IF the author does not object, and IF your fix looks Note that just because you have a fix does not mean it'll be accepted. This
reasonable, we will add a web link to a copy of your email for others to see. might be because the author objects or it doesn't fit in some way or another. Of
course if the entry does not work we'll certainly be more inclined to accept the
fix. If it is accepted we'll be happy to credit you in the entry's _README.md_
file. If you're a previous winner we will happily link to your entries; if
you're not we can link to your website if you wish.
## Q: Are there types of entries that are submitted so frequently that the judges get tired of them? ## Q: Are there types of entries that are submitted so frequently that the judges get tired of them?
Yes, there are types of entries that show up over and over again. Yes, there are types of entries that show up over and over again.
The [guidelines](guidelines.html) say: The [guidelines](guidelines.html) say:
+23
View File
@@ -0,0 +1,23 @@
# A todo list of known things to check and/or do
*Last updated: Sun 9 Apr 2023 13:38:05 UTC*
More things will likely be added over time and as items are done they _should
be_ removed from the list IF AND ONLY IF (!!) we are certain it is done (many
times it's thought that this was done only to find out that they are not). It is
hoped that this will be referenced and updated as this is an easy way to keep
track of things that have been done already and what have not been done (mostly
not been done).
- Find entries with bugs and INABIAF and add to [bugs.md](/bugs.md).
- Resolve as many of the issues in [bugs.md](/bugs.md) with the exception of the
INABIAF ones. This is likely not possible but some certainly can be fixed.
- Check for typos in README.md files.
- Verify which README.md files have not been checked for correct formatting and
fix any issues.
* This includes author information: not only at first column but making sure
that the lines end with spaces so that the rendered output does not end up
on one line only.
* [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) has done many and
has some kind of record of what he's done but these can be added later by
having a list of years to check.