Jim Hague, the 1986’s IOCCC winner

#define DIT (
#define DAH )
#define __DAH ++
#define DITDAH *
#define DAHDIT for
#define DIT_DAH malloc
#define DAH_DIT gets
#define _DAHDIT char
_DAHDIT _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:"
;main DIT DAH{_DAHDIT
DITDAH _DIT,DITDAH DAH_,DITDAH DIT_,
DITDAH _DIT_,DITDAH DIT_DAH DIT
DAH,DITDAH DAH_DIT DIT DAH;DAHDIT
DIT _DIT=DIT_DAH DIT 81 DAH,DIT_=_DIT
__DAH;_DIT==DAH_DIT DIT _DIT DAH;__DIT
DIT'\n'DAH DAH DAHDIT DIT DAH_=_DIT;DITDAH
DAH_;__DIT DIT DITDAH
_DIT_?_DAH DIT DITDAH DIT_ DAH:'?'DAH,__DIT
DIT' 'DAH,DAH_ __DAH DAH DAHDIT DIT
DITDAH DIT_=2,_DIT_=_DAH_; DITDAH _DIT_&&DIT
DITDAH _DIT_!=DIT DITDAH DAH_>='a'? DITDAH
DAH_&223:DITDAH DAH_ DAH DAH; DIT
DITDAH DIT_ DAH __DAH,_DIT_ __DAH DAH
DITDAH DIT_+= DIT DITDAH _DIT_>='a'? DITDAH _DIT_-'a':0
DAH;}_DAH DIT DIT_ DAH{ __DIT DIT
DIT_>3?_DAH DIT DIT_>>1 DAH:'\0'DAH;return
DIT_&1?'-':'.';}__DIT DIT DIT_ DAH _DAHDIT
DIT_;{DIT void DAH write DIT 1,&DIT_,1 DAH;}
char _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:"
;main ( ){char
* _DIT,* DAH_,* DIT_,
* _DIT_,* malloc (
),* gets ( );for
( _DIT=malloc ( 81 ),DIT_=_DIT
++;_DIT==gets ( _DIT );__DIT
('\n') ) for ( DAH_=_DIT;*
DAH_;__DIT ( *
_DIT_?_DAH ( * DIT_ ):'?'),__DIT
(' '),DAH_ ++ ) for (
* DIT_=2,_DIT_=_DAH_; * _DIT_&&(
* _DIT_!=( * DAH_>='a'? *
DAH_&223:* DAH_ ) ); (
* DIT_ ) ++,_DIT_ ++ )
* DIT_+= ( * _DIT_>='a'? * _DIT_-'a':0
);}_DAH ( DIT_ ){ __DIT (
DIT_>3?_DAH ( DIT_>>1 ):'\0');return
DIT_&1?'-':'.';}__DIT ( DIT_ ) char
DIT_;{( void ) write ( 1,&DIT_,1 );}
char _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:";
main()
{
char *_DIT, *DAH_, *DIT_, *_DIT_, *malloc(), *gets();
for(_DIT = malloc(81), DIT_ = _DIT++ ; _DIT == gets(_DIT) ;
__DIT('\n'))
for (DAH_=_DIT; *DAH_ ;
__DIT(*_DIT_ ? _DAH(*DIT_) : '?'), __DIT(' '),DAH_++)
for (*DIT_ = 2, _DIT_ = _DAH_ ; *_DIT_ && (*_DIT_ != (*DAH_ >= 'a' ? * DAH_ & 223 : *DAH_)) ; (*DIT_)++ , _DIT_++)
*DIT_ += (*_DIT_ >= 'a' ? *_DIT_ - 'a' : 0);
}
_DAH(DIT_)
{
__DIT(DIT_ > 3 ? _DAH(DIT_ >> 1) : '\0');
return DIT_ & 1 ? '-' : '.';
}
__DIT(DIT_) char DIT_;
{
(void)write(1, &DIT_, 1);
}
void _putchar(char DIT_)
{
write(1, &DIT_, 1);
}
_DAH(DIT_)
{
_putchar(DIT_ > 3 ? _DAH(DIT_ >> 1) : '\0');
return DIT_ & 1 ? '-' : '.';
}
char _DAH_[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:";
main()
{
char *_DIT, *DAH_, *DIT_, *_DIT_, *malloc(), *gets();
for(_DIT = malloc(81), DIT_ = _DIT++ ; _DIT == gets(_DIT) ;
_putchar('\n'))
for (DAH_=_DIT ; *DAH_ ;
_putchar(*_DIT_ ? _DAH(*DIT_) : '?'), _putchar(' '),DAH_++)
for (*DIT_ = 2, _DIT_ = _DAH_ ; *_DIT_ && (*_DIT_ != (*DAH_ >= 'a' ? * DAH_ & 223 : *DAH_)) ; (*DIT_)++ , _DIT_++)
*DIT_ += (*_DIT_ >= 'a' ? *_DIT_ - 'a' : 0);
}
for(_DIT = malloc(81), DIT_ = _DIT++ ; _DIT == gets(_DIT) ;
_putchar('\n'))
{
for (DAH_=_DIT ; *DAH_ ;
_putchar(*_DIT_ ? _DAH(*DIT_) : '?'), _putchar(' '),DAH_++)
{
for (*DIT_ = 2, _DIT_ = _DAH_ ; *_DIT_ && (*_DIT_ != (*DAH_ >= 'a' ? * DAH_ & 223 : *DAH_)) ; (*DIT_)++ , _DIT_++)
{
*DIT_ += (*_DIT_ >= 'a' ? *_DIT_ - 'a' : 0);
}
}
}
void _putchar(char c)
{
write(1, &c, 1);
}
tr(c)
{
_putchar(c > 3 ? tr(c >> 1) : '\0');
return c & 1 ? '-' : '.';
}
char morse[]="ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?e'b.s;i,d:";
main()
{
char *str, *copy, *c, *morse_copy, *malloc(), *gets();
for(str = malloc(81), c = str++ ; str == gets(str) ;
_putchar('\n'))
{
for (copy=str ; *copy ;
_putchar(*morse_copy ? tr(*c) : '?'), _putchar(' '),copy++)
{
for (*c = 2, morse_copy = morse ; *morse_copy && (*morse_copy != (*copy >= 'a' ? * copy & 223 : *copy)) ; (*c)++ , morse_copy++)
{
*c += (*morse_copy >= 'a' ? *morse_copy - 'a' : 0);
}
}
}
}
[pierre@ubuntu 0x0D-preprocessor] $ ./a.out
Hello, Holberton
.... . .-.. .-.. --- --..-- ? .... --- .-.. -... . .-. - --- -.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store