esolang

SR

Five numbers and a seeded generator. The program never says what to print; it starts a chain of numbers that happens to spell it.

None1, 2024 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: hello

The idea

None1 made SR in 2024, after Seed. The name stands for Seeded Random. A program is five numbers, A B C D E. The machine prints a character for A, then sets A to (A*B+C) mod D, E times over. That is a linear congruential generator, one of the oldest ways to make random numbers.

Read the story

So a program never names its characters. To print a word you search for five numbers whose chain lands on the right letters. The specification's examples were all found by the genetic algorithm in its Python reference, and it guesses, without proof, that every text can be printed this way.

The machine

StepDoes
PrintThe character at place A mod 96 of a table that runs from space to ~ and ends with a line feed
NextA becomes (A*B+C) mod D
RepeatE times in all

The specification lists its table from !, but its examples and its Python reference start at space, where h is place 72. This implementation follows the reference. Mod works as in Python, so the result takes the sign of D. There is no input and no loop beyond the count E, so every program stops.

Example

Take 72 40 127 258 2.
Expected: hi
Expected: Nope.

Take 72 40 127 258 2. Place 72 is h. Then A becomes 72 * 40 + 127 = 3,007, and 3,007 mod 258 is

  1. Place 169 mod 96 = 73 is i, and after two characters the run ends. The third program is the

one the specification calls its interpreter for the language Nope.

Patterns it teaches

Further

Zero-dimensional languages

Write your own in Run Convert a program from SR

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: sr.

Command line

shib run sr -e '72 40 127 258 2'
shib manual sr

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/sr.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org