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,42 @@
|
||||
#include<unistd.h>
|
||||
#include<time.h>
|
||||
|
||||
#define k ("C9B7351A@D-/E+F?')G>H%J#=I"[(d[(i/13)*2]*91+d[(i/13)*2+1]-3220)&(\
|
||||
4096>>(i%13))?l+1:l]-59)
|
||||
#define g(n)e(n<13?n:n<20?n+1:n>20?11+n/10:13,0);e(n>12&&n<20?26:n>20&&n%10?n%\
|
||||
10:-1,2);
|
||||
#define x(n)g(localtime(&a)->tm_##n)
|
||||
|
||||
unsigned char *d="KZs2ITTwhwZYvec@JbYxOjf9-TZRGDb/el7#q(`SZ#|_neTwq\\MqJ5cVgte\
|
||||
K-ReK-(Mq8+D'6Ui0tG88vXJ-Tu{VI=d%cR]h7CumwBq\\-#{thj8fw$OEfEvLHP13_##w.OD[7Cw2\
|
||||
]<T{|[F}L;L:*+A#PwLnp{9'M3Mr|w_|unm'}$*(5]_$?O9zO{{wz4p6vP8Ipu}$BQospf=-Isnyl'\
|
||||
|g53o^c`ov-P`-x+|ZAd<e?<'b9P|LkZOf{B-8`K([srqv&gy1,:}$|s7D{yN6M#cQyKpC|*_|#xA#\
|
||||
'YfQ}$k$kr7dM#dcnWDg|PHdA#^j&q}$x@(a;k2JB]50ZKp{xRwbkTm.v\\a3fJ@V[`J#fN`s|sZeH\
|
||||
mmHX7`JKiry4sm,bUfz69{rt'k*pBq^l,ut6UVvb9N%r%l:Py3r[.Z/pBkaz2J4u{GTu)hyp#%gbS$\
|
||||
r`mzi9G|3M,r}-Dt?w)_##%fQt$k&n]e$HzFXu(|Fvt`i#$A#|ykrz+nhs'P#|pm*9[_#,5P#}$}$x\
|
||||
&s(i,HzO'&d&g?/_$P#kZ7Dn]e$J{zi8ypi|hq$_.|cLx`sy;f8GRMQM#7R5$hym*:^`sxrvtfQ|z_\
|
||||
N|ye[7dH[}#Ts\\59V@|#z}$}$y;usL)vXFiA0AukZ8H|fyKurd]|s5<|xq@Cpm,}${,e$KufO?/2M\
|
||||
t$zmM#vtfQ|zRKlEA#P&fPOwJ#pf_$?/2#@|$w}$?fLxA#^-}$cM^aA#&g#wIv?^|yY#s)Lwt'K#ON\
|
||||
yoXKYkpCl0m}D[9OGU7n([ZrL)[8eRy7uR*PJ#^5xRG>zSf>p]ZrJ_[9q?qgYe^4$r3lY$4SdsSyNv\
|
||||
J_l&w2I?q#fN*F1n|s9OGUv|w&l+pR-3Nudtyn@|Dfq#^o|s9Pt=oZCol/{VdgkLdwyn1yDed}?Dzi\
|
||||
}#Kje#d}Y${8pSt<q?qgIv|`DH?9}$O{k(LgE;|KU-tJnWOw*F@YP#|yY$b4|.50[2d}D'kaqhp;JE\
|
||||
$r&fH&'6nykYGCv>K$t?yLbwtUn[F{ncOx_.:K#nwF#f|HQs&<&bfQPE?:uJm*&\\S=*/@|We*w@$@\
|
||||
f0,*H])WL<i@^xX@)(a.>MV*p{Zqf&zH%###################u2#A#_$A#_$A#_$A#_$@tA#QI#\
|
||||
3#0&:p#?1[P*6WQ@i#C1{[;@|1}S%^r#g.d^z#M}$ziZe|kU6oZbq5$kF]4[E^nA#_.|}e$Ku^r&WA\
|
||||
#_$?/*P_$@t&gA#[;_$A#^j2#A#_*d}@v^z#8?D?D9Q`s}$5$L|u<3JC/xVz;#s^{?9$M}$x_Y,7uP\
|
||||
$",p[6789];
|
||||
|
||||
int o[]={145,1145,1745,2545,3045,4045,4345,5145,5745,6369},i=0,j=0,l=0;
|
||||
|
||||
void e(n,h){
|
||||
for(j=0;n>0;n-=!(p[j++]^9));
|
||||
for(;!n&&j[p]^9;j++)write(1,p+p[j][o],o[p[j]+1]-p[j][o]);
|
||||
for(i=0;i<h[o];i++)write(1,d+7,1);}
|
||||
|
||||
int main(){
|
||||
time_t a=time(&a);
|
||||
|
||||
for(;i<8476;j[p]=k>=0?j<*o?k-2:(p[j+1]=k<<4):0,j+=k>=0?1+(j>=*o):0,
|
||||
l=-k*(k<0),i++);e(21,4);x(hour)e(22,1);x(min)e(23,1);e(25,0);x(sec)e(24,0);
|
||||
|
||||
return;}
|
||||
@@ -0,0 +1,136 @@
|
||||
Most obfuscated sound:
|
||||
|
||||
Pierre-Philippe Coupard
|
||||
Lineo, Inc.
|
||||
ATTN : Pierre-Philippe Coupard
|
||||
390 South 400 West
|
||||
Lindon, UT 84042
|
||||
USA
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make coupard
|
||||
|
||||
Try:
|
||||
|
||||
./coupard > /dev/audio
|
||||
-or-
|
||||
./coupard > /dev/sound/dsp
|
||||
|
||||
You may need to run this a few times to understand exactly what is
|
||||
being said. You might even need to look somewhere on your desktop,
|
||||
your arm or the wall for confirmation.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Past years' IOCCC entries do many marvellous things in small packages,
|
||||
such as console utilities, games, math, languages or even X
|
||||
applications. But they all have one thing in common (despite being hard
|
||||
to read obviously) : when they interact with the user, they only
|
||||
*display* things, i.e. they display either text or drawings.
|
||||
|
||||
So, for a change, this program titillates the sense of hearing instead
|
||||
of sight : this program is a self-contained speech synthesizer that
|
||||
tells the current time through the computer's sound card - in just under
|
||||
2 Kb of source code !
|
||||
|
||||
In the 2001 IOCCC rules and guidelines documents, there is no mention of
|
||||
what is or isn't acceptable regarding audio I/Os, but it is mentioned
|
||||
that hardware-specific and/or non-portable programs are not welcome. So,
|
||||
in order to do audio and satisfy those requirements, the format required
|
||||
by /dev/audio has been chosen : /dev/audio is a rather ancient
|
||||
fixed-format audio interface that is supported by the majority of Unices
|
||||
that can do sound, as a lowest-denominator sound I/Os interface.
|
||||
|
||||
Program usage :
|
||||
|
||||
* To listen to what the program says directly, invoke
|
||||
|
||||
./coupard > /dev/audio
|
||||
|
||||
the program then speaks out something like
|
||||
|
||||
"The time is HH hours MM minutes SS seconds"
|
||||
|
||||
in military time (24 hours). Of course, you need to have permissions
|
||||
to write to /dev/audio, have your sound card enabled, the volume up,
|
||||
the speakers connected ... :-)
|
||||
|
||||
* If you want to convert the audio output of the program into another
|
||||
audio format, you can pipe it to sox for example (sox is the
|
||||
Swiss army knife of Unix audio tools) : the command
|
||||
|
||||
./coupard | sox -c1 -r8000 -tub - -c2 -r44100 -twav test.wav
|
||||
|
||||
converts the output of the program into a 44.1KHz stereo .WAV
|
||||
file and saves it into "test.wav".
|
||||
|
||||
The output format of the program is 8KHz, unsigned 8-bit samples.
|
||||
|
||||
NOTE : the program's return code is meaningless
|
||||
|
||||
Audio quality :
|
||||
|
||||
The quality of the sound produced by the program is cross between a
|
||||
yogurt-pot-and-string telephone and a bad gramophone, i.e. the S/N
|
||||
ratio is very low and the signal's top frequency is very low as well.
|
||||
This is because the audio is stored internally at a sampling rate of
|
||||
4KHz (the Nyquist frequency is only 2KHz) with only 4-bit samples
|
||||
(adding 24db of quantization noise to an already poor signal).
|
||||
|
||||
In short, you might have to listen twice to understand what the
|
||||
program is saying. 2048 bytes including the sound generation program
|
||||
doesn't leave much room for audio quality ;-)
|
||||
|
||||
Speech generation :
|
||||
|
||||
Only 9 phonemes are used to generate the speech. Beside the limited
|
||||
number of words the program has to generate (66 words), the low sound
|
||||
quality is actually exploited to take liberties with certain
|
||||
consonants (for example, "s" and "f" sound very much the same at 4KHz,
|
||||
so they can be merged into one phoneme). Because the psychoacoustic
|
||||
context around those phonemes is just sufficient, the words can be
|
||||
interpreted correctly most of the time despite the fact that they are
|
||||
pronounced quite wrongly.
|
||||
|
||||
Internally, a table is used to generate most of the words, and
|
||||
composite words such as "thirty-five" are made up by the C code
|
||||
externally.
|
||||
|
||||
Data compression :
|
||||
|
||||
Even at 4KHz / 4 bits, the weight of all the phoneme samples and the
|
||||
word-to-phonemes table put together is over 1600 bytes, which is well
|
||||
over 2048 bytes when encoded in a C string made of printable
|
||||
characters. Therefore, a compression method was needed that's both
|
||||
efficient and with a decompressor that is implementable in the
|
||||
shortest amount of code possible. GSM compression is very good, but
|
||||
needs large psychoacoustic tables to regenerate the original
|
||||
signal. Raw FFT spectral compression is efficient too, but the
|
||||
decompression code can't be made small enough.
|
||||
|
||||
The best compression compromise was found using a simple Huffman
|
||||
compressor, and encoding the compressed data by blocks of 13 bits in
|
||||
pairs of printable ASCII characters : the raw data is compressed to
|
||||
8465 bits, and the resulting C string is therefore about 1300
|
||||
characters, which leaves just enough room for the decompressor with a
|
||||
hard-coded Huffman tree, and the code that plays the phonemes in the
|
||||
right order.
|
||||
|
||||
Note on compiler warnings and lint :
|
||||
|
||||
The program should build with gcc's -Wall -Werror and -ansi flags. If
|
||||
the -pedantic flag is used, gcc will complain about the length of the
|
||||
data string and the sign of its type, and also the fact that main()
|
||||
returns with no value. The confusion with the sign of the char type
|
||||
doesn't matter with the data string because it's composed only of
|
||||
printable characters under 127.
|
||||
|
||||
When linting the program with lclint, it complains about a huge list
|
||||
of things that, if corrected to make lint happy, would probably double
|
||||
the size of the source code.
|
||||
|
||||
Reference in new issue
Block a user