esolang

Voiced dental fricative

The sound at the start of "this". Four letters, and the machine is either voiceless or voiced.

ChuckEsoteric08 · Turing complete: no · ●●○ moderate · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: ð

The idea

ChuckEsoteric08 made Voiced dental fricative, also written ðis, from Schwa. The machine has an accumulator and two states, voiceless θ and voiced ð, named after the two sounds a "th" can have. The letter t reads input when the machine is voiceless and prints the accumulator when it is voiced. The letter h switches between the two.

Read the story

The letters ð and θ are also data. A loop ends when the accumulator holds one of them.

The machine

LetterVoicelessVoiced
tRead input into the accumulatorPrint the accumulator
dStart a loop, unless it holds ð or θThe same
hSwitch to voicedSwitch to voiceless
eGo back to the loop's start, unless it holds ð or θThe same

The machine starts voiceless with an empty accumulator, and every other character is ignored. The specification does not say how much t reads. This implementation reads a whole line, as its Schwa port does, and prints it without a line break. A loop ends only on a line that is ð or θ alone.

Example

The cat reads, switches to voiced, prints and switches back, until the input is ð or θ.

The cat reads, switches to voiced, prints and switches back, until the input is ð or θ.

Expected: catθ

Without a loop, three letters print one line.

Expected: Hello, World!

Further

Also in Turing tarpits

Write your own in Run Convert a program from Voiced dental fricative

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: voiced-dental-fricative.

Command line

shib run voiced-dental-fricative -e 'dththe' --input 'ð'
shib manual voiced-dental-fricative

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/voiced-dental-fricative.js

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

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