Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,22 @@
|
||||
#define C char
|
||||
#define F X,perror("oops"),1
|
||||
#define G getchar()
|
||||
#define I ;if(
|
||||
#define P putchar
|
||||
#define Q 256
|
||||
#define W ;while(
|
||||
#define X return 0
|
||||
#include<stdio.h>
|
||||
long M,N,c,f,m,o,r,s,w;y(l){o^=l;m+=l+1;f=f*2+l+(f>>31&1);}int
|
||||
O,S,e,i,k,n,q,t[69001];b(g){k=4 W g<k)y(P((C)(w>>--k*8)&255));w=0;}C D[Q*Q],h
|
||||
[Q*Q];main(g,V)C**V;{I**V-97)X,a()W G-10)W(g=G)+1&&g-'x')if(g-10){I
|
||||
4<k)b(0)I g>32&g<'v')w=w*85+g-33,++k;else{I
|
||||
g-'z'|k)F;w=0;k=5;}}W G-78)I scanf("%ld%lx E%lx S%lx R%lx ",&M,&N,&c,&s,&r)-5)F
|
||||
I M){b(g=3-(M-1&3))W g--)y(0);}I(M-N|c-o|s-m|r-f)&4294967295)F;X;}long
|
||||
g(){C*p I m<f&n<k&&(m=(1L<<++n)-1)||O>=S){O=0;S=fread(D,1,n,stdin)*8 I
|
||||
S<8)X-1;S-=n-1;}p=D+O/8;q=O&7;O+=n;X,(1<<8-q)-1&*p>>q|m&((15<n+q)*p[2]*Q|p[1]&
|
||||
255)<<8-q;}a(){C*p=D+Q;G;G;k=G;e=k>>7&1;k&=31 I k>16)F;w=Q
|
||||
W w--)t[w]=0,h[w]=w;n=8;f=Q+e;i=o=w=g()I o<0)X,1;P(i)W(w=g())+1){I
|
||||
w==Q&e){W w--)t[w]=0;m=n=8;f=Q I(w=g())<0)X;}c=w
|
||||
I w>=f)*p++=i,w=o W w>=Q)*p++=h[w],w=t[w];P(i=h[w])W
|
||||
p>D+Q)P(*--p)I(w=f)<1L<<k)t[w]=o,h[f++]=i;o=c;}X;}
|
||||
@@ -0,0 +1,220 @@
|
||||
Best Entropy-reducer:
|
||||
|
||||
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
|
||||
|
||||
Paul Eggert
|
||||
Twin Sun Inc.
|
||||
360 N. Sepulveda Blvd. #2055
|
||||
El Segundo, CA 90245
|
||||
USA
|
||||
|
||||
|
||||
Judges' comments:
|
||||
|
||||
The program, in its base form, implements two useful utilities:
|
||||
|
||||
atob - ascii to binary conversion
|
||||
zcat - decompression filter
|
||||
|
||||
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.
|
||||
|
||||
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.* > receive
|
||||
|
||||
The resulting file, 'receive', unpacks the input files
|
||||
even if the receiver lacks 'uncompress' and 'atob':
|
||||
|
||||
mkdir test
|
||||
cd test
|
||||
sh ../receive
|
||||
cmp ../jaw.c jaw.c
|
||||
cmp ../jaw.hint jaw.hint
|
||||
|
||||
Selected notes from the authors:
|
||||
|
||||
ABSTRACT
|
||||
|
||||
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
|
||||
|
||||
|
||||
"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 over-
|
||||
come by planting a novel Trojan Horse in the archive header
|
||||
to perform negotiationless decoding.
|
||||
|
||||
Specifically, we outline the development of an extraor-
|
||||
dinarily 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 vari-
|
||||
ants, while the underlying technique is inherently general-
|
||||
izable 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.
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
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]
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
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
|
||||
|
||||
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!
|
||||
|
||||
(1) The contest entry may be used to send its wonderful self to
|
||||
anyone in the Unix world! Virus writers need not apply...
|
||||
|
||||
(2) The basic idea is twisted enough to be patentable, but is,
|
||||
out of the 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).
|
||||
|
||||
(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.
|
||||
|
||||
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.
|
||||
|
||||
------------------------ 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 -----------------------------
|
||||
|
||||
|
||||
Shark history:
|
||||
|
||||
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', & 'atob'; size: 2303 bytes.
|
||||
|
||||
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)
|
||||
|
||||
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.
|
||||
|
||||
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 atob/zcat it replaces.
|
||||
|
||||
May 1990: 'jaw' develops experimental replacement using
|
||||
Dan Bernstein's high-compression 'squeeze'.
|
||||
|
||||
|
||||
To which we add:
|
||||
|
||||
June 1990: 'shark' wins the IOCCC, finally! :-)
|
||||
|
||||
Copyright (c) 1990, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
granted provided this this copyright and notice are included in its entirety
|
||||
and remains unaltered. All other uses must receive prior permission in writing
|
||||
from both Landon Curt Noll and Larry Bassel.
|
||||
@@ -0,0 +1,47 @@
|
||||
for i in "${@?${usage?$0 file...}}";do<"$i"||exit;done
|
||||
(cat&&tar cbf 1 - "$@"|compress|btoa&&echo w)<<\Z
|
||||
#!/bin/sh
|
||||
#
|
||||
# GENTLE READER -- write this message to file [no headers!]; run "sh file".
|
||||
#
|
||||
# [un]shark: By James A. Woods.
|
||||
# Seed planted by Karl Fox; code intensified by Paul Eggert.
|
||||
#
|
||||
# "Cleverly he dialed from within." -- D. Van Vliet, "Trout Mask Replica"
|
||||
#
|
||||
PATH=$PATH:. a=atob m=unshark z=zcat
|
||||
r="rm -f $a $m* $z" v="cc -o $z $m.c"
|
||||
trap "$r;exit 1" 1 2 13 15
|
||||
echo decoding...
|
||||
(:|compress|btoa|$a|$z)2>$m>&2||(sed '1,9s/./#define & /
|
||||
s/@/[w]/g
|
||||
s/C/char /g
|
||||
s/I/;if(/g
|
||||
s/W/;while(/g
|
||||
s/Y/%lx /g
|
||||
s/}/;}/g'>$m.c<<_&&
|
||||
FX,perror("$m bite: resend"),1;
|
||||
GgetC()
|
||||
H(w=g())
|
||||
K[69001]
|
||||
PputC
|
||||
Q256
|
||||
U*p
|
||||
Xreturn 0
|
||||
Zw=QWw--)t@=0
|
||||
#include<stdio.h>
|
||||
long M,N,c,f,m,o,r,s,w;y(l){o^=l;m+=l+1;f=f*2+l+(f>>31&1)}int
|
||||
O,S,e,i,k,n,q,t K;b(g){k=4Wg<k)y(P((C)(w>>--k*8)&255));w=0}CD K,h
|
||||
K;main(g,V)C**V;{I**V-97)X,a()WG-10)W(g=G)+1&&g-'x')if(g-10)
|
||||
{I4<k)b(0)Ig>32&g<'v')w=w*85+g-33,++k;else{Ig-'z'|k)F
|
||||
w=0;k=5}}WG-78)Iscanf("%ldYEYSYRY",&M,&N,&c,&s,&r)-5)F
|
||||
IM){b(g=3-(M-1&3))Wg--)y(0)}I(M-N|c-o|s-m|r-f)&4294967295)F X}long
|
||||
g(){CUIm<f&n<k&&(m=(1l<<++n)-1)||O>=S){O=0;S=fread(D,1,n,stdin)*8IS<8)X-1;
|
||||
S-=n-1}p=D+O/8;q=O&7;O+=n;X,(1<<8-q)-1&U>>q|m&((15<n+q)U[2]*Q|p[1]&255)<<8-q}
|
||||
a(){CU=D+Q;G;G;k=G;e=k>>7&1;k&=31Ik>16)F
|
||||
Z,h@=w;n=8;f=Q+e;i=o=HIo<0)X,1;P(i)WH+1){Iw==Q&e){Z;m=n=8;f=QIH<0)X}
|
||||
c=wIw>=f)U++=i,w=oWw>=Q)U++=h@,w=t@;P(i=h@)Wp>D+Q)P(*--p)
|
||||
I(w=f)<1l<<k)t@=o,h[f++]=i;o=c}X}
|
||||
_
|
||||
($v||$v -Mh)&&ln $z $a)&&$a<<\w>$m-&&$z<$m->$m&&tar xvf $m&&$r
|
||||
Z
|
||||
Reference in new issue
Block a user