Merge pull request #47 from xexyl/1990
This commit is contained in:
17 files changed
+168
-95
No files matched your search
@@ -18,18 +18,17 @@
|
|||||||
|
|
||||||
### To run
|
### To run
|
||||||
|
|
||||||
echo 4 | baruch
|
echo 4 | ./baruch
|
||||||
echo 7 | baruch
|
echo 7 | ./baruch
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
This program reads an integer between 4 and 99 from the stdin.
|
This program reads an integer between 4 and 99 from the stdin.
|
||||||
|
|
||||||
NOTE: The original program did not have a newline at the end of
|
NOTE: The original program did not have a newline at the end of the file. We
|
||||||
the file. We added a final newline to the file to make
|
added a final newline to the file to make unpacking easy.
|
||||||
unpacking easy.
|
|
||||||
|
|
||||||
## Author's 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-queen problem, with a board size of up to 99x99, while
|
classic n-queen problem, with a board size of up to 99x99, while
|
||||||
@@ -61,9 +60,10 @@
|
|||||||
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:
|
The authors' further note:
|
||||||
|
|
||||||
For PC users:
|
For PC users:
|
||||||
|
|
||||||
In order to compile the program under Turbo-C or MSC, 'int '
|
In order to compile the program under Turbo-C or MSC, 'int '
|
||||||
should be inserted at the beginning of the program.
|
should be inserted at the beginning of the program.
|
||||||
For better looking results it is recommended to replace the " #Q"
|
For better looking results it is recommended to replace the " #Q"
|
||||||
|
|||||||
+12
-1
@@ -14,6 +14,17 @@
|
|||||||
|
|
||||||
./cmills [starting_cash]
|
./cmills [starting_cash]
|
||||||
|
|
||||||
|
NOTE: we used a patch from Yusuke Endoh to get this to work in modern systems
|
||||||
|
(it resulted in a bus error otherwise). Thank you Yusuke for your assistance!
|
||||||
|
|
||||||
|
### Try:
|
||||||
|
|
||||||
|
./cmills 5000
|
||||||
|
|
||||||
|
|
||||||
|
NOTE: this program uses `gets()` so you will likely get a warning under modern
|
||||||
|
systems.
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
Compile notes:
|
Compile notes:
|
||||||
@@ -32,7 +43,7 @@
|
|||||||
|
|
||||||
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 & sysV (as well as the irritating compiler I
|
portable to BSD & sysV (as well as the irritating compiler I
|
||||||
was using which assumes x=*p++ means x*=p++!). It is
|
was using which assumes `x=*p++` means `x*=p++`!). It is
|
||||||
reasonably robust in its error handling---it won't let you
|
reasonably robust in its error handling---it won't let you
|
||||||
split, double, etc. unless you actually have the cash, etc. To
|
split, double, etc. unless you actually have the cash, etc. To
|
||||||
terminate the program, hit EOF or type 0 or a negative number
|
terminate the program, hit EOF or type 0 or a negative number
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#define H(v,g)v=h(v,*g++= *r++),*g=0;
|
#define H(v,g)v=h(v,*g++= *r++),*g=0;
|
||||||
#define B(n)b(l,n),(V)printf(l
|
#define B(n)b(l,n),(V)printf(l
|
||||||
V
|
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
|
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=
|
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)
|
*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)
|
if(m==1)W(v+=11)
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ all: data ${TARGET}
|
|||||||
supernova deep_magic magic charon pluto
|
supernova deep_magic magic charon pluto
|
||||||
|
|
||||||
${PROG}: ${PROG}.c
|
${PROG}: ${PROG}.c
|
||||||
@echo "NOTE: This entry might not compile when using modern compilers."
|
|
||||||
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
${CC} ${CFLAGS} $< -o $@ ${LIBS}
|
||||||
|
|
||||||
# alternative executable
|
# alternative executable
|
||||||
|
|||||||
+14
-7
@@ -11,6 +11,9 @@
|
|||||||
make all
|
make all
|
||||||
|
|
||||||
|
|
||||||
|
Modern compilers could not compile this entry but Yusuke Endoh supplied a patch
|
||||||
|
which lets it compile. Thank you Yusuke!
|
||||||
|
|
||||||
### To run
|
### To run
|
||||||
|
|
||||||
./dds
|
./dds
|
||||||
@@ -19,21 +22,22 @@
|
|||||||
NOTE: this entry uses `gets()` so you might get a warning when compiling and
|
NOTE: this entry uses `gets()` so you might get a warning when compiling and
|
||||||
running this entry.
|
running this entry.
|
||||||
|
|
||||||
|
### Try:
|
||||||
## Judges' comments
|
|
||||||
|
|
||||||
Give the following lines as input:
|
Give the following lines as input:
|
||||||
|
|
||||||
OLD LANDER.BAS
|
OLD LANDER.BAS
|
||||||
RUN
|
RUN
|
||||||
|
|
||||||
|
NOTE: this is case sensitive.
|
||||||
|
|
||||||
|
|
||||||
|
## Judges' comments
|
||||||
|
|
||||||
|
|
||||||
Be sure not to run out of fuel!
|
Be sure not to run out of fuel!
|
||||||
|
|
||||||
|
|
||||||
Modern compilers could not compile this entry but Yusuke Endoh supplied a patch
|
|
||||||
which lets it compile. Thank you Yusuke!
|
|
||||||
|
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments
|
||||||
|
|
||||||
This is the DDS-BASIC Interpreter (Version 1.00).
|
This is the DDS-BASIC Interpreter (Version 1.00).
|
||||||
@@ -79,6 +83,7 @@ running this entry.
|
|||||||
the filename.
|
the filename.
|
||||||
- ALL INPUT MUST BE UPPERCASE.
|
- ALL INPUT MUST BE UPPERCASE.
|
||||||
|
|
||||||
|
|
||||||
Limits:
|
Limits:
|
||||||
|
|
||||||
Line numbers 1-10000
|
Line numbers 1-10000
|
||||||
@@ -91,8 +96,10 @@ running this entry.
|
|||||||
|
|
||||||
Error checking / error reports:
|
Error checking / error reports:
|
||||||
|
|
||||||
|
|
||||||
No error checking is performed.
|
No error checking is performed.
|
||||||
The message `core dumped' signifies a syntax or semantic error.
|
It might dump core if a syntax or semantic error is encountered.
|
||||||
|
|
||||||
|
|
||||||
Hosting Environment:
|
Hosting Environment:
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -10,9 +10,12 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
NOTE: This entry might not compile when using modern compilers.
|
|
||||||
|
|
||||||
### To run
|
### To run:
|
||||||
|
|
||||||
|
echo foo bar | ./dg
|
||||||
|
|
||||||
|
### Try:
|
||||||
|
|
||||||
echo "to C or not to C" | ./dg
|
echo "to C or not to C" | ./dg
|
||||||
|
|
||||||
|
|||||||
+43
-41
@@ -23,11 +23,17 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
NOTE: as `btoa` is not common we used a ruby script from Yusuke Endoh. Thank you
|
||||||
|
Yusuke for your implementation of `btoa`!
|
||||||
|
|
||||||
echo "Quartz glyph jocks vend, fix, BMW." | ./compress | ./btoa | ./jaw
|
### Try:
|
||||||
|
|
||||||
## Judges' comments
|
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
|
||||||
|
|
||||||
|
NOTE: part of this entry does not work under macOS.
|
||||||
|
|
||||||
|
|
||||||
|
## Judges' comments:
|
||||||
|
|
||||||
|
|
||||||
The program, in its base form, implements two useful utilities:
|
The program, in its base form, implements two useful utilities:
|
||||||
@@ -37,7 +43,7 @@
|
|||||||
|
|
||||||
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
|
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
|
||||||
|
|
||||||
which should apply the identity transformation to a minimal
|
which should apply the identity transformation to a minimal
|
||||||
holoalphabetic sentence.
|
holoalphabetic sentence.
|
||||||
@@ -52,7 +58,7 @@
|
|||||||
sh shark.sh jaw.* > receive
|
sh shark.sh jaw.* > receive
|
||||||
|
|
||||||
The resulting file, 'receive', unpacks the input files
|
The resulting file, 'receive', unpacks the input files
|
||||||
even if the receiver lacks 'uncompress' and 'atob':
|
even if the receiver lacks 'uncompress' and 'btoa':
|
||||||
|
|
||||||
mkdir test
|
mkdir test
|
||||||
cd test
|
cd test
|
||||||
@@ -60,7 +66,7 @@
|
|||||||
cmp ../jaw.c jaw.c
|
cmp ../jaw.c jaw.c
|
||||||
cmp ../jaw.hint jaw.hint
|
cmp ../jaw.hint jaw.hint
|
||||||
|
|
||||||
## Author's comments
|
## Authors' comments:
|
||||||
|
|
||||||
ABSTRACT
|
ABSTRACT
|
||||||
|
|
||||||
@@ -85,26 +91,23 @@
|
|||||||
the function of data compression and mail-transparency
|
the function of data compression and mail-transparency
|
||||||
encoding. On Unix, these coding format quandaries are over-
|
encoding. On Unix, these coding format quandaries are over-
|
||||||
come by planting a novel Trojan Horse in the archive header
|
come by planting a novel Trojan Horse in the archive header
|
||||||
to perform negotiationless decoding.
|
to perform negotiation-less decoding.
|
||||||
|
|
||||||
Specifically, we outline the development of an extraor-
|
Specifically, we outline the development of an extraordinarily compact
|
||||||
dinarily compact portable (un)bundler to (dis)assemble
|
portable (un)bundler to (dis)assemble data-compressed,
|
||||||
data-compressed, binary-to-ASCII-converted, length-split,
|
binary-to-ASCII-converted, length-split, and checksummed directory structures
|
||||||
and checksummed directory structures using standard Unix
|
using standard Unix tools. Miniature versions of counterparts to a Lempel-Ziv
|
||||||
tools. Miniature versions of counterparts to a Lempel-Ziv
|
coder ('compress' or 'squeeze') and an efficient bit packet- izer ('btoa') are
|
||||||
coder ('compress' or 'squeeze') and an efficient bit packet-
|
compiled on-the-fly at mail destination sites where they may not already
|
||||||
izer ('btoa') are compiled on-the-fly at mail destination
|
exist. These are written in purposefully obfuscated-C to accompany
|
||||||
sites where they may not already exist. These are written
|
similarly-shrunk shell command glue. This resulting shell archiver is dubbed
|
||||||
in purposefully obfuscated-C to accompany similarly-shrunk
|
|
||||||
shell command glue. This resulting shell archiver is dubbed
|
|
||||||
'shark'.
|
'shark'.
|
||||||
|
|
||||||
'Shark' procedure overhead consumes as few as three
|
'Shark' procedure overhead consumes as few as three dozen shell lines (or
|
||||||
dozen shell lines (or ~1100 bytes), commensurate with the
|
~1100 bytes), commensurate with the size of many Internet mail headers; it
|
||||||
size of many Internet mail headers; it amortizes favorably
|
amortizes favorably with message size. 'Shark' is portable across Unix
|
||||||
with message size. 'Shark' is portable across Unix vari-
|
variants, while the underlying technique is inherently generalizable to other
|
||||||
ants, while the underlying technique is inherently general-
|
encoding schemes.
|
||||||
izable to other encoding schemes.
|
|
||||||
|
|
||||||
In the function-theoretic sense of minimal
|
In the function-theoretic sense of minimal
|
||||||
Chaitin/Kolmogorov complexity, and within a modified Shannon
|
Chaitin/Kolmogorov complexity, and within a modified Shannon
|
||||||
@@ -140,27 +143,26 @@
|
|||||||
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 OBFUSCATION!
|
|
||||||
|
|
||||||
(1) The contest entry may be used to send its wonderful self to
|
0. This is one of the few programs you'll see WHOSE VERY UTILITY DEPENDS ON ITS
|
||||||
anyone in the Unix world! Virus writers need not apply...
|
OBFUSCATION!
|
||||||
|
|
||||||
(2) The basic idea is twisted enough to be patentable, but is,
|
1. The contest entry may be used to send its wonderful self to anyone in the
|
||||||
out of the kindness of our hearts (as well as to maintain
|
Unix world! Virus writers need not apply...
|
||||||
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).
|
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.
|
||||||
|
|
||||||
(4) "Literary" allusion. Production code contains a reference to
|
3. Meta-obfuscation is via obfuscated description (see ABSTRACT).
|
||||||
self-reference, preserved at amazing cost for sheer perversity.
|
|
||||||
|
|
||||||
(5) Many, many micro obfuscations below, honed over three years
|
4. "Literary" allusion. Production code contains a reference to self-reference,
|
||||||
time, in shell as well as C. Ask about the 'tar' pit escape,
|
preserved at amazing cost for sheer perversity.
|
||||||
the argv[0] flip, Paul's &4294967295 portability hack, the
|
|
||||||
"void where prohibited by flaw" fix, the scanf() spacesaver,
|
5. Many, many micro obfuscations below, honed over three years time, in shell as
|
||||||
shift shenanigans, signal madness, exit()ing stage left, and
|
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.
|
source-to-source transformations galore.
|
||||||
|
|
||||||
For extra credit:
|
For extra credit:
|
||||||
@@ -192,7 +194,7 @@ Shark history:
|
|||||||
|
|
||||||
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', & 'atob'; 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.
|
||||||
|
|
||||||
@@ -211,7 +213,7 @@ Shark history:
|
|||||||
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 atob/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'.
|
||||||
|
|||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
puts "xbtoa Begin"
|
||||||
|
data = $<.read
|
||||||
|
n, e, s, r = data.bytesize, 0, 0, 0
|
||||||
|
(-n % 4).times { data << 0 }
|
||||||
|
data.bytes do |b|
|
||||||
|
e, s, r = e ^ b, (s + b + 1) & 0xffffffff, (r * 2 + r[31] + b) & 0xffffffff
|
||||||
|
end
|
||||||
|
data.unpack("N*").flat_map do |v|
|
||||||
|
v == 0 ? [?z.ord] : (0..4).map {|i| v / 85**(4 - i) % 85 + 33 }
|
||||||
|
end.pack("C*").scan(/.{1,78}/) { puts $& }
|
||||||
|
puts "xbtoa End N %d %x E %x S %x R %x" % [n, n, e, s, r]
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
for i in "${@?${usage?$0 file...}}";do<"$i"||exit;done
|
for i in "${@?${usage?$0 file...}}";do<"$i"||exit;done
|
||||||
(cat&&tar cbf 1 - "$@"|compress|btoa&&echo w)<<\Z
|
(cat&&tar cbf 1 - "$@"|compress|./btoa&&echo w)<<\Z
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# GENTLE READER -- write this message to file [no headers!]; run "sh file".
|
# GENTLE READER -- write this message to file [no headers!]; run "sh file".
|
||||||
@@ -13,7 +13,7 @@ PATH=$PATH:. a=atob m=unshark z=zcat
|
|||||||
r="rm -f $a $m* $z" v="cc -o $z $m.c"
|
r="rm -f $a $m* $z" v="cc -o $z $m.c"
|
||||||
trap "$r;exit 1" 1 2 13 15
|
trap "$r;exit 1" 1 2 13 15
|
||||||
echo decoding...
|
echo decoding...
|
||||||
(:|compress|btoa|$a|$z)2>$m>&2||(sed '1,9s/./#define & /
|
(:|compress|./btoa|$a|$z)2>$m>&2||(sed '1,9s/./#define & /
|
||||||
s/@/[w]/g
|
s/@/[w]/g
|
||||||
s/C/char /g
|
s/C/char /g
|
||||||
s/I/;if(/g
|
s/I/;if(/g
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
Note that some compilers will be unable to compile the
|
Note that some compilers will be unable to compile the
|
||||||
expression 'X=g()...' in main due to lack of temporary
|
expression 'X=g()...' in main due to lack of temporary
|
||||||
value space. One might want to try replacing main with:
|
stack space. One might want to try replacing main with:
|
||||||
|
|
||||||
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();}
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,11 @@
|
|||||||
`-ansi` flag with a tip from Yusuke Endoh. Thank you Yusuke!
|
`-ansi` flag with a tip from Yusuke Endoh. Thank you Yusuke!
|
||||||
|
|
||||||
|
|
||||||
### To run
|
### To run:
|
||||||
|
|
||||||
./scjones
|
./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 was a dark and stormy night for C when the
|
hard to read. It was a dark and stormy night for C when the
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
that they didn't just simply require a more reasonable ISO
|
that they didn't just simply require a more reasonable ISO
|
||||||
character set.
|
character set.
|
||||||
|
|
||||||
## 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 entry. In accordance with the ANSI
|
strictly conforming entry. In accordance with the ANSI
|
||||||
@@ -56,13 +56,14 @@
|
|||||||
|
|
||||||
[[ The Author sent us this note after he was informed that he won ]]
|
[[ 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
|
> Although I am quite grateful for the "ANSI Committee's Worst Abuse of C" title
|
||||||
of C" title (were you aware that I am a member of the committee or
|
(were you aware that I am a member of the committee or is the double meaning
|
||||||
is the double meaning unintentional?), I was really hoping for
|
unintentional?), I was really hoping for something more along the lines of
|
||||||
something more along the lines of "Closest Resemblance to Line Noise." :-)
|
"Closest Resemblance to Line Noise." :-)
|
||||||
|
|
||||||
[[ ... it was unintentional ]]
|
[[ ... it was unintentional ]]
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 1990, Landon Curt Noll & Larry Bassel.
|
Copyright (c) 1990, Landon Curt Noll & Larry Bassel.
|
||||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||||
granted provided this this copyright and notice are included in its entirety
|
granted provided this this copyright and notice are included in its entirety
|
||||||
|
|||||||
+5
-1
@@ -13,6 +13,10 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
|
NOTE: that's not a typo but one can also do:
|
||||||
|
|
||||||
|
./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
|
||||||
@@ -42,7 +46,7 @@ WARNING: This program's 'how to compile' is too specific to a particular
|
|||||||
|
|
||||||
If everything works correctly it create an executable
|
If everything works correctly it create an executable
|
||||||
named c which checks whether your compiler supports
|
named c which checks whether your compiler supports
|
||||||
nested comments. I've stolen the "/*/*/0*/**/1" from
|
nested comments. I've stolen the `"/*/*/0*/**/1"` from
|
||||||
somewhere so don't give me any points for it. Of
|
somewhere so don't give me any points for it. Of
|
||||||
course neither ANSI nor K&R support nested comments
|
course neither ANSI nor K&R support nested comments
|
||||||
when properly implemented, but what the heck.
|
when properly implemented, but what the heck.
|
||||||
|
|||||||
+20
-9
@@ -1,10 +1,17 @@
|
|||||||
# Best Utility
|
# Best Utility
|
||||||
|
|
||||||
Byron Rakitzis Sean Dorward
|
Byron Rakitzis
|
||||||
Princeton University Princeton University
|
Princeton University
|
||||||
5707 Old Lodge Dr. 10274 Burleigh Cottage Lane
|
5707 Old Lodge Dr.
|
||||||
Houston, TX 77066 Ellicott City, MD 21043
|
Houston, TX 77066
|
||||||
USA USA
|
USA
|
||||||
|
|
||||||
|
Sean Dorward
|
||||||
|
Princeton University
|
||||||
|
10274 Burleigh Cottage Lane
|
||||||
|
Ellicott City, MD 21043
|
||||||
|
USA
|
||||||
|
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -16,10 +23,13 @@
|
|||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
This program implements a subject a well known Un*x utility whose
|
|
||||||
original source was considered to be extremely obfuscated by many
|
This program touches on a well known Unix utility, the 6th edition Bourne Shell
|
||||||
people, excluding its author. In fact, this utility was a major
|
(`/bin/sh`), whose original source was considered to be extremely obfuscated by
|
||||||
inspiration for the formation of this contest.
|
many people (although Steve Bourne might disagree). Did you know that the Bourne
|
||||||
|
Shell source was a major inspiration for the formation of the IOCCC back in
|
||||||
|
1984?
|
||||||
|
|
||||||
|
|
||||||
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:
|
||||||
@@ -40,6 +50,7 @@
|
|||||||
returns void but we were able to get it to compile by using the comma
|
returns void but we were able to get it to compile by using the comma
|
||||||
operator which we also did in the smaller version.
|
operator which we also did in the smaller version.
|
||||||
|
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments
|
||||||
|
|
||||||
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
|
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
|
||||||
|
|||||||
+23
-11
@@ -11,26 +11,36 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
NOTE: thanks to Yusuke Endoh for the pointing out that `atof()` nowadays needs
|
||||||
|
`#include <stdlib.h>` in order to get this to work. Thanks also to Cody Boone
|
||||||
|
Ferguson for fixing some segfaults under modern (and in some cases earlier)
|
||||||
|
systems with this entry.
|
||||||
|
|
||||||
./theorem y 0 1 0.1 1
|
|
||||||
|
|
||||||
## Judges' comments
|
## To run:
|
||||||
|
|
||||||
The program's source implements four functions, all from the
|
./theorem expression x1 x2 h y1
|
||||||
same source file!
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
|
|
||||||
theorem expression x1 x2 h y1
|
|
||||||
|
|
||||||
where:
|
where:
|
||||||
|
|
||||||
expression - function f(x,y) (see below)
|
expression - function f(x,y) (see below)
|
||||||
x1 - start of interval
|
x1 - start of interval
|
||||||
x2 - end of interval
|
x2 - end of interval
|
||||||
h - step size
|
h - step size
|
||||||
y1 - initial value (y(x1) == y1)
|
y1 - initial value (y(x1) == y1)
|
||||||
|
|
||||||
|
|
||||||
|
## Try:
|
||||||
|
|
||||||
|
./theorem y 0 1 0.1 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Judges' comments:
|
||||||
|
|
||||||
|
The program's source implements four functions, all from the
|
||||||
|
same source file!
|
||||||
|
|
||||||
When you compile theorem.c as is and run with 5 args, it numerically
|
When you compile theorem.c as is and run with 5 args, it numerically
|
||||||
solves the equation y'=f(x,y), with a step size of h, over the interval
|
solves the equation y'=f(x,y), with a step size of h, over the interval
|
||||||
x=[x1,x2], with the initial condition of y(x1)=y1.
|
x=[x1,x2], with the initial condition of y(x1)=y1.
|
||||||
@@ -82,8 +92,10 @@
|
|||||||
conference, it received a standing ovation; a first for
|
conference, it received a standing ovation; a first for
|
||||||
a contest entry.
|
a contest entry.
|
||||||
|
|
||||||
It should be noted that the 4 trailing args '0 0 0 0', are
|
Originally we noted that the 4 trailing args '0 0 0 0' were required on systems
|
||||||
required on systems that dump core when NULL is dereferenced.
|
that dump core when NULL is dereferenced but this problem showed itself in
|
||||||
|
modern systems even with the 4 '0 0 0 0'. To make this easier for users Cody
|
||||||
|
Boone Ferguson kindly fixed this problem.
|
||||||
|
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#define X
|
#define X
|
||||||
#define Y {}
|
#define Y {}
|
||||||
#define C }
|
#define C }
|
||||||
#define o {
|
#define o {
|
||||||
#undef main
|
#undef main
|
||||||
char m[500][99],v[99],R;
|
char m[500][99],v[99],R,*a;
|
||||||
int*a,b,n,i,j,W,A;
|
int b,n,i,j,W,A;
|
||||||
float Q,G,D,M,T,B,O,U,V,N,y,e();
|
float Q,G,D,M,T,B,O,U,V,N,y,e();
|
||||||
P(g,R,u)float*g,R,u;{int c;for(*g=1,c=u;c--;*g*=R);}
|
P(g,R,u)float*g,R,u;{int c;for(*g=1,c=u;c--;*g*=R);}
|
||||||
X
|
X
|
||||||
@@ -77,7 +79,7 @@ for(j=0;j<n;puts(j++[m]));
|
|||||||
e("",O,O,a);
|
e("",O,O,a);
|
||||||
n=j-(O=1);
|
n=j-(O=1);
|
||||||
while(gets(j++[m]));
|
while(gets(j++[m]));
|
||||||
if(!strcmp(*++a,"-r"))S();
|
if(!strcmp(++a,"-r"))S();
|
||||||
C
|
C
|
||||||
/**/main(A,a)int A;char*a[];
|
/**/main(A,a)int A;char*a[];
|
||||||
Y
|
Y
|
||||||
@@ -90,4 +92,6 @@ float Q,G,D,M,T,O,B,U,V,N,e();
|
|||||||
#define o }
|
#define o }
|
||||||
#define C {
|
#define C {
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -16,6 +16,10 @@
|
|||||||
|
|
||||||
./westley 1
|
./westley 1
|
||||||
|
|
||||||
|
NOTE: this entry will segfault without an arg and will enter an infinite loop if
|
||||||
|
input is not a number (or is a negative number).
|
||||||
|
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
usage: westley <number>
|
usage: westley <number>
|
||||||
|
|||||||
+4
-1
@@ -912,7 +912,7 @@ Contest </I></FONT></CENTER>
|
|||||||
<LI>A minor bug that shows up in some cases was found by
|
<LI>A minor bug that shows up in some cases was found by
|
||||||
<a href="winners.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a>
|
<a href="winners.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a>
|
||||||
when working on his <a href="#2020_ferguson2">2020 Enigma machine</a>. See his
|
when working on his <a href="#2020_ferguson2">2020 Enigma machine</a>. See his
|
||||||
README.md file for details (search for vik).
|
README.md file for details (search for vik).</LI>
|
||||||
</UL>
|
</UL>
|
||||||
<A NAME="2014_wiedijk"></A>
|
<A NAME="2014_wiedijk"></A>
|
||||||
<P><B>wiedijk</B> - Y combinator</P>
|
<P><B>wiedijk</B> - Y combinator</P>
|
||||||
@@ -2938,6 +2938,9 @@ README.md file for details (search for vik).
|
|||||||
<UL TYPE=square>
|
<UL TYPE=square>
|
||||||
<LI><A HREF="1990/theorem/Makefile">Makefile</A>
|
<LI><A HREF="1990/theorem/Makefile">Makefile</A>
|
||||||
<LI><A HREF="1990/theorem/theorem.c">theorem.c</A>
|
<LI><A HREF="1990/theorem/theorem.c">theorem.c</A>
|
||||||
|
<LI><a href="winners.html#Cody_Boone_Ferguson">Cody Boone Ferguson</a> fixed
|
||||||
|
some segfaults under modern systems (and in some cases older systems) in this
|
||||||
|
entry. Thank you Cody!</LI>
|
||||||
</UL>
|
</UL>
|
||||||
<A NAME="1990_westley"></A>
|
<A NAME="1990_westley"></A>
|
||||||
<P><B>westley</B> - poetic exchange between lovers, prints "luvs me, luvs not"</P>
|
<P><B>westley</B> - poetic exchange between lovers, prints "luvs me, luvs not"</P>
|
||||||
|
|||||||
Reference in new issue
Block a user