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
*.bku
*.dSYM
.*.sv[a-z]
.*.sw[a-z]
.DS_Store
.sv[a-z]
.sw[a-z]
/NOTES
/archive/1984/
/archive/1985/
/archive/1986/
@@ -35,6 +36,6 @@
/archive/2020/
/bugs.html
/faq.html
mkentry
/NOTES
iocccsize
mkentry
readme.html
+2 -2
View File
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
+69 -41
View File
@@ -1,25 +1,59 @@
# Best Small Program
Doron Osovlanski
CADTECH - CAD/CAM Systems Ltd
24 Ben-Yosef st.
Givat-Shmuel 51905
Israel
Baruch Nissenbaum
Tel-Aviv University
The Faculty of Engineering
Tel-Aviv
Israel
Baruch Nissenbaum
Tel-Aviv University
The Faculty of Engineering
Tel-Aviv
Israel
Doron Osovlanski
CADTECH - CAD/CAM Systems Ltd
24 Ben-Yosef St.
Givat-Shmuel 51905
Israel
## To build:
make all
```sh
make all
```
## To run:
echo 4 | ./baruch
echo 7 | ./baruch
```sh
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:
@@ -30,44 +64,38 @@ added a final newline to the file to make unpacking easy.
## Authors' comments:
The goal of this work was to write a program that solves the
classic n-queen problem, with a board size of up to 99x99, while
keeping the program as short as possible.
The goal of this work was to write a program that solves the classic [n-queens
problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle), with a board size
of up to 99x99, while keeping the program as short as possible.
The program finds all possibilities to place N chess queens on
a NxN chess board so that no queen is in range of any other queen
(not in the same column row or diagonal). For each solution the
chess board and the place of the queens is printed to stdout.
The program finds all possibilities to place N chess queens on a NxN
[chessboard](https://en.wikipedia.org/wiki/Chessboard) so that no queen is in
range of any other queen (not in the same column row or diagonal). For each
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.
To make things even more simple we used a very limited subset of C:
No pre-processor statements
Only one, harmless, 'for' statement
No ifs
No breaks
No cases
No functions
No gotos
No structures
In short, it contains no C language that might confuse the
innocent reader. :-)
- No pre-processor statements
- Only one, harmless, `for` statement
- No `if`s
- No `break`s
- No `case`s
- No functions outside the standard C library
- No `goto`s
- No structures
In short, it contains no C language that might confuse the innocent reader. :-)
This program demonstrates the claim that in C, any program
can be written using a single 'for' statement, as long as it is
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 to replace the " #Q"
string with " \261\2".
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
to replace the `" #Q"` string with `" \261\2"`.
## 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()
{
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
Chris Mills
Wyse Technology
3471 N. 1st St.
San Jose CA 95134
USA
Chris Mills
Wyse Technology
3471 N. 1st St.
San Jose CA 95134
USA
## To build:
@@ -24,7 +24,7 @@ for your assistance!
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made this safer by
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).
@@ -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
that may be changed:
-DM=<max bet allowed>
-DN=<52 * number of decks used>
-DX=<how to seed the rand() generator>
- `-DM=<max bet allowed>`
- `-DN=<52 * number of decks used>`
- `-DX=<how to seed the rand() generator>`
The macro `V` should remain `void`.
## Author's comments:
This is a blackjack program. It does splits, doubling down,
insurance, etc.
This is a blackjack program. It does splits, doubling down, insurance, etc.
As best I can figure, it should be ANSI-compliant, as well as
portable to BSD & sysV (as well as the irritating compiler I
was using which assumes `x=*p++` means `x*=p++`!). It is
reasonably robust in its error handling---it won't let you
split, double, etc. unless you actually have the cash, etc. To
terminate the program, hit EOF or type 0 or a negative number
for you wager.
As best I can figure, it should be ANSI-compliant, as well as portable to BSD &
SysV (as well as the irritating compiler I was using which assumes `x=*p++`
means `x*=p++`!). It is reasonably robust in its error handling---it won't let
you split, double, etc. unless you actually have the cash, etc. To 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
can split many times, and it will show all hands as they are
played.
The way it deals with splits is particularly cool (IMHO). You can split many
times, and it will show all hands as they are played.
## 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
Diomidis Spinellis
Imperial College, University of London
Myrsinis 1
GR-145 62 Kifissia
Greece
Diomidis Spinellis
Imperial College, University of London
Myrsinis 1
GR-145 62 Kifissia
Greece
## To build:
@@ -16,26 +16,28 @@ you Yusuke!
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) removed the erroneous
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.
Thank you Cody for your assistance!
it safer and to prevent a potentially alarming warning at compiling and/or
linking and/or runtime. Thank you Cody for your assistance!
## To run
./dds
```sh
./dds
```
## Try:
Give the following lines as input:
OLD LANDER.BAS
RUN
```
OLD LANDER.BAS
RUN
```
NOTE: this is case sensitive.
## Judges' comments:
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).
Immediate commands:
### Immediate commands:
RUN LIST NEW OLD filename
BYE SAVE filename
- RUN
- LIST
- NEW
- OLD filename
- BYE
- SAVE filename
Program commands:
### Program commands:
variable names a to z variables initialized to 0 on RUN
FOR var = exp TO exp NEXT variable
GOSUB exp RETURN
GOTO exp IF exp THEN exp
INPUT variable PRINT string
PRINT exp var = exp
REM any text END
- variable names a to z
- variables initialized to 0 on RUN
- FOR var = exp TO exp
- NEXT variable
- GOSUB exp
- RETURN
- 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
number (leading 0 for octal, 0x for hex, else decimal), variable
Unary -
* /
+ -
= <>
> <
<= >=
(* and + are also used for boolean AND and boolean OR)
Boolean expressions evaluate to 0 for false and 1 for true
- Bracketed expressions
- number (leading 0 for octal, 0x for hex, else decimal), variable
- Unary -
- `*` `/`
- `+` `-`
- `=` `<>`
- `>` `<`
- `<=` `>=`
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.
- A line number with nothing following it, deletes the line.
Input format:
### Input format:
- Free format positioning of tokens on the line.
- No space is allowed before the line number.
@@ -85,38 +100,33 @@ Input format:
- ALL INPUT MUST BE UPPERCASE.
Limits:
### Limits:
Line numbers 1-10000
Line length 999 characters
FOR nesting 26
GOSUB 999 levels
Program Dynamically allocated
Expressions -32768 - 32767 for 16 bit machines,
-2147483648 - 2147483647 for 32 bit machines
Error checking / error reports:
- Line numbers 1-10000
- Line length 999 characters
- FOR nesting 26
- GOSUB 999 levels
- Program Dynamically allocated
- Expressions -32768 - 32767 for 16 bit machines, -2147483648 - 2147483647 for 32 bit machines
### Error checking / error reports:
No error checking is performed.
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
ASCII or EBCIDIC character set
48K bytes memory
The Speed of DDS-BASIC Interpreter (Version 1.00) relative to Microsoft Advanced
BASIC 3.31 is approximately 60%.
The Speed of DDS-BASIC Interpreter (Version 1.00). relative to
Microsoft Advanced BASIC 3.31 is Approximately 60%.
The code size could be further reduced by doing ugly things like
not declaring the return type of functions, not freeing memory,
#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).
The code size could be further reduced by doing ugly things like not declaring
the return type of functions, not freeing memory, #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:
+24 -15
View File
@@ -1,44 +1,53 @@
# Best Abuse of the C Preprocessor
David Goodenough
anonymous organization
541 Commonwealth Ave,
Newton, MA 02159
USA
David Goodenough
anonymous organization
541 Commonwealth Ave
Newton, MA 02159
USA
## To build:
make all
```sh
make all
```
## To run:
echo foo bar | ./dg
```sh
echo foo bar | ./dg
```
## Try:
echo "to C or not to C" | ./dg
```sh
echo "to C or not to C" | ./dg
```
## Judges' comments:
Some C preprocessors got confused about single quotes in certain cases.
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:
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
done for the wider audience.
particularly if the C preprocessor botches single quotes in cpp expansions,
which we have done for the wider audience.
## Author's comments:
If my preprocessor could hack it, I could write this as one single
line rather than 4, but when I do that I get a complaint "defines
nested too deeply".
If my preprocessor could hack it, I could write this as one single line rather
than 4, but when I do that I get a complaint "defines nested too deeply".
Spoiler: (rot13 to read)
+141 -138
View File
@@ -1,28 +1,29 @@
# Best Entropy-reducer
James A. Woods
Research Institute for Advanced Computer Science
MS 230-5
NASA Ames Research Center
Moffett Field, CA 94131
USA
James A. Woods
Research Institute for Advanced Computer Science
MS 230-5
NASA Ames Research Center
Moffett Field, CA 94131
USA
Karl F. Fox
Morning Star Technologies, Inc.
1760 Zollinger Road
Columbus, OH 43221
USA
Karl F. Fox
Morning Star Technologies, Inc.
1760 Zollinger Road
Columbus, OH 43221
USA
Paul Eggert
Twin Sun Inc.
360 N. Sepulveda Blvd. #2055
El Segundo, CA 90245
USA
Paul Eggert
Twin Sun Inc.
360 N. Sepulveda Blvd. #2055
El Segundo, CA 90245
USA
## To build:
make all
```sh
make all
```
[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
@@ -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:
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.
```sh
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
```
which should apply the identity transformation to a minimal holoalphabetic
sentence.
## Judges' comments:
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
to reduce it to 1530 bytes) which implements the complete
shark utility. The script, shark.sh, contains a 'jaw.c' embedded
within it!
- `atob` - ascii to binary conversion
- `zcat` - decompression filter
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:
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`:
mkdir -p test
cd test
sh ../receive
cmp ../jaw.c jaw.c
cmp ../README.md README.md
```sh
mkdir -p test
cd test
sh ../receive
cmp ../jaw.c jaw.c
cmp ../README.md README.md
```
## Authors' comments:
ABSTRACT
### ABSTRACT
Minimal, Universal File Bundling
(or, Functional Obfuscation in a Self-Decoding Unix Shell Archive)
#### Minimal, Universal File Bundling (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
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 over-
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 portable
(un)bundler to (dis)assemble data-compressed, binary-to-ASCII-converted,
length-split, and checksummed directory structures using standard Unix tools.
Miniature versions of counterparts to a Lempel-Ziv coder (`compress` or
`squeeze`) and an efficient bit packetizer (`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`.
Specifically, we outline the development of an extraordinarily compact
portable (un)bundler to (dis)assemble data-compressed,
binary-to-ASCII-converted, length-split, and checksummed directory structures
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
`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
encoding schemes.
In the function-theoretic sense of minimal
Chaitin/Kolmogorov complexity, and within a modified Shannon
model of communication, the 'shark' effort aims to construct
a "shortest program" for source decoding in the Turing-
universal Unix environment.
In the function-theoretic sense of minimal Chaitin/Kolmogorov complexity, and
within a modified Shannon model of communication, the 'shark' effort aims to
construct a "shortest program" for source decoding in the Turing-universal Unix
environment.
----------------------------------------------
Oh, the shark has pretty teeth, dear--
And he shows them pearly white
Just a jackknife has Macheath, dear--
And he keeps it out of sight.
[Bertolt Brecht, Threepenny Opera]
> Oh, the shark has pretty teeth, dear--
> And he shows them pearly white
> Just a jackknife has Macheath, dear--
> And he keeps it out of sight.
>
> -- Bertolt Brecht, Threepenny Opera
----------------------------------------------
### Portability:
We have ported this program to a wide variety of systems. Among
these are:
SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1')
SunOS 4.0.3 / Sun 3
BSD 4.3 / VAX 8650
SEIUX / Sumitomo Electric Ustation/S
Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD)
System V.? / Hitachi 2050
System V.? / NEC EWS 4800
UNIOS-B / Omron Luna
Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36')
Unicos / Cray 2
- SunOS 4.1 / Sun SPARCstation 1 (using both 'cc' and 'gcc 1.37.1')
- SunOS 4.0.3 / Sun 3
- BSD 4.3 / VAX 8650
- SEIUX / Sumitomo Electric Ustation/S
- Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD)
- System V.? / Hitachi 2050
- System V.? / NEC EWS 4800
- UNIOS-B / Omron Luna
- Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36')
- Unicos / Cray 2
### Obfuscation:
We (the authors) feel this program is obfuscated for the
following reasons:
0. This is one of the few programs you'll see WHOSE VERY UTILITY DEPENDS ON ITS
OBFUSCATION!
0. This is one of the few programs you'll see _WHOSE VERY UTILITY DEPENDS ON ITS
OBFUSCATION_!
1. The contest entry may be used to send its wonderful self to anyone in the
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
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,
preserved at amazing cost for sheer perversity.
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
portability hack, the "void where prohibited by flaw" fix, the scanf()
spacesaver, shift shenanigans, signal madness, exit()ing stage left, and
source-to-source transformations galore.
well as C. Ask about the 'tar' pit escape, the `argv[0]` flip, Paul's
`&4294967295` portability hack, the "void where prohibited by flaw" fix, the
`scanf()` space-saver, shift shenanigans, signal madness, `exit()`ing stage
left, and source-to-source transformations galore.
For extra credit:
### For extra credit:
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.
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.
------------------------ cut here for sharkmail -----------------------
#!/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$$*
------------------------ end of sharkmail -----------------------------
```sh
#!/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:
### Shark history:
May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
It's too late for the 4th IOCCC.
- May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
It's too late for the 4th IOCCC.
May 21, 1987: James A. Woods extends idea to construct self
decompressing shar Trojan horse, utilizing 'cc', 'shar',
'zcat', & 'btoa'; size: 2303 bytes.
- May 21, 1987: James A. Woods extends idea to construct self
decompressing shar Trojan horse, utilizing 'cc', 'shar',
'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',
short-circuit C-compile at far end, dual-use main.c,
portability mods. (jaw)
- June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar',
short-circuit C-compile at far end, dual-use main.c,
portability mods. (jaw)
Mar-May 1988: abortive run at 5th IOCCC.
jaw.c - 1529 bytes. compile line: 152 bytes.
generated funny code with execvp() to invoke shell.
- Mar-May 1988: abortive run at 5th IOCCC.
jaw.c - 1529 bytes. compile line: 152 bytes.
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)
and 1530-byte production shell code (w/comments).
Eggert comes through with lion's share of improvements.
7th IOCCC code now faster than the btoa/zcat it replaces.
- May 24, 1990: collaboration yields 999-byte jaw.c core (see above)
and 1530-byte production shell code (w/comments).
Eggert comes through with lion's share of improvements.
7th IOCCC code now faster than the btoa/zcat it replaces.
May 1990: 'jaw' develops experimental replacement using
Dan Bernstein's high-compression 'squeeze'.
- May 1990: 'jaw' develops experimental replacement using
Dan Bernstein's high-compression 'squeeze'.
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:
+26 -20
View File
@@ -1,20 +1,24 @@
# Most Unusual Data Structure
Peter J Ruczynski.
Pyramid Technology Ltd.
Pyramid House,
Solatron Road
Farnborough.
Hants GU14 7PL
England, U.K.
Peter J Ruczynski
Pyramid Technology Ltd.
Pyramid House
Solatron Road
Farnborough
Hants GU14 7PL
England, U.K.
## To build:
make all
```sh
make all
```
## To run:
./pjr
```sh
./pjr
```
## Judges' comments:
@@ -24,26 +28,28 @@ it is done?
By use of pointers to functions returning a struct of pointers
to functions!
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 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();}
```
main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}
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
gb shapgvbaf!
by use of pointers to functions returning a struct of pointers
to functions!
## Author's comments
## Author's comments:
Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf. Rnpu
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
Larry Jones
SDRC
2000 Eastman Dr
Milford, OH 45150
USA
Larry Jones
SDRC
2000 Eastman Dr
Milford, OH 45150
USA
## To build:
make all
```sh
make all
```
Modern compilers failed to compile this entry:
scjones.c:1:7: error: expected ';' after top level declarator
char*a??(??)=??<
^
;
```c
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
`-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:
./scjones
```sh
./scjones
```
## Judges' comments:
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 the standard. Too bad
that they didn't just simply require a more reasonable ISO
character set.
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
the standard. Too bad that they didn't just simply require a more reasonable
ISO 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:
Since this year's contest is dedicated to ANSI C, here is a
strictly conforming entry. In accordance with the ANSI
definition of a strictly conforming program it does not produce
output dependent on any unspecified, undefined, or implementation
defined behavior, and it does not exceed any of the minimum
implementation limits. It adheres to all of the syntactic and
semantic constraints of the standard, #includes the relevant
headers for the functions it uses, and uses the EXIT_SUCCESS and
EXIT_FAILURE macros to return a correct success/fail status to
the invoking program. It also uses trigraphs for characters
which are not in the Invariant Code Set of ISO 646:1983, so it
will be portable to machines with deficient (from C's standpoint)
character sets. In short, it should be very widely portable. As
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 ]]
Since this year's contest is dedicated to ANSI C, here is a strictly conforming
entry. In accordance with the ANSI definition of a strictly conforming program
it does not produce output dependent on any unspecified, undefined, or
implementation defined behavior, and it does not exceed any of the minimum
implementation limits. It adheres to all of the syntactic and semantic
constraints of the standard: it `#include`s the relevant headers for the
functions it uses, and it uses the `EXIT_SUCCESS` and `EXIT_FAILURE` macros to
return a correct success/fail status to the invoking program. It also uses
trigraphs for characters which are not in the `Invariant Code Set` of `ISO
646:1983`, so it will be portable to machines with deficient (from C's
standpoint) character sets. In short, it should be very widely portable. As 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 :-).
## Copyright and CC BY-SA 4.0 License:
+30 -30
View File
@@ -1,55 +1,55 @@
# Strangest Abuse of the Rules
Stig Hemmer
Norwegian Institute of Technology
N-7034 Trondheim-NTH
Norway
Stig Hemmer
Norwegian Institute of Technology
N-7034 Trondheim-NTH
Norway
## 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:
./o
```sh
./o
```
## Judges' comments
We changed the alias that the author's suggested alias from a
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
shell. The obfuscation of this program to more related to
shell obfuscation than C obfuscation. This type of entry will
not be permitted in future contests.
WARNING: This program's `how to compile` is too specific to a particular shell.
The obfuscation of this program is more related to shell obfuscation than C
obfuscation. This type of entry will not be permitted in future contests.
## Author's comments
## Author's comments:
If you like shell programming you may also admire my
creative quoting. (I use echo to create an alias
which when run calls cc with the -D option to create a
C macro with double quotes in it. ARRRRRGGGHHH!)
If you like shell programming you may also admire my creative quoting. (I use
echo to create an alias which when run calls cc with the -D option to create a C
macro with double quotes in it. ARRRRRGGGHHH!)
The program is totally portable, but the compile
commands are very shell specific so don't be TOO mad
at me if they don't work for you.
The program is totally portable, but the compile commands are very shell
specific so don't be TOO mad at me if they don't work for you.
If you want to put these commands in a Makefile you
must add 4 - four - backslashes at the end on first
line. (At least that's what works here.)
If you want to put these commands in a Makefile you must add 4 - four -
backslashes at the end on first line. (At least that's what works here.)
If everything works correctly it create an executable
named c which checks whether your compiler supports
nested comments. I've stolen the `"/*/*/0*/**/1"` from
somewhere so don't give me any points for it. Of
course neither ANSI nor K&R support nested comments
when properly implemented, but what the heck.
If everything works correctly it create an executable named `o` which checks
whether your compiler supports nested comments. I've stolen the `"/*/*/0*/**/1"`
from somewhere so don't give me any points for it. Of course neither ANSI nor
K&R support nested comments when properly implemented, but what the heck.
## Copyright and CC BY-SA 4.0 License:
+31 -26
View File
@@ -1,16 +1,16 @@
# Best Utility
Byron Rakitzis
Byron Rakitzis
Princeton University
5707 Old Lodge Dr.
Houston, TX 77066
USA
Sean Dorward
Princeton University
10274 Burleigh Cottage Lane
Ellicott City, MD 21043
USA
Sean Dorward
Princeton University
10274 Burleigh Cottage Lane
Ellicott City, MD 21043
USA
## To build:
@@ -28,7 +28,7 @@ due to the warning being interspersed with the program's output. Thank you Cody
for your assistance!
For the original version with `gets()` see the [archive
tarball](/archive-1990.tar.bz2).
tarball](/archive/archive-1990.tar.bz2).
## To run:
@@ -44,13 +44,15 @@ or ctrl-c (or kill it from another terminal :-) ).
## 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 :-)
```sh
./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?
@@ -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
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;}
```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;);}
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;}
```
It has the `exit()` returns void fix but not the `gets()` to `fgets()` fix
applied.
## Author's comments:
Rot13:
### Rot13:
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
+46 -33
View File
@@ -1,15 +1,17 @@
# Best of Show
Adrian Mariano
University of Washington
2729 72nd Ave SE
Mercer Island, WA 98040
USA
Adrian Mariano
University of Washington
2729 72nd Ave SE
Mercer Island, WA 98040
USA
## To build:
make all
```sh
make all
```
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed some bugs that
impacted the usability of this program including some segfaults under modern
@@ -32,7 +34,9 @@ initially. Thank you Yusuke!
## To run:
./theorem expression x1 x2 h y1
```sh
./theorem expression x1 x2 h y1
```
where:
@@ -46,8 +50,9 @@ NOTE: this entry will segfault on no arg specified.
## Try:
./theorem y 0 1 0.1 1
```sh
./theorem y 0 1 0.1 1
```
## Judges' comments:
@@ -70,54 +75,62 @@ left to right. (i.e., parenthesis aren't supported).
Try running the program with the following args:
./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
```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
```
But wait, there is more! You also get, free of charge, a
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
sort program! Try:
make sorter
ls | ./sorter
```sh
make sorter
ls | ./sorter
```
This program is safe for home use as well. The author has
included a safety feature in case you misplace the original
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,
the author provides a Fibonacci sequence generator! Try:
./sorter 0 0 0 0 < theorem.c > fibonacci.c
make fibonacci
./fibonacci 1 1
./fibonacci 2 1
```sh
./sorter 0 0 0 0 < theorem.c > fibonacci.c
make fibonacci
./fibonacci 1 1
./fibonacci 2 1
```
Program available 9 track and cartridge cassette. Gensu knife
not included! :-)
Program available on 9 track and cartridge cassette. Neither [Ginsu
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
conference, it received a standing ovation; a first for
a contest entry.
When this program was first shown at the 1990 Summer Usenix conference, it
received a standing ovation; a first for a contest entry.
## Author's comments:
## Author's comments
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.
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.
Note that the sorting and reversing is limited to files with
fewer than 500 lines, each less than 99 characters long.
Note that the sorting and reversing is limited to files with fewer than 500
lines, each less than 99 characters long.
## Copyright and CC BY-SA 4.0 License:
+2 -2
View File
@@ -112,8 +112,8 @@ OBJ= ${PROG}.o
DATA=
TARGET= ${PROG}
#
ALT_OBJ=
ALT_TARGET=
ALT_OBJ= ${PROG}.alt.o
ALT_TARGET= ${PROG}.alt
#################
+36 -19
View File
@@ -1,23 +1,28 @@
# Best Layout
Brian Westley (Merlyn LeRoy on usenet)
DigiBoard, Inc.
1026 Blair Ave.
St. Paul, MN 55104
USA
http://www.westley.org
Brian Westley (Merlyn LeRoy on usenet)
DigiBoard, Inc.
1026 Blair Ave.
St. Paul, MN 55104
USA
<http://www.westley.org>
## To build:
make all
```sh
make all
```
## To run:
./westley number
```sh
./westley number
```
[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
input is not a positive number.
@@ -25,12 +30,27 @@ input is not a positive number.
## Try:
./westley 1
./westley 2
./westley 3
./westley 5
```sh
./westley 1
./westley 2
./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
@@ -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
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
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:
Anthony C Howe
Mortice Kern Systems Inc. #CL-23
35 King St. N 268 Phillip St.
Waterloo, On Waterloo, On
Canada, N2J 2W9 Canada, N2L 6G9
Anthony C Howe
Mortice Kern Systems Inc. #CL-23
35 King St. N 268 Phillip St.
Waterloo, On Waterloo, On
Canada, N2J 2W9 Canada, N2L 6G9
## To build:
make all
```sh
make all
```
## To run:
./ant some_file
```sh
./ant some_file
```
NOTE: the file must already exist and not specifying any arg will make the
program exit without doing anything.
## Try:
cp README.md hill
./ant hill
```sh
cp README.md hill
./ant hill
```
## Judges' comments:
@@ -42,64 +48,59 @@ commands section for other commands.
Ant's Editor vIOCCC91
Text files consists of lines of printable text or tab characters.
A line can be of arbitrary length and is delimited by either a
newline or the end of file. Carriage return is mapped to newline
on input and ignored on output. Tab stops are every eight columns.
Non-printable characters may have unpredictable results depending
on the implementation of CURSES.
Text files consists of lines of printable text or tab characters. A line can be
of arbitrary length and is delimited by either a newline or the end of file.
Carriage return is mapped to newline on input and ignored on output. Tab stops
are every eight columns. Non-printable characters may have unpredictable
results depending on the implementation of `curses`.
### COMMANDS:
h j k l left, down, up, right cursor movement
H J K L word left, page down, page up, word right
[ ] beginning and end of line
t b top and bottom of file
i enter insert mode, formfeed to quit
x delete character under the cursor
W write buffer to file
R refresh the screen
Q quit
- h j k l left, down, up, right cursor movement
- H J K L word left, page down, page up, word right
- [ ] beginning and end of line
- t b top and bottom of file
- i enter insert mode, form-feed to quit
- x delete character under the cursor
- W write buffer to file
- R refresh the screen
- Q quit
### EXIT STATUS:
0 success
2 missing edit filename
- 0 success
- 2 missing edit filename
### ABOUT THIS ENTRY:
The BUF size should be set at compile time to 32767. This value
was used because the Sozobon C compiler for the Atari ST has 16
bit ints and a limit on the size of arrays & structures of 32k.
Also the WatCom C compiler for the PC also has 16 bits ints. On
machines that have 32 bit ints (most unix boxes), a larger value
for BUF could be used.
The BUF size should be set at compile time to 32767. This value was used
because the Sozobon C compiler for the Atari ST has 16 bit ints and a limit on
the size of arrays & structures of 32k. Also the WatCom C compiler for the PC
also has 16 bits ints. On machines that have 32 bit ints (most unix boxes), a
larger value for BUF could be used.
It is recommend that compact memory model be used on PC class
machines. Small memory model may work too provided BUF is not
too large.
It is recommend that compact memory model be used on PC class machines. Small
memory model may work too provided BUF is not too large.
The character constants '\b', '\f', '\n', '\r', '\t' are used
in order to provide more portable code, since the compiler should
handle the translation of them into the native character set.
Note that '\f' (formfeed) was used to exit insert mode because
K&R C had no escape constant for the escape-key.
The character constants `'\b'`, `'\f'`, `'\n'`, `'\r'`, `'\t'` are used in order
to provide more portable code, since the compiler should handle the translation
of them into the native character set. Note that `'\f'` (form-feed) was used to
exit insert mode because K&R C had no escape constant for the escape-key.
My goals for this project were to learn and experiment with the
Buffer Gap Scheme [Fin80][net90], write a useful and *portable*
programme, and meet the requirements of the IOCCC. I initially
planned to have a mini CURSES built-in like the IOCCC Tetris entry
program, and meet the requirements of the IOCCC. I initially
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
CURSES library with TERMINFO/TERMCAP support.
`curses` library with `TERMINFO`/`TERMCAP` support.
I plan to post followups such as unobfuscated versions and bugs
fixes to comp.editors. Reposts of the editor.101, gap.doc, and
editor.102 can be found in the same group every so often.
I plan to post follow-ups such as unobfuscated versions and bugs fixes to
comp.editors. Reposts of the editor.101, gap.doc, and editor.102 can be found
in the same group every so often.
This entry will display a file with long lines, but has trouble
scrolling the screen with long lines. Paging up and down should
work correctly, however.
This entry will display a file with long lines, but has trouble scrolling the
screen with long lines. Paging up and down should work correctly, however.
### 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
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 *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.
## [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
+16 -10
View File
@@ -151,23 +151,29 @@ eval "$(/opt/homebrew/bin/brew shellenv)"
## 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
longer fit within the year's size restrictions. For the original version see the
[/archive](/archive) directory where you can find all the original winning
entries.
longer fit within the year's size restrictions. Invariably the length of columns
and number of rows might also be changed.
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?
We do not 'maintain' the contest winners. 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
to the authors and to CC: us using the instructions on the [contacting the IOCCC
Judges](contact.hml) page.
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 an entry, we suggest that you try and email it
to the authors and to submit your fixes in a [GitHub pull
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
reasonable, we will add a web link to a copy of your email for others to see.
Note that just because you have a fix does not mean it'll be accepted. This
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?
Yes, there are types of entries that show up over and over again.
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.