Mеmоrу
A to-do list that keeps adding "Remember" entries to itself, and prints whatever it forgot.
iddi01, 2024 · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
iddi01 made Mеmоrу in 2024, after to-do lists where an entry says "Remember x" and then needs another entry to remember that one. Three letters of the name are Cyrillic. A program is a numbered list, and the only output is the numbers of the entries the list forgot, printed as characters.
Read the story
Remembering is XOR. Being told to remember an entry a second time forgets it.
The machine
| Entry | Does when it is newly remembered |
|---|---|
n. Remember: x | Toggle every entry numbered x |
n. Remember everything above | Toggle every entry above it |
n. Remember everything below | Toggle every entry below it |
n. Occupy: x | Take the number x |
n. Do nothing | Nothing |
Only the first entry is remembered at the start. Every input character joins the list as c. Do nothing, numbered by its code. The entries act in cycles until a cycle changes nothing. Then every forgotten entry prints its number as a character, top down, and one more remembered entry joins the list at the lowest free number. It is Remember: x when one number was forgotten and Remember everything above when more were. The run ends when nothing is forgotten.
Example
The Hello World lists the letters as Do nothing entries under a first entry 0.
The Hello World lists the letters as Do nothing entries under a first entry 0. The letters are forgotten and print. The added Remember everything above brings them back and forgets the first entry, which then prints a NUL. With a first entry numbered 10 that last character is a line break.
The true cat works the same way on the input.
The empty program is a cat too, almost. Its first entry is the first input character, which is remembered, so it prints last.
The specification also has a truth machine that it says is not a true one. By the interpreter in the specification it prints the same on both inputs, 01 and then control characters with more 01 among them, and it is still running after 30 million steps.
Patterns it teaches
- Camouflage: the program reads as a to-do list.
- Self-modifying code: every cycle that forgets something adds an entry.
Further
See also
Pseudonatural
Self-modifying
Write your own in Run Convert a program from Mеmоrу
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: m-m-r.
Command line
shib run m-m-r -e '0. Do nothing' --input 'Hi'shib manual m-m-rSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/m-m-r.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org