esolang

Trow

Lists of words and sentences with holes in them. Each hole takes a word from its list.

2021 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 5 known programs · Test method

Run it

Expected: Hello world!

The idea

Trow is an output only language from 2021 that makes random sentences. A program names lists of words and then prints lines. Wherever a line says <name>, Trow puts in one item of that list, picked at random. There are no variables, no loops and no input, so every program ends.

The machine

LineDoes
[name]Start a list
"item"Add an item to the list above it
- textPrint the text and a line feed, each <name> replaced by a random item of that list
# textA comment, up to the end of the line

The specification does not say where the chance comes from. In this implementation the picks come from a fixed seed, so a program prints the same sentences on every run.

Example

Every <name> draws again, even from the same list.
Expected: Hello friends!

Every <name> draws again, even from the same list. The specification gives this one with the output below as its example; the other three ways to fill the two holes can come out as well.

Expected: I love eating burgers! pizzas are bad for our health!

Further

Ideas it shows

Also in Strange time

Write your own in Run Convert a program from Trow

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run trow -e '- Hello world!'
shib manual trow

Source

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

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

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