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.

Mentos

From Esolang
Jump to navigation Jump to search

Mentos (ideally /ˈmɛntuːz/ MEN-tooz but you can pronounce it like the mints if you want) is an esoteric programming language made by User:not without text, where control flow comes in the form of "mention-gotos", or "mentos" for short, where mentioning a label makes the code execution jump to a specified index.

Syntax

Commands

To write a mento, write out a label followed by a colon and a zero-indexed number, indicating the line to jump to. When originally designed in 2022, the index was written in base thirty-six (hexatrigesimal), but they have been changed to decimal for simplicity. As an example,

tomato:5

would cause the code to jump to the beginning of the sixth line when "tomato" is mentioned. Labels cannot contain a colon itself, but any other character is fine.

Mentos can also be reset to other indices with the same format, which will overwrite the previous index. You can also clear the index by putting nothing after the colon:

tomato:

You can print text by putting nothing before the colon and the text after the colon. The text may include colons.

:Hello, world!

If the line of code contains a single colon : and nothing else, it will take the input and trigger any labels mentioned.

Lastly, any mento with a non-numeric index is invalid and will be ignored, thus making these suitable for comments:

comment:This is a comment

Mentions

A "mention" is detected when a label is found verbatim in the user input OR in a line of code, so long as the line contains no commands. Thus, these would be valid mentions of "tomato":

tomato sauce
tomatoes
cellular automaton

but these would not mention "tomato":

Tomato
atom atom
:tomato
tomato:3

If multiple labels are mentioned in a line at once, one of the labels will be chosen at random. This code will either skip to the fourth or fifth line:

tomayto:3
tomahto:4
tomayto tomahto

Examples

Hello, world!

:Hello, world!

Truth-machine

0:5
1:7
end:10
prompt:9
prompt
:0
end
:1
1
:

Rock, paper, scissors

skip:20
chooseRock:5
choosePaper:10
chooseScissors:15
skip
rock:31
paper:27
scissors:29
report:33
skip
rock:29
paper:31
scissors:27
report:35
skip
rock:27
paper:29
scissors:31
report:37
skip
skip:22
chooseRock choosePaper chooseScissors
:Please enter your choice (as a full word, in lowercase):
end:39
:
:You didn't make a valid move.
end
:You win!
report
:You lose!
report
:It's a draw...
report
:I chose rock.
end
:I chose paper.
end
:I chose scissors.
end

InterpretMe interpreter

*:1
:Please type your InterpretMe code:
:

Implementations

Mentos has been implemented in JavaScript here by not without text.