We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Duzitdo?

From Esolang
Jump to navigation Jump to search

Does it do? A version of Waduzitdo

The main goal of Duzitdo? is to be a easily understandable to beginners while being Turing Complete.

Instructions

All instructions have three characters followed by a colon and a space then a argument. For example:

TXT:Hello, World

Printing


TXT outputs its argument as seen in the example above.

Variables


Variables are always integers, decimals always get rounded down. Here is what a variable declaration looks like:

VAR: Example_Variable

Most commands set to a hidden variable called Stored Value

The following commands set Stored Value directly:

Storing
Command Name Meaning Function
STO Store Stores the value of the variable given as its argument into Stored Value.
LOD Load Loads Stored Value into the variable given as its argument.
CNT Constant Sets Stored Value to its argument.
ASK Ask Asks the user its argument, then sets it to Stored Value.
ADD Add Adds the variable given as its argument to Stored Value.
SUB Subtract Subtracts the variable given as its argument from Stored Value.
MUL Multiply Multiplies the variable given as its argument with Stored Value and stores it into Stored Value
DIV Divide Divides Stored Value by the variable given as its argument and stores the quotient in Stored Value.
REM Remainder Divides Stored Value by the variable given as its argument and stores the remainder in Stored Value.

There are also two ways to output a variable

Output
Command Name Meaning Function
OUT Output Outputs the variable given as its argument as a number
ASI ASCII Outputs the variable given as its argument as a ASCII character.

To output the Stored Value simply just use an output variable like this:

ASK:
VAR:Output
LOD:Output
OUT:Output

Conditionals


To handle conditionals, "Duzitdo?", as a hidden boolean called Comparison State.


The commands take in the variable given as its argument on its left and Stored Value as the argument on the right.

These are the commands (the "Function" section has been removed as it seems redundant):

Comparison
Command Name Meaning
EQL Equal
GRT Greater than
LST Less than
EGR Equal and greater than
ELS Equal and less than

There is also another command, NOT, to invert the state of Comparison State.

We can set the Comparison State by using:

  1. SYS Sets Comparison State to True (or Yes to align with Waduzitdo)
  2. SNO Sets Comparison State to False (or No to align with Waduzitdo)

Control Flow


Functions

The contents of the function is then written before DEF followed by the function's name as its argument is written again.

DEF:FunctionName
TXT:this is a function
DEF:FunctionName

There are three different ways to call a functions, two Conditional and one Unconditional.

To unconditionally call a function use the CAL function. For example:

CAL: FunctionName

Would output this is a function

To conditionally call a function use Comparison State if you don't know what that is, go here.

Calls
Command Meaning Function
YCL Yes Call Calls function if Comparison State is True/Yes
NCL No Call Calls function if Comparison State is False/No

Jumping

A label can be created by using the TAG command like this:

TAG:Label

Like functions, there are three different ways to call a functions, two Conditional and one Unconditional.

To unconditionally jump to a label use the JMP command like this:

JMP:Label

To conditionally jump to a label use Comparison State if you don't know what that is, go here.

Jumps
Command Meaning Function
YJP Yes Jump Jumps to a label if Comparison State is True/Yes
NJP No Jump Jumps to a label if Comparison State is False/No

Terminating


Finally to terminate, we use the END command.

Programs

Here are some example programs.

Hello World

TXT: Hello, World!

Cat

ASK:
VAR:Output
LOD:Output
OUT:Output
END:

4-function calculator

DEF:Addition

STO:A
ADD:B
LOD:A
OUT:A
END:

DEF:Addition

DEF:Subtraction

STO:A
SUB:B
LOD:A
OUT:A
END:

DEF:Subtraction

DEF:Multiplication

STO:A
MUL:B
LOD:A
OUT:A
END:

DEF:Multiplication

DEF:Division

STO:A
DIV:B
LOD:A
OUT:A
END:

DEF:Division

ASK:Input first number:
VAR:A
LOD:A

ASK:Input second number:
VAR:B
LOD:B

ASK:Input your operation:
VAR:Opp
LOD:Opp

CNT:0
EQL:Opp

YCL:Addition

CNT:1
EQL:Opp

YCL:Subtraction

CNT:2
EQL:Opp

YCL:Multiplication

CNT:3
EQL:Opp

YCL:Division

99 bottles of beer

CNT:1
VAR:One
LOD:One

CNT:99
VAR:Out
LOD:Out

VAR:TMP

TAG:Loop

OUT:Out
TXT: Bottles of beer on the wall, 

OUT:Out
TXT: Bottles of beer!
TXT:Take one down, pass it around,

SUB:One
LOD:Out

EQL:One
YJP:Break

OUT:Out
TXT: Bottles of beer on the wall!
TXT:

JMP:Loop
TAG:Break

TXT:1 bottle of beer on the wall,
TXT:1 bottle of beer!
TXT:Take one down, pass it around,
TXT:No bottles of beer on the wall.
END:

truth-machine

VAR:Zero
CNT:0
LOD:Zero

ASK:

TAG:Loop
TXT:1
JMP:Loop

TAG:End
TXT:0
END:

Computational Class

Duzitdo? is a turing-complete language as it can simulate a 2-register Minsky machine. We can convert Minsky machine code into Duzitdo? code like this:


We can assume that an example Duzitdo? program has two vars A and B to serve as its 2 regesters, we also need two other vars, One and Zero to help incrementing and decrementing.

Now if you want to computes something you could write it in Minsky Machine code then convert it into Duzitdo? like this:

Increment Register A/B:
    STO:A/B
    ADD:One

Decrement Register unless zero; if so jump:
    STO:A/B
    EQL:Zero
    YJP:Label
    SUB:One

In order to see this converter go to this pastebin link: https://pastebin.com/3gPu9reF