2xNeg

From Esolang
Jump to navigation Jump to search

2xNeg is an esoteric programming language based on two types of negation.

Syntax

   COMMAND : (NOPARCOMMAND|ONEPARCOMMAND|TWOPARCOMMAND)
   NOPARCOMMAND : ("v"|"{"|"?")
   ONEPARCOMMAND : ("~"|"-"|"}"|"!") PARAMETER
   TWOPACOMMAND : ">" PARAMETER PARAMETER
   PARAMETER : (COMMAND +) "^"

Commands

   v

Pushes 0 on the stack.

   ^

Pops anything from the stack as parameter for the preceding operator.

   ~

Bit-negates the following parameter.

   -

Negates the following parameter.

  > 

Pushes 1 on the stack if parameter 1 is bigger than parameter 2, else pushes 0.

   {

Marker for a loop.

   }

Jumps back to the first { found in a reverse search if parameter 1 > 0

   !

Outputs the first parameter as ASCII char.

   ?

Inputs a char, which will be converted to an ASCII number and pushes it on stack.