$ bf poly.sh.pl.php.tcl.cpp.bf.py.c.lhs.txt
I’m a brainfuck program.
Rename file to compile in C/C++:
hallvar@apuk:~$ gcc p.c -o c;./c
I’m a C program (C89 with // comments, trigraphs disabled).
hallvar@apuk:~$ g++ p.c -o cp;./cp
I’m a C++ program, trigraphs disabled.
程序如下
#/*
#*/
# /*[*/ include /* \
`"""echo" eval "exec echo I\'m a sh script."`
# \
if 0; print "I'm a Perl program.\n"; __END__
puts "I'm a tcl script."; exit
*/
enum {a, b};
static int c99(void) {
#ifndef __cplusplus /*bah*/
if ((enum {b, a})0)
;
#endif
return a;
}
static int trigraphs(void) {
return sizeof "??!" == 2;
}
char X;
int main(void) {
struct X {
char a[2];
};
if (sizeof(X) != 1) {
printf("I'm a C++ program, trigraphs %sabled.\n",
trigraphs() ? "en" : "dis");
} else {
printf("I'm a C program (C%s, trigraphs %sabled).\n", c99() ? 1/
/**/2
? "89 with // comments" : "89" : "99",
trigraphs() ? "en" : "dis");
}
return 0;
}
/*
> main :: IO ()
> main = putStr "I'm a Literate Haskell program.\n"
]>++++++++[<+++++++++>-]<+.>>++++[<++++++++++>-]<-.[-]>++++++++++
[<+++++++++++>-]<-.>>++++[<++++++++>-]<.>>++++++++++[<++++++++++>
-]<---.<.>+.->>++++++++++[<+++++++++++>-]<++++.<.>>>++++++++++[<+
+++++++++>-]<+++++.<<<<+.->>>>---.<+++.---<++.-->>>>>++++++++++[<
+++++++++++>-]<---.<<<<<.<+++.>>>.<<<-.-->>>>+.<.<.<<.>++++++++++
+ +++.[-]++++++++++"""`
print "I'm a Python program." # */
阅读(1196) | 评论(0) | 转发(0) |