Waduzitdo

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

Waduzitdo (What does it do?), originally spelled in all caps (WADUZITDO) as many programming languages were at the time, is a non-Turing complete derivative of PILOT. It was created by BYTE Magazine contributor Larry Kheriaty in the late 1970s as a way to put together quick and dirty demonstrations for friends not familiar with the functions of computers, and is most useful for simple question-and-answer quiz and game programs.

Commands

The one-letter commands are as follows, and the colons are part of the commands:

  • T: Output text; this command is immediately followed by the text, no quotation marks.
  • A: Accept one character of input. This command appears on a line by itself and does not have a value after it.
  • M: Character matching. Often put before a command with a branch flag, so M:x means "if the x key is pressed".
  • Y is put on the same line, with no spaces, immediately before another command, usually a text output or jump, to perform that command only when the previous character match is true, so often you will see YT:insert text here.
  • N is put on the same line, with no spaces, immediately before another command, usually a text output or jump, to perform that command only when the previous character match is false, so often you will see NT:insert text here.
  • * is put before another command, usually a text output, to indicate that it is a command that can be jumped to, also known as a section marker or program marker.
  • J: Followed by a number, this command jumps that many * section markers, so J:6 jumps to the sixth section marker from the current point. Waduzitdo cannot jump back.
  • S: This command stops execution.

User:Star651 has devised a mnemonic for remembering the list of commands; NASTY star MJ, where the star is a way of pronouncing the * symbol. The mnemonic can also be turned into a sentence, like "MJ is a nasty star", to make it even easier to remember.

Computational class

Waduzitdo is capable of implementing all deterministic finite-state transducers, but cannot implement any program other than a finite-state transducer – because it can branch based on input and has fully arbitrary jumps, it can implement a deterministic finite-state transducer pretty much directly, but has no operations that would allow for more power.

Examples

Hello, World!

T:Hello, World!
S:

Nim Game

T:Nim for Waduzitdo, exactly how it appeared in 1978! Except for this line!
T:LET'S PLAY NIM WITH 7 PEBBLES.
T:WE TAKE TURNS TAKING 1,2 OR 3.
T:THE LAST ONE TO TAKE ONE LOSES.
T:THERE ARE 7, HOW MANY ?
A:
M:1
YJ:1
M:2
YJ:2
M:3
YJ:6
T:YOU CAN TAKE ONLY 1,2, OR 3.
J:0
*T:THAT LEAVES 6, I TAKE 1 LEAVING 5.
T:HOW MANY ?
A:
M:1
YJ:5
M:2
YJ:4
M:3
YJ:3
T:YOU MUST TAKE 1,2 OR 3.
J:0
*T:THAT LEAVES 5, I TAKE 1 LEAVING 4.
T:HOW MANY ?
A:
M:1
YJ:3
M:2
YJ:2
M:3
YJ:1
T:YOU MUST TAKE 1,2 OR 3 ONLY.
J:0
*T:THAT LEAVES THE LAST ONE.
T:I TAKE IT ... YOU WIN!
J:5
*T:THAT LEAVES 2, I TAKE 1 LEAVING 1.
J:3
*T:THAT LEAVES 3, I TAKE 2 LEAVING 1.
J:2
*T:THAT LEAVES 4, I TAKE 3 LEAVING 1.
*T:HOW MANY ?
A:
M:1
NT:YOU HAVE NO CHOICE BUT TO TAKE 1.
NT:HOW MANY ?
NJ:0
T:YOU JUST TOOK THE LAST ONE ... I WIN.
*T:TO PLAY AGAIN TYPE THE DOLLAR SIGN.
S:

See also

  • EWaduzitdo, a 2024 language that is a compatible superset of Waduzitdo with variable and math features, though Turing completeness is still uncertain.

External resources