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.
Safeword
Jump to navigation
Jump to search
| Paradigm(s) | String-rewriting |
|---|---|
| Designed by | User:Hakerh400 |
| Appeared in | 2026 |
| Computational class | Unknown |
| Major implementations | Implemented |
| File extension(s) | .txt |
Safeword is an esolang invented by User:Hakerh400 in 2026.
Overview
Source code is an arbitrary string.
- If the source code is empty, halt.
- Otherwise, let
Cbe the first character from the source code. - If there is no second occurrence of
C, then halt. - Otherwise, let
word₀be the word between the first and the second occurrence ofC. - If there is no occurrence of
word₀after the secondC, then halt. - Otherwise, let
word₁be the word between the secondCand the secondword₀. - If there is no occurrence of
word₁after the first one, then halt. - Otherwise, let
word₂be the word between the secondword₀and the secondword₁. - If there is no occurrence of
word₂after the first one, then halt. - Otherwise, let
word₃be the word between the secondword₁and the secondword₂. - If there is no occurrence of
word₂after the second one, then halt. - Otherwise, let
word₄be the word between the second and the thirdword₂. - Let
word₅be the word between the thirdword₂and the end of the source code.
Replace all non-overlapping occurrences of word₃ with word₄ inside word₅. Interpret the new value of word₅ (after replacements) as a Safeword program.
Structure of the source code:
Cword₀Cword₁word₀word₂word₁word₃word₂word₄word₂word₅
Example
AAABBABBBAABBAAAABAAABBBBABBAABBBAAABABAAABAAABAAAAABBBABBBABAAABBBBAABABABBAABABBBABBAABBBAAAAA
This program exhibits a chaotic behavior and halts after exactly 11810 steps.
Computational class
Empirical testing with randomly-generated programs shows that each program either runs out of memory, or halts. We haven't found a program that loops.