📜 ⬆️ ⬇️

Best unreadable code

All of us are used to writing bad / often, often - unreadable code, resulting in disgruntled faces of colleagues. But if we really love writing unreadable code, we will try to be the best. And so, the best discomfort-coders 2011.

Winner of competition

#include <iostream>

class ___000___
{
public :
___ 000 ___ ( int _) {m_____ = _; }
~ ___ 000 ___ () {}
')
void _1_2_3_4_5_ () {std :: cout << m_____; }
int ____ 2_2 ___ () { return m_____ * m_____; }
private :
int m_____;
};

int main ()
{
int _ = 0,
__ = 0,
___ = 0;
double ____ = 0.0,
_____ = 0.0;
std :: cin >> _ >> __ >> ___;
std :: cin >> ____ >> _____;
int _0_ = (_ + __) * (___ + static_cast < int > (____) / static_cast < int > (_____));
___000___ _________ (_ 0_);
_________._ 1_2_3_4_5_ ();
____ = static_cast < double > (_________.____ 2_2 ___ ());

___ 000 ___ * ____0______ = new ___ 000 ___ (____);

return ____ 0 ______-> ____ 2_2 ___ ();

}


The winner showed even greater perversity, giving an example of a pattern:

template < typename ___>
___ 8_9 _ (___ _, ___ __)
{
___ ____ = _ + __;
return ____;
}


Second place

This code appeared after Chris Kaspersky's article, where I saw an essay in C / C ++.
Paraphrasing, I got C ++ on the contrary, or almost the opposite, meet Alien C ++:

tni niam zuk zuk2
sezam
tni a = 15;
elboud b = 20.0;
tni res = a + tsac_citats baidu tni renren zuk b zuk2;
dts :: tuoc << res << dts :: ldne;

nruter 0;
sezam2

Perfectly working code, but not without include, after which everything becomes clear:

#include <iostream> // well this is clear
#include "alienator.h"

Insides alienator.h:
#define tni int
#define niam main
#define nruter return
#define elboud double
#define tsac_citats static_cast
#define dts std
#define tuoc cout
#define ldne endl
#define zuk (
#define zuk2)
#define sezam {
#define sezam2}
#define baidu <
#define renren>


No one took the third place, because the participants and the audience ran to cover their mouths ...

Source: https://habr.com/ru/post/128008/


All Articles