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 variablesj, 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)
Input SeparatorIf an ! is present, everything after that will be treated as input. The ! cannot be commented out.CommentsAnything after # is ignored. Anything inside { } is ignored. If { is unbalanced everything after it is ignored, vice versa for }. Nested {} are permitted.Predefined valuesBecause 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:
Memory SizeInitial 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 charactersWhen 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 |