Skip to main content

Questions tagged [polyglot]

For challenges involving code that runs in multiple programming languages.

1 vote
2 answers
191 views

Many polyglots fill in the blanks between languages by either making code that is ignored in one language or loading code dynamically. This time, let's write a polyglot that works without that. This ...
user31248584's user avatar
1 vote
0 answers
90 views

Write a piece of code that is compatible with both C and Python compilers/interpreters, which can output its own source code. Quine is quite easy, but how about this double language version? Hint: To ...
NoNormalCreeper's user avatar
-2 votes
1 answer
148 views

Some built-in functions in PHP return mixed types, like file_get_contents that returns both string or ...
Olle Härstedt's user avatar
27 votes
15 answers
4k views

Task Write a polyglot in two languages that when run, outputs the name of the language it is run in. Additionally, this program must also output the other language's name if the source code is ...
emirps's user avatar
  • 1,857
6 votes
1 answer
263 views

If you consider the following PHP+C polyglot snippet, there is a problem regarding class property access in the printf call: ...
Olle Härstedt's user avatar
10 votes
9 answers
2k views

This is the robbers' thread. For the main rules to this challenge see the cops' thread In this challenge, robbers will choose a cop's vulnerable or safe post and try to figure out a pair of languages ...
Wheat Wizard's user avatar
  • 103k
22 votes
15 answers
3k views

This is the cops' thread of a cops-and-robbers challenge. The robbers' thread can be found here In this challenge as a cop you will choose two programming languages A and B, as well as a non-empty ...
Wheat Wizard's user avatar
  • 103k
6 votes
2 answers
331 views

Your task is to write a program that performs case conversion from plain text, and other case formats, into one of the specified formats below. Inputs will be either plain lowercase text, or one of ...
Dom Hastings's user avatar
  • 24.7k
-14 votes
5 answers
481 views

This is my 12th question, so I thought of this idea. Goal: Output 12, with any preceding or trailing whitespace permitted In as many languages as possible (where different versions or flags count as ...
Sunny's user avatar
  • 2,004
19 votes
3 answers
977 views

Plot contrivance You wake up to find that something has gone horribly wrong! Your time machine has malfunctioned and you are lost sometime between June 2022 and October 1991. You check the computer ...
Wheat Wizard's user avatar
  • 103k
9 votes
10 answers
830 views

Cops' challenge This cops-and-robbers challenge challenges the Cop to write a non-empty program that, when run, produces some non-empty output in language A, and, when reversed, produces some non-...
Sunny's user avatar
  • 2,004
20 votes
15 answers
2k views

Robber's challenge This cops-and-robbers challenge challenges the Cop to write a non-empty program that, when run, produces some non-empty output in language A, and, when reversed, produces some non-...
Sunny's user avatar
  • 2,004
29 votes
21 answers
5k views

Inspired/mostly copied but I don't think it's a dupe. Also Inspired. In this challenge, you will create polyglots that include all languages from previous answers, and another language which you won't ...
emanresu A's user avatar
  • 46.2k
6 votes
1 answer
727 views

Design a function or program that, when run normally, outputs the triangular numbers. However, when any single character is deleted, the program/function should not function in the original ...
Romanp's user avatar
  • 1,377
17 votes
5 answers
1k views

Hermite polynomials refer to two sequences of polynomials: The "probabilist's Hermite polynomials", given by $${He}_n(x) = (-1)^n e ^ \frac {x^2} 2 \frac {d^n} {dx^n} e ^ {-\frac {x^2} 2}$$ ...
caird coinheringaahing's user avatar

15 30 50 per page
1
2 3 4 5
8