CDE2+

From Esolang
Jump to navigation Jump to search

CDE2+ is an esolang by Esdraslov

Commands

In CDE2+, commands parameters are separated by a T and a command ends on a E.

Command Action
MV Moves the value in parameter 1 to the cell specified in parameter 2, can only move values to empty cells
mv Moves the value in parameter 1 to the cell specified in parameter 2, can only move values to non-empty cells
CC Clears the cell specified in parameter 1
PT Prints the character with the ASCII value specified at parameter 1
Pt Prints the character with the ASCII value specified at the cell specified at parameter 1
ED Ends the program
GT Gets the user input and stores it on the cell specified at parameter 1
AD Adds the value on the cell specified at parameter 1 with the value on the cell specified at parameter 2 and stores it on the cell specified at parameter 3
SB Substract from the value on the cell specified at parameter 1 with the value on the cell specified at parameter 2 and stores it on the cell specified at parameter 3
EQ Checks if the cell specified at parameter 1 has the same value as in the cell specified at parameter 2, if false jumps to the next EL
eq Checks if the cell specified at parameter 1 has a different value as in the cell specified at parameter 2, if false jumps to the next EL
EL Only runs if a EQ or eq got false, otherwise jumps to the el
el Does nothing rather than end the EL
LP Starts a loop aslong the cell specified at parameter 1 isn't cleared (zeroed), otherwise jumps to lp
lp Ends the loop, jumps back to LP if the cell specified at parameter 1 of LP isn't cleared (zeroed)

Computational class

Cells must be explicitly specified. If the cells are unbounded, then it's Turing complete. If not, it's finite state automata.

Examples

This is a hello world program:

PT72E:PT101E:PT108E:PT108E:PT111E:PT32E:PT87E:PT111E:PT114E:PT108E:PT100E:EDE

This is a calculator program:

GT1E:GT2E:AD1T2T3E:Pt3E:EDE

This is a truth machine?

GT1E:EQ1T2E:PT48E:ELE:LP1E:PT49E:lpE:elE:EDE