esolang

Waduzitdo

"What does it do?" A quiz language from BYTE magazine, small enough to type in from the specification.

Larry Kheriaty, 1978 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

Larry Kheriaty published WADUZITDO in BYTE in September 1978, under the title "How To Write a Language in 256 Words or Less". It is a cut-down PILOT, the teaching language for question and answer programs. A program prints a question, waits for one key, compares it with the answers it expects and jumps on.

Read the story

There is no arithmetic and no memory except the last key and whether it matched. Jumps go forward only, counted in * markers, except J:0, which goes back to the last A:. That is enough for any finite-state transducer and no more.

The machine

LineDoes
T:textPrint the text on its own line
A:Wait for one key
M:xMatch, is the last key x?
YT: NJ: …Y or N before a command runs it only on a match, or only without one
*Marks a line as a jump target
J:nJump to the n-th marked line ahead; J:0 goes back to the last A:
S:Stop

A: at the end of input stops the program.

Example

The truth machine waits for a key.
Expected: 0

The truth machine waits for a key. On anything but 1 it prints 0, and NJ:2 skips over the first marked line to the second, *S. On 1 it jumps to the first, a loop that prints 1 after every key.

The Nim game from 1978 plays with 7 pebbles. Take 3 and it answers "THAT LEAVES 4, I TAKE 3 LEAVING 1", the line six markers ahead. Each possible answer is a different jump distance.

Further

Ideas it shows

Also in Turing tarpits

Write your own in Run Convert a program from Waduzitdo

Implementation

JavaScript interpreter, source and command line

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

Command line

shib run waduzitdo -e 'T:Hello, World!
S:'
shib manual waduzitdo

Source

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

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

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