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

From Esolang
Jump to navigation Jump to search
Safeword
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 C be 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 of C.
  • If there is no occurrence of word₀ after the second C, then halt.
  • Otherwise, let word₁ be the word between the second C and the second word₀.
  • If there is no occurrence of word₁ after the first one, then halt.
  • Otherwise, let word₂ be the word between the second word₀ and the second word₁.
  • If there is no occurrence of word₂ after the first one, then halt.
  • Otherwise, let word₃ be the word between the second word₁ and the second word₂.
  • If there is no occurrence of word₂ after the second one, then halt.
  • Otherwise, let word₄ be the word between the second and the third word₂.
  • Let word₅ be the word between the third word₂ 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.

External resources