Introduce yourself
Every variable says hello and tells its age, and every question about an age is an instruction.
None1, 2023 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
None1 made Introduce yourself in 2023. A program is small talk, one sentence a line. A variable comes into being when it introduces itself with a name and an age, and the age is its value, a whole number from 0 up without a bound. Asking how old someone is prints the value, and asking whether they are a certain age is the only test.
Read the story
A failed question skips the next sentence, and when that is a question too, the one after it as well. So a chain of questions works as one test joined with and. The specification uses that to turn brainfuck on three cells into sentences, which shows the language is Turing complete.
A program with any line that is not a sentence prints Syntax error and nothing else. That makes the quine.
The machine
| Sentence | Does |
|---|---|
Hi, I am X, I am Y years old. | Make X with the value Y, once for each X |
How old are you, X? | Print X as a number |
How old are you in character, X? | Print X modulo 256 as a byte |
The age of X is now a secret. | Read a number into X, 0 at the end of the input |
The age of X is now a secret in character. | Read a byte into X |
X: Y years later... | Add Y |
X: Y years ago... | Take Y away, unless that goes below 0 |
Are you Y years old, X? | Skip the next sentence unless X is Y |
Pardon me, please say line X again. | Jump to line X; a line that does not exist ends the run |
A name is any run of characters without whitespace, such as xL+0 or sr/4.
Example
The Hello World introduces eleven people aged 72, 101, 108 and so on, and asks each one for the age in…
The Hello World introduces eleven people aged 72, 101, 108 and so on, and asks each one for the age in character.
The truth machine reads a number, prints it and asks whether it is 1. On 0 the jump back to line 3 is skipped and the program runs off its end.
The quine is not a sentence.
The cat reads a byte, prints it and asks whether it is 0. At the end of the input it reads 0, prints that too, and then jumps to line 7 of a program with six lines, which ends the run.
Patterns it teaches
- Camouflage: the program reads as people asking each other's age.
- Turing completeness: three ages without a bound are enough to run brainfuck.
Further
- esolangs.org/wiki/Introduce_yourself
- brainfuck, which the specification translates into it.
See also
Pseudonatural
Write your own in Run Convert a program from Introduce yourself
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: introduce-yourself.
Command line
shib run introduce-yourself -e 'Syntax error'shib manual introduce-yourselfSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/introduce-yourself.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org