Slashist

From Esolang
Jump to: navigation, search

Slashist is a language created by User:Dittoslash.

Slashist is written with lines of three letter commands.


Commands

VAR:(varname):(initial value) ~ Creates a variable (varname) with value (initial value) (string or num).

ADD:(varname):(num) ~ Adds (num) to variable (varname)

SUB:(varname):(num) ~ Takes (num) away from variable (varname).

LOP:(id) ~ Starts loop with (id), could be taken as a jump label.

ELP:(id) ~ Jumps to LOP with same (id). (ID) is three characters ONLY.

CEL:(id):(con) ~ Jumps to (id) if (con) is 1.

NCL:(id):(con) ~ Above, but if (con) is 0.

OUT:(varname) ~ Writes (varname) to output.

WRT:(something):(varname) ~ Set (varname) to the value of (something) (string or num or var).

INP:(varname) ~ Set (varname) to string from input, enter must be hit to confirm input

NUK: ~ terminate program

Constants

Strings are enclosed in quotation marks: "string"

Numbers are enclosed in curly brackets: {0}

Variable are written within tags: <name>

Conditions (for (con) arguments) are written like this: [{0} = {1}] (which returns 0). Only = and != (not equals) can be used in conditions (and of course strings, vars, and nums)

Note: Only numbers, strings, and variables can be used in conditions.

Cat program

VAR:<inp>:""

INP:<inp>

OUT<inp>

Truth machine

VAR:<choice>:""

VAR:<ZERO>:{0}

VAR:<ONE>:{1}

INP:<choice>

NCL:ZRO:[<inp> = {0}]

CEL:ONE:[<inp> = {1}]

LOP:ZRO

OUT:<ZERO>

NUK:

LOP:ONE

OUT:<ONE>

ELP:ONE