Do-code

From Esolang
Jump to navigation Jump to search

This language is made by User:Unicodes

Do-code runs on a array of 2048 numbers from 0 to 255, where there is a program pointer at cell 0.

Syntax

Every statement run has to be in a "do (#)" block.

There are 2 types of do blocks: "do (#)" and "do (do (#) and do (#))".

The # are nested do blocks or instructions.

Instructions
Instruction Action
+p move pointer index by 1
-p move pointer index by -1
+i add 1 to current pointed value
-i add -1 to current pointed value
n nothing
pr print current character as number
pra print current character as ascii character
rd set current pointed value to inputted character index
rdn set current pointed value to inputted number
q quit

Do block attachments are bits of text that change the condition of execution of the do block.

Do block attachments (X can be a number between 0 & 255)
Attachment Action
if X > pt do (#) executes the do block if X is bigger than current pointed value
if X = pt do (#) executes the do block if X is equal to current pointed value
if X < pt do (#) executes the do block if X is smaller than current pointed value
if X >= pt do (#) executes the do block if X is bigger or equal to current pointed value
if X <= pt do (#) executes the do block if X is smaller or equal to current pointed value
if X <> pt do (#) executes the do block if X is not equal to current pointed value
wh X > pt do (#) executes the do block repeatedly while X is bigger than current pointed value
wh X > pt do (#) executes the do block repeatedly while X is bigger than current pointed value
wh X = pt do (#) executes the do block repeatedly while X is equal to current pointed value
wh X < pt do (#) executes the do block repeatedly while X is smaller than current pointed value
wh X >= pt do (#) executes the do block repeatedly while X is bigger or equal to current pointed value
wh X <= pt do (#) executes the do block repeatedly while X is smaller or equal to current pointed value
wh X <> pt do (#) executes the do block repeatedly while X is not equal to current pointed value


You can make a comment like this: | comment |

Examples

Truth Machine

do ( do ( rdn ) and do ( wh 1 = pt do ( pr ) and do ( pr ) )