We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

ConstantLanguage()

From Esolang
Jump to navigation Jump to search

ConstantLanguage() is an esolang made by WarzokERNST135 in which its only functionality is to make a constant language.
Here is an example of the constant language "Hello, world!":

ConstantLanguage("Hello, world!")

It works like this:

When the code is run, it asks for user input and then just outputs "Hello, world!".


Here is an example, this time, of a constant language in which it outputs "ooh" normally but when you input "ooh" it outputs "oooooh":

QuineAvoiding("ooh", "oooooh")

It works like this:

When the code is run, it asks for user input and then outputs "ooh". But if the user input is "ooh", then it instead outputs "oooooh".

Interpreter

Python

Python code can be injected, so be careful with untrusted programs.

ConstantLanguage=lambda x:(input(),print(x))
QuineAvoiding=lambda x,y:print(y if input()==x else x)
exec(input())

Alternated without using lambda

def ConstantLanguage(x):
    input()
    print(x)
def QuineAvoiding(x, y):
    print(y if input() == x else x)
exec(input())