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.

????

From Esolang
Jump to navigation Jump to search

"????" is a language that only operates in "if" statements. It is made to intentionally do nothing except the "????" print statement that prints "?" (what the esolang is named after). "?" initiates an if statement, and then "??" on the next line for true, or "???" for false. If false, the program halts. There is also the "????" statement from before, that goes on the third line.

Any text beside "?" is ignored, so you can make comments without signifying them.

Example program:

? init if
?? true
???? output
? init if
??? false
???? output (doesn't trigger)

IMPLEMENTATION:

# ???? interpreter
from rich import print
from sys import exit
from re import sub

ifstage = 0

# replace question/main.question with the file name #
with open("question/main.question") as file:
    lines = file.readlines()

for line in lines:
    line = line.strip()
    line = sub(r"[^?]", "", line)

    if line == "?":
        if ifstage != 1:
            ifstage = 1
        else:
            exit()
    
    elif line == "??":
        if ifstage == 1:
            ifstage = 2
        else:
            exit()
    
    elif line == "???":
        exit()

    elif line == "????":
        if ifstage == 2:
            print("?")
            ifstage = 0
        else:
            exit()