Wheddo

From Esolang
Jump to navigation Jump to search

Wheddo is an esolang made and posted onto this wiki by Rombito.

The Language

A singular line in a Wheddo Program is structured into 2 parts:

  1. The ID
  2. and the Code

Here, there will only be an explanation of the ID since the code is self-explanatory.

The ID

This will be a short subsection since the ID is pretty simple to explain.

The ID, represented by [X], is placed right at the beginning of a line, if otherwise, it will refer to the line with that ID instead. X could be a number or text, if left empty then it will default to the line number.

For example:

[]
[]
[]
[U]
[100]
[]

Is:

[1]
[2]
[3]
[U]
[100]
[6]

Note: This isn’t all there is, the reason is in the commands.

Other.

The language operates on variables.

underlined letters are arguments and placeholders.

The Commands
Command Functionality
!# asks for a number input X then +X.
! asks for a string input X then +X.
J:n jump to string with the ID n, brackets included. Jumping to a variable is invalid syntax.
+x makes the line’s ID refer to x, making the ID a variable.
(a)?:n If a is true, jump to n
P:n prints n
::n a comment.
~ ends the program
The Values
Value Functionality
# number
"n" string
void equivalent to “null” and “nil”.
@n outputs an ascii character

Supported operations:

  • +, -, /, % and *
  • =, > and *
  • inequality (;)
  • concatenation (,)
  • and (&) and or (:)

Lines with IDs but are empty are valid

[<<] is the actual line with the id [<<] itself by default, when J:n is called, [<<] will start referring to the line where the J:n was called unless if n is [<<] itself or the J:n doesn’t have a J:[<<] closing it off. When J:[<<] is called, [<<] will start referring to what it was previously referring to after jumping.

An example usage of this would be a routine or function

[] J:[Skip]
[Function]
[Var] +[Var]+1
[] J:[<<]
[Skip]
[Var] !#
[] J:[Function]
[] P:[Var]
[] ~

Examples

Truth Machine:

[?] !#
[] ([?]=0)?:[Z0]
[] ([?]=1)?:[Z1]
[Z0] P:[?]
[] ~
[Z1] P:[?]
[] J:[Z1]