206
votes
Trick or Treat polyglot
Python / Windows Batch, 25 bytes
print"trick"#||echo.treat
Everything after the # is interpreted as a comment by python, while the || is an OR in batch, saying ...
171
votes
Accepted
When was this language released?
A Brief History of 2D Programming Languages: 16 (+2) years
...
159
votes
Trick or Treat polyglot
Whitespace / Starry, 135 bytes
Here's to a clear night sky on Halloween!
+ + + + +
+
* + +* + *
+ *
+ +
+* +
+* + . + . + +* +...
154
votes
Accepted
Trick or Treat polyglot
2sable / pl, 8 bytes
0000000: 74 72 65 61 74 93 d0 cb treat...
Both programs have been tested locally with the same 8 byte file, so this ...
153
votes
The Versatile Integer Printer
15 languages, 68 66 65 bytes / 15^3 = 0.019...
Retina, Starry, Prelude, ETA, Axo, Labyrinth, Hexagony, Foo, Brian & Chuck, Gol><>, evil, Whitespace, Fission, ><> and GolfScript.
After a ...
140
votes
140
votes
Determine your language's version
Python 3.0 and Python 2, score 6
(12 bytes, 2 versions)
print(3/2*2)
Try it Online:
Python 2
Python 3
Relies on the fact that Python 3+ uses float division by ...
119
votes
When was this language released?
15 years, Python
Versions: 0.9.1, 2.0.0, 2.2.0, 2.2.2, 2.5.0, 2.5.1, 3.0.0, 3.1.0, 3.1.3, 3.2.1, 3.3.0, 3.3.3, 3.4.0, 3.5.0 and 3.6.0a4. Versions not linked can be found on the downloads page.
The ...
104
votes
100
votes
Accepted
98
votes
Calculate a square and a square root!
C and C++, 68 65 bytes
#include<math.h>
float f(float n){auto p=.5;return pow(n,2-p*3);}
Original answer:
...
96
votes
Trick or Treat polyglot
Python / Perl, 28 bytes
print([]and"trick"or"treat")
Explanation
Since [] is an ArrayRef in Perl, it's truthy, but it's an ...
87
votes
Add a language to a polyglot
Note: If you see this first, you might want to sort by oldest
17. Julia (128 bytes)
...
70
votes
Determine your language's version
Java, 400 bytes, 17 versions, score = 23,52
Supported versions: 1.0, 1.1, 1.2, ...
64
votes
61
votes
Rock, Polyglot, Scissors
Python, brainfuck and JavaScript, 103 99 bytes Yay under 100 bytes!
...
56
votes
55
votes
When was this language released?
Short and sweet; the three APLs (K, J201, Dyalog 7.1) in 8 bytes
1993+1^2
1993 plus...
K: the first 1 integer {0} except {2}, i.e. {0}; 1993 – Try it online!
J: ...
55
votes
Calculate a square and a square root!
Python 2 & Python 3, 23 21 bytes
lambda n:n**(1/2or 2)
Python 2.x produces n^2, Python 3.x produces ...
49
votes
Accepted
Calculate a square and a square root!
Jolf and MATL, 1 byte
U
Square root in Jolf, square in MATL.
Try it online! (MATL)
Try the Jolf code. Only works on Firefox.
These are both 1 byte, as MATL and ...
48
votes
Trick or Treat polyglot
PHP / JavaScript, 32 30 bytes
Displays trick in PHP and treat in JS.
...
47
votes
When was this language released?
10 years, 12 languages, 2430 bytes
This answer is a collaboration between myself and user 1000000000.
A brief language list:
...
44
votes
The Versatile Integer Printer
Python 1.x, 2.x and 3.x, 32 bytes / 3^3 = 1.1851...
import sys
print(sys.version[0])
Prints the first number of the version, which is ...
41
votes
Rock, Polyglot, Scissors
Python 2, Ruby, Retina, 90 83 bytes
-7 bytes thanks to Value Ink
s=['rock','paper','scissors']
print s[s.index((0and gets or input()))+(0and-2or-1)]
Try it ...
41
votes
This code errors on *this* and *that*, is it really written in them?
Python 2 / Python 3, 60 bytes
print("This program errors out in Python %d :P"%(3/2*2))*1;a
Python 2 got ...
40
votes
40
votes
Accepted
Hello World in Multiple Languages
23 Befunges, 713 bytes
The only language I really know is Befunge, so instead of multiple languages, I've just gone with multiple implementations of Befunge. I believe this is still valid under PPCG ...
39
votes
Trick or Treat polyglot
HTML / HTML+JavaScript, 53 bytes
treat<script>document.body.innerHTML='trick'</script>
treat is the document´s text ...
39
votes
Polyglot the OEIS!
26 languages: C, C++, Cubically, rk, what, Bash, Morse, Ook!, str, Charcoal, Commercial, S.I.L.O.S, memescript, Forked, TRANSCRIPT, Braingolf, Fission, Arcyou, Beam, Beatnik, Cood, COW, Emoji, ><>, ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
polyglot × 107code-golf × 42
code-challenge × 38
quine × 17
rosetta-stone × 13
cops-and-robbers × 12
sequence × 10
popularity-contest × 10
answer-chaining × 9
string × 8
math × 6
kolmogorov-complexity × 5
code-generation × 4
hello-world × 4
number × 3
ascii-art × 3
restricted-source × 3
tips × 3
source-layout × 3
palindrome × 3
c × 3
arithmetic × 2
interpreter × 2
natural-language × 2
unicode × 2