◙ /prog/ Challenge [Vol. λfx.f (f x)] ◙
1
Name:
Anonymous
2011-03-27 4:19
THE CHALLENGE : Write a program that outputs the name of the programming language it is executed/compiled in.
HOWEVER : You program must be a polyglot in as much languages as possible: for example, when run as a C program it prints "C", as a Python script it prints "Python", etc.
The deadline is 04/04/2011 00:00 UTC. The winner is the program valid in the most programming languages .
(When programs tie, their lengths in bytes decide who wins.)
2
Name:
Anonymous
2011-03-27 4:22
(To get you started, here's an example Python/Ruby program.)
"#{puts 'Ruby';exit}"; print 'Python'
3
Name:
Anonymous
2011-03-27 4:47
main = putStrLn "Haskell"
4
Name:
Anonymous
2011-03-27 4:51
'lisp
5
Name:
Anonymous
2011-03-27 4:56
This depends on how different the comment (and compile-time conditional expression) syntax of various languages is.
6
Name:
Anonymous
2011-03-27 4:59
#define trash..........v
// v"befunge"<
// v:,_@
// > ^
int main()
{
puts("SEE");
return 0;
}
7
Name:
Anonymous
2011-03-27 5:01
Missed a space.
8
Name:
Anonymous
2011-03-27 5:35
#<html> <p> HTML</p> </html>
<!-- print 'python' -->
9
Name:
Anonymous
2011-03-27 8:13
++++++++++[>+++++++>+++++++++++>++++++++++>+<<<<-]>----.>++++.>---.++++++++.+++++.--------.<+++.>---.++++++++.>.
10
Name:
ed
2011-03-27 9:18
>>8
Allow me to expand on your solution. Corrected the bugs and now works in
THREE LANGUAGES.
#<html><?php die('PHP'); ?>HTML</html>
#<!--;
print 'python'
#--!>
11
Name:
Anonymous
2011-03-27 9:50
programming language
HTML
user your brain, not your ANUS
12
Name:
Anonymous
2011-03-27 11:59
HTM L
MARKUP
NOT PROGRAMMING
Well, at least we have
>>10
13
Name:
Anonymous
2011-03-27 12:07
>>10
Make it start with
#.(progn (print 'lisp) (loop))
and you have Common Lisp working too. Define some reader macros if you have #< to work too (just have it eat all input) without causing an error (the loop is there to avoid that piece of code being compiled, assuming you're running in an interpreter).
14
Name:
Anonymous
2011-03-27 12:09
There's no need to do anything for Perl, as everything is VALID PERL CODE .
15
Name:
Anonymous
2011-03-27 14:04
>>4
Valid Lisp, Scheme, Racket, Arc, Croma Lisp, MacLisp and Clojure code.
16
Name:
Anonymous
2011-03-27 17:00
>>15
You forgot to list every source revision in each of those branches.
17
Name:
Anonymous
2011-03-28 2:42
BAMPV
18
Name:
Anonymous
2011-03-28 5:09
; x() {-0;} main(){ puts("C"); } /*
; -} =0;main = putStrLn "Haskell" {-
(println "Clojure")
; -} -- */
19
Name:
Anonymous
2011-03-28 5:47
21
Name:
Anonymous
2011-03-28 7:12
// #|[
#include <stdio.h>
#define heha() int main(int argc,char **argv) { puts("C++"); } /*
def heha
puts 'RUBY'
end
#]++++++++[->++++++++<]>+[->+>+<<]>+.++++++++++++++++.>.++++++++.+++++.--------.<+++.>---.++++++++.[-][ */
heha()
//#]|#(print 'LISP)
22
Name:
Anonymous
2011-03-28 7:51
23
Name:
Anonymous
2011-03-28 7:56
>>12
HTML stands for Hypertext
ML .
24
Name:
Anonymous
2011-03-28 8:35
OCAML ISN'T A PROGRAMMING LANGUAGE
25
Name:
Anonymous
2011-03-28 12:26
26
Name:
Anonymous
2011-03-28 20:54
#define bf ">++++++++[<++++++++>-]<++.>+++++++[<+++++++>-]<-.>++++[<---->-]<-.>+++[<+++>-]<-.>++[<++>-]<+.>+++[<--->-]<+.>++++[<++++>-]<-.>++++[<---->-]<--.>+++[<+++>-]<->"
#include <stdio.h>
#ifdef notdefined
'''
#endif
int main(){
printf("C");
#ifdef __cplusplus
printf("++");
#endif
return 0;
}
#ifdef notdefined
'''
print("Python")
#endif
27
Name:
Anonymous
2011-03-28 20:55
>>26
#if 0
[expert]OMG OPTIMIBRIZRIVED[/sppert]
28
Name:
1
2011-03-29 8:00
Great submissions so far! Let's tally up the scores so far.
>>21 :
4 (C++, Ruby, Brainfuck, Lisp)
>>26 :
4 (Brainfuck, C, C++, Python)
>>18 :
3 (C, Haskell, Clojure)
>>6 :
2 (C, Befunge)
>>10 :
2 (PHP, Python)
>>3 :
1 (Haskell)
Some others were
disqualified :
'lisp relies on the REPL, and is not a full program. HTML isn't a programming language, you dolts.
Oh, and a hint: you can easily embed Befunge code into any polyglot. See
>>6 .
29
Name:
Anonymous
2011-03-29 8:14
30
Name:
Anonymous
2011-03-29 8:30
>>28
What
is a full Lisp program? Almost everyone uses stuff from the REPL. Very few Lisp programs actually run by a default
main function, and it's actually non-standard functionality to provide such a thing (even though all real implementations do).
31
Name:
Anonymous
2011-03-29 9:07
>>28
well if it is not cheating
#ifdef v
''' >"egnufeB":v
[v:,_@]
> ^
'''
#endif
#define bf ">++++++++[<++++++++>-]<++.>+++++++[<+++++++>-]<-.>++++[<---->-]<-.>+++[<+++>-]<-.>++[<++>-]<+.>+++[<--->-]<+.>++++[<++++>-]<-.>++++[<---->-]<--.>+++[<+++>-]<->"
#include <stdio.h>
#ifdef notdefined
'''
#endif
int main(){
printf("C");
#ifdef __cplusplus
printf("++");
#endif
return 0;
}
#ifdef notdefined
'''
print("Python")
#endif
32
Name:
Anonymous
2011-03-29 9:36
>>31
actually let's combine bf and defunge together for further lulz
#ifdef v
'''>+++>"egnufeB":v<++++
+[<++++++++>-][v:,_@]<++
.>+++++++[<++++> ^<+++>
-]<-.>++++[<---->-]<-.>+
++[<+++>-]<-.>++[<++>-]<
+.>+++[<--->-]<+.>++++[<
++++>-]<-.>++++[<---->-]
<--.>+++[<+++>-]<->'''
#endif
#include <stdio.h>
#if 0
'''
#endif
int main(){
printf("C");
#ifdef __cplusplus
printf("++");
#endif
return 0;
}
#if 0
'''
print("Python")
#endif
33
Name:
Anonymous
2011-03-29 9:46
>>32
You can also add ruby by using
>>2
"#{puts 'Ruby';exit}"; print 'Python'
34
Name:
Anonymous
2011-03-29 11:57
>>32
Easy with the lulz there, progrider.
35
Name:
Anonymous
2011-03-29 13:24
>>34
Why, do you think lulz isn't a cromulent word to use on this board, faggot?
36
Name:
Anonymous
2011-03-29 13:33
>>35
Cromulent considered not cromulent.
37
Name:
Anonymous
2011-03-29 13:42
Xarn uses Cromulent Linux.
38
Name:
Anonymous
2011-03-29 13:51
39
Name:
Anonymous
2011-03-29 15:10
>>37
Xarn despises "the simpsons" and all other plebeian comedy.
40
Name:
Anonymous
2011-03-29 15:33
41
Name:
Anonymous
2011-03-29 16:13
>>39
then why has he seen every episode, ``faggot'' ?
42
Name:
Anonymous
2011-03-30 10:24
>>the answer to life the universe and everything
GET
43
Name:
Anonymous
2011-03-30 10:37
>>41
Because of my email field.
44
Name:
Anonymous
2011-03-30 11:06
45
Name:
Anonymous
2011-03-30 15:21
46
Name:
Anonymous
2011-03-30 23:20
47
Name:
Anonymous
2011-03-31 20:49
48
Name:
Anonymous
2011-04-01 0:24
49
Name:
BLACK HITLER
2011-04-01 1:51
░░░░░░░░░░░░░░░▄░░░░░░░░░░░░░░░
░░░░░░░░░░░░░▄▀█░░░░░░░░░░░░░░░
░░░░░░░░░░░▄▀░░█░░░░░░░░░░░░░░░
░░░░░░░░░▄▀░░▄▀░░░░░░░░░░░░░░░░
░░░░░░░░█▄░▄▀░░░░░░░░▄█▄░░░░░░░
░░░░░░░░█░▀▄░░░░░░░▄▀░█░▀▄░░░░░
░░░░░░░░▀▄░░▀▄░░░▄▀░░▄▀▄░░▀▄░░░
░▄░░░░░░░░▀▄░░▀▄▀░░▄▀░░░▀▄░░▀▄░
░█▀▄░░░░░░░░▀▄▀█▀▄▀░░░░░░░▀▄░█░
░█░░▀▄░░░░░▄▀░░█░░▀▄░░░░░░░░▀█░
░░▀▄░░▀▄░▄▀░░▄▀░▀▄░░▀▄░░░░░░░░░
░░░░▀▄░░█░░▄▀░░░░░▀▄░▄█░░░░░░░░
░░░░░░▀▄█▄▀░░░░░░░░▄▀░█░░░░░░░░
░░░░░░░░▀░░░░░░░░▄▀░░▄▀░░░░░░░░
░░░░░░░░░░░░░░░▄▀░░▄▀░░░░░░░░░░
░░░░░░░░░░░░░░░█░▄▀░░░░░░░░░░░░
░░░░░░░░░░░░░░░█▀░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░█▄░█░█░▄▀▀▄░░█░░█░█▀▀░▀█▀░█░░░
░█░█▄░█░█░▄▄░░█▄▄█░█▄▄░░█░░█░░░
░█░░█░█░▀▄▄▀░░█░░█░█▄▄░▄█▄░█▄▄░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
glory BLACK AFRIKA
HEIL NIGGERS.
HEIL BLACK AFRIKA.
NIG HEIL BLACK HITLER!
50
Name:
Anonymous
2011-04-01 2:18
51
Name:
Anonymous
2011-04-01 2:54
Mod this thread up!
52
Name:
Anonymous
2011-04-03 0:36
53
Name:
Anonymous
2011-04-04 4:59
TODAY IS THE DAY
>>32 wins.
54
Name:
Anonymous
2011-04-04 11:12
More good challenges, please.
55
Name:
Anonymous
2011-04-06 21:56
<-- that's cool and all, but check 'em
56
Name:
Anonymous
2013-06-18 19:42
I ARE ANDRU
57
Name:
Anonymous
2013-06-18 19:43
I ARE ANDRU
58
Name:
Anonymous
2013-06-18 19:50
I ARE ANDRU
59
Name:
Anonymous
2013-06-18 19:57
I ARE ANDRU
60
Name:
Anonymous
2013-06-18 20:04
I ARE ANDRU
61
Name:
Anonymous
2013-06-18 20:12
I ARE ANDRU
62
Name:
Anonymous
2013-06-18 20:19
I ARE ANDRU
63
Name:
Anonymous
2013-06-18 20:26
I ARE ANDRU
64
Name:
Anonymous
2013-06-18 20:33
I ARE ANDRU
65
Name:
Anonymous
2013-06-18 20:40
I ARE ANDRU
66
Name:
Anonymous
2013-06-18 20:47
I ARE ANDRU
67
Name:
Anonymous
2013-06-18 20:54
I ARE ANDRU
68
Name:
Anonymous
2013-06-18 21:01
I ARE ANDRU
69
Name:
Anonymous
2013-06-18 21:08
I ARE ANDRU
70
Name:
Anonymous
2013-06-18 21:16
I ARE ANDRU
71
Name:
Anonymous
2013-06-18 21:23
I ARE ANDRU
72
Name:
Anonymous
2013-06-18 21:30
I ARE ANDRU
73
Name:
Anonymous
2013-06-18 21:37
I ARE ANDRU
74
Name:
Anonymous
2013-06-18 21:44
I ARE ANDRU
75
Name:
Anonymous
2013-06-18 21:52
I ARE ANDRU
76
Name:
Anonymous
2013-06-18 21:59
I ARE ANDRU
77
Name:
Anonymous
2013-06-18 22:06
I ARE ANDRU
78
Name:
Anonymous
2013-06-18 22:13
I ARE ANDRU
79
Name:
Anonymous
2013-06-18 22:21
I ARE ANDRU
80
Name:
Anonymous
2013-06-18 22:28
I ARE ANDRU
81
Name:
Anonymous
2013-06-18 22:35
I ARE ANDRU
82
Name:
Anonymous
2013-06-18 22:42
I ARE ANDRU
83
Name:
Anonymous
2013-06-18 22:49
I ARE ANDRU
84
Name:
Anonymous
2013-06-18 22:53
HAI
CAN HAS STDIO?
VISIBLE "LOLCODE"
KTHXBYE
85
Name:
Anonymous
2013-06-18 22:56
I ARE ANDRU
86
Name:
Anonymous
2013-06-18 23:03
I ARE ANDRU
87
Name:
Anonymous
2013-06-18 23:10
I ARE ANDRU
88
Name:
Anonymous
2013-06-18 23:17
I ARE ANDRU
89
Name:
Anonymous
2013-06-18 23:24
I ARE ANDRU
90
Name:
Anonymous
2013-06-18 23:31
I ARE ANDRU
91
Name:
Anonymous
2013-06-18 23:38
I ARE ANDRU
92
Name:
Anonymous
2013-06-18 23:45
I ARE ANDRU
93
Name:
Anonymous
2013-06-18 23:52
I ARE ANDRU
94
Name:
Anonymous
2013-06-18 23:59
I ARE ANDRU
95
Name:
Anonymous
2013-06-19 0:06
I ARE ANDRU
96
Name:
Anonymous
2013-06-19 0:13
I ARE ANDRU
97
Name:
Anonymous
2013-06-19 0:20
I ARE ANDRU
98
Name:
Anonymous
2013-06-19 0:27
I ARE ANDRU
99
Name:
Anonymous
2013-06-19 0:34
I ARE ANDRU
100
Name:
Anonymous
2013-06-19 0:41
I ARE ANDRU
101
Name:
Anonymous
2013-06-19 0:48
I ARE ANDRU
102
Name:
Anonymous
2013-06-19 0:55
I ARE ANDRU
103
Name:
Anonymous
2013-06-19 1:02
I ARE ANDRU
104
Name:
Anonymous
2013-06-19 1:09
I ARE ANDRU
105
Name:
Anonymous
2013-06-19 1:16
I ARE ANDRU
106
Name:
Anonymous
2013-06-19 1:23
I ARE ANDRU
107
Name:
Anonymous
2013-06-19 1:29
I ARE ANDRU
108
Name:
Anonymous
2013-06-19 1:37
I ARE ANDRU
109
Name:
Anonymous
2013-06-19 1:43
I ARE ANDRU
110
Name:
Anonymous
2013-06-19 1:50
I ARE ANDRU
111
Name:
Anonymous
2013-06-19 1:57
I ARE ANDRU
112
Name:
Anonymous
2013-06-19 2:04
I ARE ANDRU
113
Name:
Anonymous
2013-06-19 2:11
I ARE ANDRU
114
Name:
Anonymous
2013-06-19 2:18
I ARE ANDRU
115
Name:
Anonymous
2013-06-19 2:25
I ARE ANDRU
116
Name:
Anonymous
2013-06-19 2:32
I ARE ANDRU
117
Name:
Anonymous
2013-06-19 2:39
I ARE ANDRU
118
Name:
Anonymous
2013-06-19 2:46
I ARE ANDRU
119
Name:
Anonymous
2013-06-19 2:53
I ARE ANDRU
120
Name:
Anonymous
2013-06-19 3:00
I ARE ANDRU
121
Name:
Anonymous
2013-06-19 3:07
I ARE ANDRU
122
Name:
Anonymous
2013-06-19 3:14
I ARE ANDRU
123
Name:
Anonymous
2013-06-19 3:21
I ARE ANDRU
124
Name:
Anonymous
2013-06-19 3:28
I ARE ANDRU
125
Name:
Anonymous
2013-06-19 3:35
I ARE ANDRU
126
Name:
Anonymous
2013-06-19 3:42
I ARE ANDRU
127
Name:
Anonymous
2013-06-19 3:49
I ARE ANDRU
128
Name:
Anonymous
2013-06-19 3:56
I ARE ANDRU
129
Name:
Anonymous
2013-06-19 4:03
I ARE ANDRU
130
Name:
Anonymous
2013-06-19 4:10
I ARE ANDRU
131
Name:
Anonymous
2013-06-19 4:17
I ARE ANDRU
132
Name:
Anonymous
2013-06-19 4:24
I ARE ANDRU
133
Name:
Anonymous
2013-06-19 4:31
I ARE ANDRU
134
Name:
Anonymous
2013-06-19 4:38
I ARE ANDRU
135
Name:
Anonymous
2013-06-19 4:45
I ARE ANDRU
136
Name:
Anonymous
2013-06-19 4:52
I ARE ANDRU
137
Name:
Anonymous
2013-06-19 4:59
I ARE ANDRU
138
Name:
Anonymous
2013-06-19 5:06
I ARE ANDRU
139
Name:
Anonymous
2013-06-19 5:13
I ARE ANDRU
140
Name:
Anonymous
2013-06-19 5:20
I ARE ANDRU
141
Name:
Anonymous
2013-06-19 5:27
I ARE ANDRU
142
Name:
Anonymous
2013-06-19 5:34
I ARE ANDRU
143
Name:
Anonymous
2013-06-19 5:40
I ARE ANDRU
144
Name:
Anonymous
2013-06-19 5:47
I ARE ANDRU
145
Name:
Anonymous
2013-06-19 5:54
I ARE ANDRU
146
Name:
Anonymous
2013-06-19 6:01
I ARE ANDRU
147
Name:
Anonymous
2013-06-19 6:08
I ARE ANDRU
148
Name:
Anonymous
2013-06-19 6:16
I ARE ANDRU
149
Name:
Anonymous
2013-06-19 6:23
I ARE ANDRU
150
Name:
Anonymous
2013-06-19 6:30
I ARE ANDRU
151
Name:
Anonymous
2013-06-19 6:36
I ARE ANDRU
152
Name:
Anonymous
2013-06-19 6:43
I ARE ANDRU
153
Name:
Anonymous
2013-06-19 6:50
I ARE ANDRU
154
Name:
Anonymous
2013-06-19 6:57
I ARE ANDRU
155
Name:
Anonymous
2013-06-19 7:04
I ARE ANDRU
156
Name:
Anonymous
2013-06-19 7:11
I ARE ANDRU
157
Name:
Anonymous
2013-06-19 7:18
I ARE ANDRU