59
u/taneth Mar 19 '14
I once encountered a bunch of defines that turned c++ into Delphi, just so a heap of code could be brought over from another project with minimal syntactic changes. It actually worked.
7
u/Delta-62 Mar 24 '14
Would you happen to have a link?
10
u/taneth Mar 24 '14
Not working for that company anymore. But there's something similar somewhere on TheDailyWTF, I think they were trying to turn that one into BASIC.
28
5
5
5
u/sfriniks Mar 24 '14
This reminds me of when I first found #define. My friend and I spent a while #define-ing so we could write lolcode and have it compile. It actually worked, too. I wish I still had that header file...
2
u/autowikibot Mar 24 '14
LOLCODE is an esoteric programming language inspired by lolspeak, the language expressed in examples of the lolcat Internet meme. The language was created in 2007 by Adam Lindsay, researcher at the Computing Department of Lancaster University.
The language is not clearly defined in terms of operator priorities and correct syntax, but several functioning interpreters and compilers already exist. One interpretation of the language has been proven Turing-complete.
Interesting: Esoteric programming ^language | ^Lolcat | List of Hello world program ^examples | Parrot virtual ^machine
Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words
3
2
2
1
u/Dragonfelx Mar 19 '14
This is actually pretty cool. I like the concept of telling a function "bye" to end it.
1
u/coffeedrinkingprole Mar 24 '14
When I was 12 I did this kind of thing with DOS .bat files to make myself feel like a 1337 movie hacker
1
-5
Mar 21 '14
Using a break command is the sign of a poor programmer. I hope that is why it's in this sub.
0
Mar 19 '14
[deleted]
162
u/kernalphage Mar 19 '14
#ifdef _DEBUG_ #define TRUE (rand() % 9999)51
u/RenaKunisaki Mar 19 '14
#define if(x) if((x) && (rand() > 700)) #define while if #define int float #define stderr stdout #define sizeof(x) (sizeof(x) + 16) #define memcpy strncpy #define malloc(s) malloc((s) - 4) #undef EACCES #define EACCES ENOENTnot tested, may not work, use at your own peril.
94
38
3
10
u/504Dug Mar 19 '14
<ooc> What editor is this in? Sublime? I really like that look and feel </ooc>