Turth-machine

From Esolang
Jump to navigation Jump to search
Not to be confused with Truth-machine.

Turth-machine is a simple pseudo-code programming language created by User:A.

Syntax

Ask for <variable> Accept then store input into <variable>.
If the <thing A> <condition> <thing B> Compares <thing A> with <thing B>. A bullet point and indentation must be added.
is A condition keyword meaning "equals", i.e. used in the previous statement in the <condition> slot.
Output <value/variable> Print either a value or a variable to the console.
Whereas if <thing A> <condition> <thing B> Compares <thing A> and <thing B> if the last if statement is false. A bullet point and indentation must be added.
Repeat <value> Repeat anything in the loop value times. Same bullet point and indent.
infinitely A value that is infinite in size.

Examples

Truth-machine

Ask for input
If the input is 0
 Output 0
Whereas if input is 1
 Repeat infinitely
  Output 1

Hello World

Output "Hello World"

Cat

Ask for input
Output input

Cat until no input

Never halts, just stops asking for input if you enter a blank input. Note the space at the end of line 3.

Repeat infinitely
 Ask for input
 If the input is 
  Repeat infinitely
   If the 1 is 2
    Output 0
 Output input