Minus Standard Extensions

Minus Home
What is Minus?
Basics
Proof of Concept
Extensions
Implementations
Examples
Files
Self Interpreter

If you understand the basics behind Minus the rest is easy, just convenient special cases and imposed limitations that make it run in the real world.

More special variables

j, j is , example: a-=j (if the user inputs '100qwerty', a will be the number 100, and subsequent reads will resume at q in qwerty) q, q is like o except it outputs as a number, example: a-=100; q-=a (prints 100) r, r if subtracted from something returns a random number 0 .. r. t-=100; r-=t; a-=r; (now a is a random number 0 to 99 inclusive. Note r retains its value so subsequent calls to r also return 0..100)
vardescriptionexampleeffect
jLike i except it inputs a numbera-=jIf input is '100asdf' then a = -100 and 'asdf' awaits being input.
qLike o except treats operand as a numberq-=1234Outputs '1234'
rReturns a random number 0...rr-=100;q-=rPrints a random number 0 to 99 inclusive. Note that because r is negative the random number generated is actually -99..0, but q also negates its operand.
_Print debug information, a-z and A-Za-=_Outputs [ a:0 b:0 c:0 d:0 e:0 f:0 g:0 h:0 i:0 j:0 k:0 l:0 m:0 n:0 o:0 p:0 q:0 r:0 s:0 t:0 u:0 v:-5000000 w:-32 x:-10 y:-2 z:-1 A:0 B:0 C:0 D:0 E:0 F:0 G:0 H:0 I:0 J:0 K:0 L:0 M:0 N:0 O:0 P:0 Q:0 R:0 S:0 T:0 U:0 V:0 W:0 X:0 Y:0 Z:0 ]. Its value is 0 so a is unaffected.
0-9_Can be used to exit the program immediately0-=aBecause 0 cannot be assigned to the program exits.

Input Separator

If an ! is present, everything after that will be treated as input. The ! cannot be commented out.

Comments

Anything after # is ignored. Anything inside { } is ignored. If { is unbalanced everything after it is ignored, vice versa for }. Nested {} are permitted.

Predefined values

Because some values are used so often, some variables will start off initialized to certain values, however the variable will act like a normal variable thereafter. These are:

z-1
y-2
x-10 (newline character)
w-32 (space character)
v-(max value value of p)
p-=v; Z-1 (the last value in memory)

Memory Size

Initial specification states infinite memory but this is not very practical in the real world. As such making p smaller than the smallest value it can index sets it to the smallest value. Vice versa for largest.

This addition is useful not only because it will prevent any illegal memory access, but it allows you to perform comparisons easily. Before, to check if a < b, you would need to subtract it and check all possible negative values in some range. Now, you can set p to 0, subtract p by (a-b) and add v. Z is now -1 if (a-b) is positive, 0 otherwise. (This is aided by preset variables, but nothing that could not have been done without them.)

Removal of excess characters

When the language is parsed, all optional or invalid characters are stripped. -= is not actually required, neither are newlines, spaces, semi colons etc. Since the syntax of the language is so simple (one command) and each operand is just 1 letter or a series of numbers, nothing is needed to determine where each statement ends. This allows the language to be very compact (and also hard to read) when all optional characters are removed.

Note that this leaves only a-zA-Z0-9, which could be packed very easily using base64.


That is everything there is to Minus, continue to check out the implementations

Or browse files