All Questions

Filter by
Sorted by
Tagged with
8
votes
3answers
309 views

Polyglot Interpreters

Challenge Choose any number of languages. Call this set L. Write a program so that running it in any language in L produces an interpreter for a different language ...
18
votes
10answers
2k views

Make a polyglot generator

A polyglot is a program that runs in several languages. Your challenge is to: Choose at least two languages (Different versions count as different languages) Create a program or function that takes ...
10
votes
6answers
1k views

Polyglot self-interpreter time

Your task is to make a program which interprets the language it is run in, but also works in many languages. Let's say you make a Brainfuck-Underload self-interpreglot, as it will be called. Run in ...
0
votes
1answer
213 views

Polyglot Iterative Quine

Introduction A polyglot is a program that is valid in multiple languages at once. An iterative quine is a program that outputs another program that outputs another program that outputs the source of ...
-2
votes
2answers
270 views

Write a “hello world” program that can be compiled/interpreted as two different languages simultaneously [duplicate]

Rules: Your program must print "hello world" when executed Your program must be interpretable or compilable into 2 or more languages Your program must require no input or arguments Languages with ...
12
votes
21answers
1k views

An OEIS polyglot

This is an answer-chaining challenge relating to the OEIS. Oh, the justification for this is because a company needs one program to print out their OEIS sequences real bad and they have every ...
5
votes
2answers
629 views

A Multipurpose Quine

I personally love quines, but they all seem to be so... static. So why not create a quine that can do more. Challenge The challenge here is to create a quine that without any sort of input is a ...
11
votes
5answers
665 views

Quine of orders

Write a program that, when run in different languages, outputs a different byte permutation of the code in each language. The exact source code is counted as one permutation. Here "different language"...
42
votes
33answers
15k views

Wait, what language is this?

Recently I had the pleasure of writing a Haskell program that could detect if the NegativeLiterals extension was engaged. I came up with the following: ...
72
votes
15answers
12k views

Hello World in Multiple Languages

Task Create a program or a function that is valid in multiple programming languages, and when compiled/interpreted as a different language outputs "Hello, World!" in a different natural language. ...
58
votes
54answers
10k views

Determine your language's version

Your challenge is to write a polyglot that works in different versions of your language. When run, it will always output the language version. Rules Your program should work in at least two versions ...
24
votes
6answers
1k views

Polyglot the (non constant) OEIS!

Disclaimer: This is heavily inspired by "Polyglot the OEIS!" but fixes the problem that lead to closure (see the output section) and was re-posted as to not invalidate answers. Introduction ...
41
votes
12answers
3k views

Polyglot the OEIS! [duplicate]

Note: This challenge has been moved to Polyglot the (non constant) OEIS! to avoid closure. Introduction We all know and love the on-line encyclopedia of integer sequences (OEIS). So what if we made ...
20
votes
6answers
1k views

Anaglot Polygrams

Task Write some code that can be rearranged into n different programs in n different languages each outputting a distinct number from 1 to n. No two languages should be the same however different ...
5
votes
3answers
616 views

The Big Bang Polyglot [duplicate]

Everyone loves The Big Bang Theory, right? And everyone loves polyglots, right? So let's combine them! Task Your task in each language is quite basic. You must output the name of the one of the 5 main ...
22
votes
7answers
751 views

Print Polyglot Pieces

Typically, polyglots are constructed in such a manner that each language can ignore parts of the code that are present for other languages, by wrapping them in string literals, using comment syntax, ...
18
votes
1answer
596 views

Make a regex polyglot

Write a regex that works in at least 2 regex flavors (or versions), and match a different string in each flavor (or version) it is running in. The strings to be matched in this challenge are the ...
13
votes
10answers
905 views

Multi-lingual Challenge

After all the fun we've had with polyglot challenges in the (recent) past, how about a challenge where the output can be in two languages? Your answer needs to accept boolean input ...
8
votes
1answer
433 views

Comment-free polyglot with different, nontrivial, behaviour per language

This challenge is inspired by this other challenge, which you may want to read first for some context. However, a competitive answer is likely to look very different, so after reading some posts on ...
39
votes
15answers
3k views

What will you bring for Thanksgiving?

Thanksgiving in the United States is coming up on November 24th. Many people will have a large dinner with their families, traditionally including turkey and many side dishes. This typically means the ...
93
votes
19answers
16k views

When was this language released?

Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that ...
26
votes
2answers
2k views

Write a Palindrome-Polyglot-Quine

Write a "palipolyquine": a program that is a quine, a polyglot, and a palindrome. Rules: The number of polyglot languages is more preferable than code size. The shortest answer (in bytes) wins, in ...
-1
votes
1answer
474 views

“I know that language - that's Java. No? It's Perl?” [duplicate]

Introduction A known fact is that Jon Skeet can code Perl and make it look like Java. In this challenge you will try to do something similar. Challenge Write a piece of code of any length that can ...
3
votes
0answers
294 views

Windows batch polyglot/hybrids challenge with any language possible [closed]

/* I hope such question is suitable for here*/ As the batch scripts are pretty limited, hybrid files that embed a code from another language into a batch file are used a lot lately. Though usually ...
17
votes
4answers
1k views

An executable script file that runs on POSIX and Windows

Challenge: write a single script file foo.cmd which can be invoked from the vanilla Windows cmd.exe prompt (not PowerShell, not ...
100
votes
40answers
13k views

The Versatile Integer Printer

Write a piece of code that is executable in at least three different languages. The code must output the integer 1 in language number one, ...
12
votes
3answers
1k views

Carrots. So. Many. Carrots

The Inspiration The Task You must create a program, that, in as many languages as possible, replaces every instance of ^ with a markdown formatted link (meaning ...
37
votes
5answers
1k views

Overcoming cluster size

Fed up with the reliability of flash storage, you decided to store all your programs on one of those good old 1,440 KiB floppies. However, after copying not even 3,000 programs, the disk was full. How'...
11
votes
1answer
576 views

Non-Palindromic Polyglot Boggle

Introduction The number 101 is a palindrome, since it reads the same backwards and forwards. The number 105 is not. However, 105 in base eight is written as 151, which is palindromic. On the other ...
1
vote
0answers
646 views

The polyglot challenge! [duplicate]

A polyglot is a program which can be run by several different language's interpreters/compilers without failing. For example, the stackoverflow 404 page contains a polyglot which runs in Python, Perl,...
11
votes
5answers
1k views

Just Another Polyglot Hacker! [duplicate]

Make a program which prints just another #{LANG} hacker where #{LANG} is the name of the language with which the program is ...
14
votes
13answers
2k views

Write a Program in Disguise [closed]

The challenge is to create a program that solves any one of the HQ9+ problems while looking like another language. Note: This is not a golf challenge. Rules: The program must perform one of the ...
70
votes
16answers
6k views

Write a polyglot that prints the language's name

Your task is to write a program that executes in as many languages as possible, with as few characters as you can. To avoid trivial solutions, the program must print the name of the language it was ...
29
votes
2answers
4k views

What code compiles in the most number of languages? [closed]

Excluding trivial programs, what code compiles in the most number of languages? (By "trivial" I mean to exclude answers such as the empty program or text that will be echoed directly.) The following ...
7
votes
3answers
813 views

Acrostic polyglot programming [closed]

The challenge is to write an acrostic piece of code. When read normally (horizontally), the code should take an input string and remove all but the first character on each line. For example, the ...